how to use select widget? #73

Closed
opened 2026-02-16 00:18:39 -05:00 by yindo · 0 comments
Owner

Originally created by @Fei-Wang on GitHub (Dec 19, 2023).

class InputModel(BaseModel):
    choice: str = Field(
        ...,
        extra={
            "widget": {
                "type": "select",
                "options": ["String1", "String2"],
                # "oneOf": ["String1", "String2"],
                # "options": {"oneOf": ["String1", "String2"]},
            }
        },
    )

chain = prompt.with_types(input_type=InputModel) | llm | StrOutputParser()

I have already tried the three methods mentioned above, all of which failed. I read https://python.langchain.com/docs/langserve#playground-widgets, but I still don't know how to use the select widget.

Originally created by @Fei-Wang on GitHub (Dec 19, 2023). ```python3 class InputModel(BaseModel): choice: str = Field( ..., extra={ "widget": { "type": "select", "options": ["String1", "String2"], # "oneOf": ["String1", "String2"], # "options": {"oneOf": ["String1", "String2"]}, } }, ) chain = prompt.with_types(input_type=InputModel) | llm | StrOutputParser() ``` I have already tried the three methods mentioned above, all of which failed. I read `https://python.langchain.com/docs/langserve#playground-widgets`, but I still don't know how to use the select widget.
yindo closed this issue 2026-02-16 00:18:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langserve#73