Repository navigation
fix(vertexai): record tool definitions as llm.tools - #4463
Open
abhishekacharya200 wants to merge 1 commit into
Open
abhishekacharya200 wants to merge 1 commit into
abhishekacharya200 wants to merge 1 commit into
Conversation
Contributor
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4450
The vertexai instrumentor now records the tools passed in a
GenerateContentRequestasllm.tools.N.tool.json_schema.Before this change
_update_spannever looked atreq.tools, so a span for a request with function declarations had nollm.toolsattributes. The tool schemas were only visible inside the rawinput.valueJSON. The google-genai instrumentor already records them, and this does the same for vertexai.Changes:
_wrapper.py: new_get_tool_attributesyields onellm.tools.N.tool.json_schemaper function declaration, as{name, description, parameters}like the google-genai instrumentor. A tool with no function declarations (for examplegoogle_search) is recorded whole. This works for both thev1andv1beta1request types. The existinghide_inputs/hide_llm_toolsconfig already hides these attributes.test_gapic_client.pyspan tests assert that every attribute is accounted for, so with this change they check theget_current_weatherschema from thetoolfixture. Added a test with twoTools to check the numbering across tools.Without the source change the 34 affected tests fail (the schema attribute is missing); with it the vertexai test suite passes, apart from
test_entrypoint_for_opentelemetry_instrument, which fails the same way on main in my environment.