Closed
Description
In the demo here if we add a description to the first select as:
class SelectForm(BaseModel):
select_single: ToolEnum = Field(title='Select Single', description="First selector")
select_multiple: list[ToolEnum] = Field(title='Select Multiple')
search_select_single: str = Field(json_schema_extra={'search_url': '/api/forms/search'})
search_select_multiple: list[str] = Field(json_schema_extra={'search_url': '/api/forms/search'})
it produces the following, where we can see the description leaking to the next select:
However, I noticed that if I use a different Enum
for the second selector this does not happen; e.g:
class ToolEnum2(str, enum.Enum):
hammer = 'hammer'
screwdriver = 'screwdriver'
saw = 'saw'
claw_hammer = 'claw_hammer'
class SelectForm(BaseModel):
select_single: ToolEnum = Field(title='Select Single', description="First selector")
select_multiple: list[ToolEnum2] = Field(title='Select Multiple')
search_select_single: str = Field(json_schema_extra={'search_url': '/api/forms/search'})
search_select_multiple: list[str] = Field(json_schema_extra={'search_url': '/api/forms/search'})
Note: adding a description to the second select in the initial case doesn't work either, the first description still keeps it spot:
class SelectForm(BaseModel):
select_single: ToolEnum = Field(title='Select Single', description="First selector")
select_multiple: list[ToolEnum] = Field(title='Select Multiple', description="Second selector")
search_select_single: str = Field(json_schema_extra={'search_url': '/api/forms/search'})
search_select_multiple: list[str] = Field(json_schema_extra={'search_url': '/api/forms/search'})
my 2 cents; I believe the description gets attached to the components by it's name and the component name is derived by the Enum
name - though i am unsure how to solve it for now