-
Notifications
You must be signed in to change notification settings - Fork 19.4k
fix(core): Fix tool name check in name_dict for PydanticToolsParser #33479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(core): Fix tool name check in name_dict for PydanticToolsParser #33479
Conversation
CodSpeed Performance ReportMerging #33479 will not alter performanceComparing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keenborder786 awesome! could you add a unit test?
@eyurtsev Added Unit Tests |
model_config
in aBaseModel
, the{"type": <tool_name>}
value is derived from the title specified inmodel_config
when the results are parsed here. However, tool.name uses the class name (in uppercase) of theBaseModel
, resulting in aKeyError
when a custom title is provided inmodel_config
.The Best Solution will be to use the title provided in
model_config
attribute if provided one since that is whattype
will be parsed to, if not then usetool.__name__
. But need to make sure that this works only for Pydantic V2.with_structured_output
on ChatAnthropic #27260