-
Notifications
You must be signed in to change notification settings - Fork 671
types: allow items and defs for tools #501
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
Conversation
Glad to see you working on the python client. FYI In my testing, to get it to emit the field named "$defs" (it has an alias) in file _client.py I needed to change the model_dump() to include by_alias=True
|
I'll give that a look - didn't test thoroughly yet but initial test looked fine. Thanks for the heads up! |
8bd689f
to
8a52e8e
Compare
Hi Parth - However, it requires Pydantic >=2.11.0, and that may not be acceptable to the project. Here is the code that worked for me.
With this change, "oterm" was able to pass through the complex json schema with the $defs clause. |
@sheffler trying something similar to what we do already want to give this branch another shot? |
will try it out tomorrow. |
Done! I performed a test using 😃 |
Awesome! thanks for the double check @sheffler! |
@model_serializer(mode='wrap') | ||
def serialize_model(self, nxt): | ||
output = nxt(self) | ||
if 'tools' in output and output['tools']: |
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.
this is the same pattern as the create request
ff for: ollama/ollama#10091