Repository navigation
backport(google-genai): preserve JSON Schema tool parameters - #5200
Merged
aabmass merged 2 commits intoOct 22, 2026
Conversation
Backport of open-telemetry/opentelemetry-python-genai#834. Function declarations that define their schema via parameters_json_schema were reported in gen_ai.tool.definitions with parameters set to null, because only the parameters field was read.
Pull request dashboard statusMerged · refreshed 2026-10-22 18:21 UTC Status above doesn't look right?
|
- Skip the sampling-parameter test for anthropic >= 1.0, which removed temperature, top_p and top_k from messages.create(). - Pin the oldest claude-agent-sdk to 0.1.19. 0.1.14 is no longer on PyPI and 0.1.18 is yanked. - Drop type: ignore comments that pyright reports as unnecessary.
DylanRussell
approved these changes
Oct 22, 2026
aabmass
approved these changes
Oct 22, 2026
aabmass
merged commit Oct 22, 2026
5352e94
into
open-telemetry:package-release/opentelemetry-instrumentation-google-genai/v0.7bx
770 checks passed
Member
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.
Description
Important
This is a backport PR to the v0.7b release branch!
Backport of open-telemetry/opentelemetry-python-genai#834 to the v0.7b release branch.
When a
FunctionDeclarationdefines its schema throughparameters_json_schemainstead ofparameters,gen_ai.tool.definitionsreports the tool with"parameters": null. This change falls back toparameters_json_schemawhenparametersis unset;parametersstill takes precedence when both are present.Google ADK and other frameworks built on
google-genaideclare tools this way. Many of them still pinopentelemetry-instrumentation-google-genai<1, so they can only pick up the fix through a 0.7b patch release. If this lands, could we also get a0.7b2release?Related: open-telemetry/opentelemetry-python-genai#827 (fixed on
mainby open-telemetry/opentelemetry-python-genai#834)Type of change
How Has This Been Tested?
tests/generate_content/test_tool_definitions.py, which covers a JSON-schema-only declaration, an empty JSON schema, andparameterstaking precedence overparameters_json_schema. The upstream test relies on fixtures and VCR helpers that don't exist on this branch, so it was rewritten in this branch'sTestCasestyle.google-genai1.32.0 (oldest), 2.4.0 (latest pin), and 2.32.0.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
Additional CI fixes on this branch
The second commit repairs CI failures that already existed on
package-release/opentelemetry-instrumentation-google-genai/v0.7bxafter upstream dependency drift. It doesn't change behavior in these packages:instrumentation-anthropic(latest): the anthropic 1.0 release removedtemperature,top_pandtop_kfrommessages.create(). The sampling-parameter test is skipped on anthropic >= 1.0 and still runs on the oldest pin.instrumentation-claude-agent-sdk(oldest and lint):claude-agent-sdk==0.1.14has been removed from PyPI, so the oldest pin moves to 0.1.19. Version 0.1.18 is yanked, so 0.1.19 is the oldest available release at or above 0.1.14.typecheck: removes three# type: ignorecomments that pyright reports as unnecessary.