-
Notifications
You must be signed in to change notification settings - Fork 859
Add gen_ai.tool_definitions to completion hook #4181
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: main
Are you sure you want to change the base?
Add gen_ai.tool_definitions to completion hook #4181
Conversation
| return [asdict(dc) for dc in dataclass_list] | ||
| response: JsonEncodeable = [] | ||
| for data in data_list: | ||
| if isinstance(data, dict): |
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.
In what case will it be a dict ? Don't you always serialize the tool definitions to a sting ? And otherwise it's a dataclass ?
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.
The tool definitions are serialized into dictionaries, and in a fallback to a string.
Description
This PR adds
gen_ai.tool_definitionsto completion hook and configures exporting the attribute to GCS. Its configured the same way as system instructions, it's being hashed, since it might be large and often doesn't differ.Its a continuation of #4142, which added
gen_ai.tool_definitionstogen_ai.client.inference.operation.details.Please delete options that are not relevant.
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.