struct-sdk 0.2.22__tar.gz → 0.2.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/PKG-INFO +24 -1
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/README.md +23 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/pyproject.toml +1 -1
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/.gitignore +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/LICENSE +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/src/struct_sdk/__init__.py +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/src/struct_sdk/_genai_content.py +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/src/struct_sdk/anthropic.py +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/src/struct_sdk/claude_agent.py +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/src/struct_sdk/core.py +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/src/struct_sdk/langchain.py +0 -0
- {struct_sdk-0.2.22 → struct_sdk-0.2.23}/src/struct_sdk/openai.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: struct-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.23
|
|
4
4
|
Summary: Struct agent observability SDK — auto-instruments AI agent frameworks with OpenTelemetry
|
|
5
5
|
Project-URL: Homepage, https://struct.ai
|
|
6
6
|
Project-URL: Documentation, https://struct.ai/docs
|
|
@@ -389,6 +389,29 @@ Emits attributes per the OTel GenAI semantic conventions:
|
|
|
389
389
|
- `gen_ai.tool.{name, call.id, call.arguments, call.result}`
|
|
390
390
|
- `error.type` + `StatusCode.ERROR` on failures
|
|
391
391
|
|
|
392
|
+
### `error.type` values emitted
|
|
393
|
+
|
|
394
|
+
The OTel conventions ask instrumentations to document the error values
|
|
395
|
+
they report ("Instrumentations SHOULD document the list of errors they
|
|
396
|
+
report"). This SDK emits exactly two kinds of value, both alongside
|
|
397
|
+
span `StatusCode.ERROR`:
|
|
398
|
+
|
|
399
|
+
| Value | When | Meaning |
|
|
400
|
+
| --- | --- | --- |
|
|
401
|
+
| exception class name (e.g. `RuntimeError`, `httpx.ConnectError`) | the instrumented call raised | We failed to execute the request. Also records an OTel exception event. |
|
|
402
|
+
| `tool_error` | an `execute_tool` span whose result signalled failure **in band** — Anthropic `tool_result` blocks with `is_error: true`, MCP `CallToolResult.isError`, or a LangChain `ToolMessage` with `status="error"` | The tool ran and reported a failure back to the model (bad arguments, a domain "no"), so the model can self-correct. No exception object exists, so no class name is available. |
|
|
403
|
+
|
|
404
|
+
`tool_error` is a deliberate low-cardinality sentinel, which the
|
|
405
|
+
`error.type` convention explicitly permits ("another low-cardinality
|
|
406
|
+
error identifier"; a custom value MAY be used where no well-known one
|
|
407
|
+
applies). The same split is used by OpenTelemetry's MCP instrumentation
|
|
408
|
+
in OpenLLMetry, which likewise reports `error.type="tool_error"` for the
|
|
409
|
+
`isError` path and the exception class name otherwise.
|
|
410
|
+
|
|
411
|
+
The distinction is what lets a monitor page on genuine execution
|
|
412
|
+
failures while excluding failures the model already saw and can recover
|
|
413
|
+
from.
|
|
414
|
+
|
|
392
415
|
Note: `gen_ai.usage.input_tokens` for Anthropic is the true total — the
|
|
393
416
|
SDK adds back `cache_read_input_tokens` and
|
|
394
417
|
`cache_creation_input_tokens`, which Anthropic's raw response excludes
|
|
@@ -340,6 +340,29 @@ Emits attributes per the OTel GenAI semantic conventions:
|
|
|
340
340
|
- `gen_ai.tool.{name, call.id, call.arguments, call.result}`
|
|
341
341
|
- `error.type` + `StatusCode.ERROR` on failures
|
|
342
342
|
|
|
343
|
+
### `error.type` values emitted
|
|
344
|
+
|
|
345
|
+
The OTel conventions ask instrumentations to document the error values
|
|
346
|
+
they report ("Instrumentations SHOULD document the list of errors they
|
|
347
|
+
report"). This SDK emits exactly two kinds of value, both alongside
|
|
348
|
+
span `StatusCode.ERROR`:
|
|
349
|
+
|
|
350
|
+
| Value | When | Meaning |
|
|
351
|
+
| --- | --- | --- |
|
|
352
|
+
| exception class name (e.g. `RuntimeError`, `httpx.ConnectError`) | the instrumented call raised | We failed to execute the request. Also records an OTel exception event. |
|
|
353
|
+
| `tool_error` | an `execute_tool` span whose result signalled failure **in band** — Anthropic `tool_result` blocks with `is_error: true`, MCP `CallToolResult.isError`, or a LangChain `ToolMessage` with `status="error"` | The tool ran and reported a failure back to the model (bad arguments, a domain "no"), so the model can self-correct. No exception object exists, so no class name is available. |
|
|
354
|
+
|
|
355
|
+
`tool_error` is a deliberate low-cardinality sentinel, which the
|
|
356
|
+
`error.type` convention explicitly permits ("another low-cardinality
|
|
357
|
+
error identifier"; a custom value MAY be used where no well-known one
|
|
358
|
+
applies). The same split is used by OpenTelemetry's MCP instrumentation
|
|
359
|
+
in OpenLLMetry, which likewise reports `error.type="tool_error"` for the
|
|
360
|
+
`isError` path and the exception class name otherwise.
|
|
361
|
+
|
|
362
|
+
The distinction is what lets a monitor page on genuine execution
|
|
363
|
+
failures while excluding failures the model already saw and can recover
|
|
364
|
+
from.
|
|
365
|
+
|
|
343
366
|
Note: `gen_ai.usage.input_tokens` for Anthropic is the true total — the
|
|
344
367
|
SDK adds back `cache_read_input_tokens` and
|
|
345
368
|
`cache_creation_input_tokens`, which Anthropic's raw response excludes
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "struct-sdk"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.23"
|
|
8
8
|
description = "Struct agent observability SDK — auto-instruments AI agent frameworks with OpenTelemetry"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|