types: allow items and defs for tools#501
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.
this is the same pattern as the create request
ff for: ollama/ollama#10091