You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i try to create a custom tool extending Tool or using something like SerpAPI tool (which indeed extends Tool) and using it with ChatOpenAI with response_format: "json_schema" and strict:true i will receive an error because of the optional.
Is this behaviour something you want?
Could this schema be changed with something like
schema = z
.object({ input: z.string().nullable() })
.transform((obj) => obj.input);
So the property is always required so OpenAI doesn't complain?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Checked other resources
Commit to Help
Example Code
Description
The class
Tool
features the schema property as the follwoing:If i try to create a custom tool extending
Tool
or using something likeSerpAPI
tool (which indeed extendsTool
) and using it with ChatOpenAI withresponse_format: "json_schema"
andstrict:true
i will receive an error because of the optional.Is this behaviour something you want?
Could this schema be changed with something like
So the property is always required so OpenAI doesn't complain?
System Info
[email protected]
Beta Was this translation helpful? Give feedback.
All reactions