-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support nested pydantic models with Gemini tool calling [DRAFT] #222
base: dev
Are you sure you want to change the base?
Conversation
…work but it is very complex. The test passes.
pprint.pprint(without_refs) | ||
|
||
# Get the name and description, and remove them from the schema | ||
name: str = without_refs.pop("title") # type: ignore |
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.
quick note:
name and description are already in super().tool_schema()
, so it's really just the parameters
field that needs to be modified (and thus remove duplicate code).
|
||
# Remove all instances of title key in each param definition | ||
# This is careful not to delete keys that represent a field with the name title | ||
remove_invalid_title_keys_from_parameters(parameters) |
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.
what if all of the conversion of parameters
was pushed inside this utility function so the main function remains clean and the utility function can be separately unit tested?
This isn't quite ready for review - it's still messy as I am experimenting. If I get it over the finish line I will clean it up beforehand. |
Attempt at addressing #221
The google-supported schema is very far off from openapi spec. This may be worth waiting for them to solve it themselves.