Skip to content

Align gen_ai.tool_definitions with JSON Schema and add it to completion hook #4181

Merged
aabmass merged 28 commits intoopen-telemetry:mainfrom
wikaaaaa:tooldefinitions-completionhook
Feb 19, 2026
Merged

Align gen_ai.tool_definitions with JSON Schema and add it to completion hook #4181
aabmass merged 28 commits intoopen-telemetry:mainfrom
wikaaaaa:tooldefinitions-completionhook

Conversation

@wikaaaaa
Copy link
Copy Markdown
Contributor

@wikaaaaa wikaaaaa commented Feb 9, 2026

Description

This PR aligns gen_ai.tool_definitions with JSON Schema proposed in open-telemetry/semantic-conventions#3378.

This PR also adds gen_ai.tool_definitions to 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_definitions to gen_ai.client.inference.operation.details.

Type of change

New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Manual tests: run adk web and inspected the traces and data send to the storage bucket
  • Unit tests

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@wikaaaaa wikaaaaa changed the title Add gen_ai.tool_definitions to completion hook Align gen_ai.tool_definitions with JSON Schema and add it to completion hook Feb 17, 2026
@wikaaaaa wikaaaaa force-pushed the tooldefinitions-completionhook branch from c79def6 to c6531c5 Compare February 17, 2026 14:03
@wikaaaaa wikaaaaa force-pushed the tooldefinitions-completionhook branch from c6531c5 to a7bc9de Compare February 17, 2026 14:06
@aabmass aabmass merged commit 8c3cc85 into open-telemetry:main Feb 19, 2026
762 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants