From 128ec46c251bd7d439961d0aa458e15537b9927a Mon Sep 17 00:00:00 2001 From: Aikins Laryea Date: Thu, 26 Nov 2026 15:40:16 +0000 Subject: [PATCH] fix(sdk-python): require telemetry-dev 0.3.9 in the python integrations The integrations record each offered tool's description and input schema in gen_ai.tool.definitions, and core 0.3.9 is the release that keeps only names there when input capture is off and passes the rest through mask. With an older core they would send descriptions and schemas whatever the capture settings. The Python conformance driver's C25 now sends a full definition in the raw attribute, so the cross-language check covers the stripping. --- docs/sdk-conformance.md | 2 +- sdks/python-anthropic/pyproject.toml | 2 +- sdks/python-bedrock/pyproject.toml | 2 +- sdks/python-google-genai/pyproject.toml | 2 +- sdks/python-litellm/pyproject.toml | 2 +- sdks/python-openai/pyproject.toml | 2 +- sdks/python-openrouter/pyproject.toml | 2 +- sdks/python/tests/e2e_scenarios.py | 19 +++++++++++++++---- 8 files changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/sdk-conformance.md b/docs/sdk-conformance.md index ff91254..3c6b7a6 100644 --- a/docs/sdk-conformance.md +++ b/docs/sdk-conformance.md @@ -557,7 +557,7 @@ do not sanitize raw OpenTelemetry events or arbitrary attributes. | C22 | Streaming truncation: `telemetry.dev.capture.truncated = true` survives OTLP transport and ingest on the streamed generation | | C23 | Captured JSON matches an independently specified JSON.stringify byte sequence, including number spelling, key ordering, non-finite values and Unicode | | C24 | Advisor model and native counters survive transport and storage without changing executor usage or rollup totals; provider extraction is covered in the integration packages' tests | -| C25 | Offered tool names in `gen_ai.tool.definitions` are stored byte-for-byte with input capture off, and the tool description is not; the Anthropic integration tests cover building them from request tools | +| C25 | Offered tool names in `gen_ai.tool.definitions` are stored byte-for-byte with input capture off; the description and schema, in the input or in the raw attribute, are not; the Anthropic integration tests cover building them from request tools | | C26 | Prompt spans: `prompted-call` and `prompted-private` carry `td.prompt.name` `support/reply`, `td.prompt.version` 12 (integer) and `td.prompt.label` `production`; only `prompted-call` carries `td.prompt.variables` `{"customer":"Ada"}`. `prompted-big` (C26b) carries the variables `customer` `Ada` and `history` of 40,000 🤖, past the old 65,536-unit default cap, whole | ## Modality publication gate diff --git a/sdks/python-anthropic/pyproject.toml b/sdks/python-anthropic/pyproject.toml index d409e7b..637c1ba 100644 --- a/sdks/python-anthropic/pyproject.toml +++ b/sdks/python-anthropic/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "telemetry-dev>=0.3.0", + "telemetry-dev>=0.3.9", "anthropic>=0.116,<3", ] diff --git a/sdks/python-bedrock/pyproject.toml b/sdks/python-bedrock/pyproject.toml index 8aef533..395029e 100644 --- a/sdks/python-bedrock/pyproject.toml +++ b/sdks/python-bedrock/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "telemetry-dev>=0.3.0", + "telemetry-dev>=0.3.9", "boto3>=1.36", ] diff --git a/sdks/python-google-genai/pyproject.toml b/sdks/python-google-genai/pyproject.toml index 5465896..995a8b8 100644 --- a/sdks/python-google-genai/pyproject.toml +++ b/sdks/python-google-genai/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "telemetry-dev>=0.3.0", + "telemetry-dev>=0.3.9", "google-genai>=2,<3", ] diff --git a/sdks/python-litellm/pyproject.toml b/sdks/python-litellm/pyproject.toml index 70ee6e1..5600686 100644 --- a/sdks/python-litellm/pyproject.toml +++ b/sdks/python-litellm/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "telemetry-dev>=0.3.0", + "telemetry-dev>=0.3.9", "litellm>=1.90.2,<2.0", "opentelemetry-api>=1.39.0,<2", ] diff --git a/sdks/python-openai/pyproject.toml b/sdks/python-openai/pyproject.toml index db53a20..f781d9e 100644 --- a/sdks/python-openai/pyproject.toml +++ b/sdks/python-openai/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "telemetry-dev>=0.3.0", + "telemetry-dev>=0.3.9", "openai>=2,<4", ] diff --git a/sdks/python-openrouter/pyproject.toml b/sdks/python-openrouter/pyproject.toml index 62ee487..72b9993 100644 --- a/sdks/python-openrouter/pyproject.toml +++ b/sdks/python-openrouter/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ - "telemetry-dev>=0.3.0", + "telemetry-dev>=0.3.9", "openrouter>=1.1.0,<2", ] diff --git a/sdks/python/tests/e2e_scenarios.py b/sdks/python/tests/e2e_scenarios.py index 8087c15..e9f5fd8 100644 --- a/sdks/python/tests/e2e_scenarios.py +++ b/sdks/python/tests/e2e_scenarios.py @@ -249,7 +249,8 @@ def main() -> int: "anthropic.advisor.usage.cache_creation_input_tokens": 13, }, ).end() - # C25: offered tool names are kept with input capture off; the description is not. + # C25: offered tool names are kept with input capture off; descriptions and schemas, + # in the input or in the raw attribute, are not. start_span( "tool-offer", type="generation", @@ -260,9 +261,19 @@ def main() -> int: }, capture_input=False, attributes={ - "gen_ai.tool.definitions": ( - '[{"type":"function","name":"issue_refund"},' - '{"type":"web_search_20250305","name":"web_search"}]' + "gen_ai.tool.definitions": json.dumps( + [ + { + "type": "function", + "name": "issue_refund", + "description": "PRIVATE_TOOL_DESCRIPTION", + "parameters": { + "type": "object", + "properties": {"PRIVATE_TOOL_SCHEMA": {}}, + }, + }, + {"type": "web_search_20250305", "name": "web_search"}, + ] ), }, ).end()