Align gen_ai.tool_definitions with JSON Schema and add it to completion hook #4181
Merged
aabmass merged 28 commits intoopen-telemetry:mainfrom Feb 19, 2026
Merged
Conversation
DylanRussell
approved these changes
Feb 9, 2026
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_upload/completion_hook.py
Outdated
Show resolved
Hide resolved
RKest
approved these changes
Feb 9, 2026
aabmass
reviewed
Feb 12, 2026
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_upload/completion_hook.py
Outdated
Show resolved
Hide resolved
c79def6 to
c6531c5
Compare
c6531c5 to
a7bc9de
Compare
instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md
Show resolved
Hide resolved
...trumentation-google-genai/src/opentelemetry/instrumentation/google_genai/generate_content.py
Outdated
Show resolved
Hide resolved
...trumentation-google-genai/src/opentelemetry/instrumentation/google_genai/generate_content.py
Outdated
Show resolved
Hide resolved
util/opentelemetry-util-genai/src/opentelemetry/util/genai/types.py
Outdated
Show resolved
Hide resolved
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_upload/completion_hook.py
Outdated
Show resolved
Hide resolved
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_upload/completion_hook.py
Show resolved
Hide resolved
...trumentation-google-genai/src/opentelemetry/instrumentation/google_genai/generate_content.py
Outdated
Show resolved
Hide resolved
...trumentation-google-genai/src/opentelemetry/instrumentation/google_genai/generate_content.py
Show resolved
Hide resolved
...trumentation-google-genai/src/opentelemetry/instrumentation/google_genai/generate_content.py
Show resolved
Hide resolved
aabmass
reviewed
Feb 19, 2026
instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/requirements.oldest.txt
Show resolved
Hide resolved
instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md
Show resolved
Hide resolved
sightseeker
added a commit
to sightseeker/opentelemetry-python-contrib
that referenced
this pull request
Mar 11, 2026
…on hook (open-telemetry#4181) * add gen_ai.tool_definitions to completion hook * hash tool defintions * Update CHANGELOG * make tool.defintions optional in on_completion * fix lint errors * add gen_ai.tool_definitions to completion hook * hash tool defintions * fix CompetionHook docstring * fix lint test * add gen_ai.tool_definitions to completion hook * hash tool defintions * Update CHANGELOG * align tool.defintions with JSON schema * fix tests * fix ruff * fix unexpected indent * use local changes from util/opentelemetry-util-genai * fix ruff * add gen_ai.tool_definitions to completion hook * re-add changes lost during merge * put tool.defintions in the telemetry by default and the params behind the flag * fix: Too many local variables * address comments * Add comments to udpate of util-genai version after release --------- Co-authored-by: Aaron Abbott <aaronabbott@google.com>
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
This PR aligns
gen_ai.tool_definitionswith JSON Schema proposed in open-telemetry/semantic-conventions#3378.This PR also 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.Type of change
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.