Repository navigation
feat(sdk): record tool descriptions and schemas as captured input - #235
Merged
Merged
Conversation
Model spans list the tools offered to the model in gen_ai.tool.definitions, now with each tool's description and input JSON Schema when input capture is on. Each tool's type and name stay recorded whatever the capture flags. The Anthropic, OpenAI, OpenRouter, Bedrock Converse, Google GenAI, and AI SDK integrations (TypeScript and Python where both exist), LangChain, and the Python LiteLLM integration record the list. Google GenAI previously recorded descriptions and schemas whatever the capture flags; they now need input capture too. The core SDKs apply one rule to the attribute, so older integrations and values set by hand follow it: with input capture off only types and names stay, and with a mask the definitions go through it. The value can be JSON text or an array of one JSON text per tool. A list longer than the attribute limit keeps only types and names, so that it stays JSON.
Merged
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.
Model spans now record what each offered tool accepts, not only its name.
gen_ai.tool.definitionskeeps each tool's type and name whatever the capture flags, and with input capture on it adds the tool's description and its input JSON Schema asparameters, which pass throughmask. Built-in provider tools stay{type, name}.These integrations record the list:
Google GenAI used to record descriptions and schemas whatever the capture flags. They now need input capture, like the rest.
The core SDKs apply the same rule to the attribute itself, so values that older integrations or apps set by hand follow it too. The value can be JSON text or an array of one JSON text per tool. Descriptions and schemas count as content for
maxAttributeLength: a list that does not fit keeps only types and names, so it stays JSON instead of being cut. Each integration also checks input capture before adding descriptions, which keeps them out with a core older than this rule.The Python integrations still allow
telemetry-dev>=0.3.0. With an older core and amask, an integration from this change would send descriptions without masking them, so their minimum should move to the first core release with this rule, as #122 did for 0.3.0. The TypeScript peers move with the release.