-
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 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Fei-Wang, The only widgets can be specified in the extras: "chat" and "base64file". All the other widgets are constructed automatically by the UI depending on the schema of the Runnable. If you want to do a See LCEL documentation for configurable runnables: https://python.langchain.com/docs/expression_language/how_to/configure Here's a server example: https://github.com/langchain-ai/langserve/blob/main/examples/configurable_chain/server.py |
Beta Was this translation helpful? Give feedback.
Hi @Fei-Wang,
The only widgets can be specified in the extras: "chat" and "base64file".
All the other widgets are constructed automatically by the UI depending on the schema of the Runnable.
If you want to do a
select
, you need to create a configurable runnable -- the widget will be created automaticallySee LCEL documentation for configurable runnables: https://python.langchain.com/docs/expression_language/how_to/configure
Here's a server example: https://github.com/langchain-ai/langserve/blob/main/examples/configurable_chain/server.py