struct-sdk 0.2.27__tar.gz → 0.2.29__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.27 → struct_sdk-0.2.29}/PKG-INFO +1 -1
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/pyproject.toml +1 -1
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/src/struct_sdk/langchain.py +26 -5
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/src/struct_sdk/openai.py +8 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/.gitignore +0 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/LICENSE +0 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/README.md +0 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/src/struct_sdk/__init__.py +0 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/src/struct_sdk/_genai_content.py +0 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/src/struct_sdk/anthropic.py +0 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/src/struct_sdk/claude_agent.py +0 -0
- {struct_sdk-0.2.27 → struct_sdk-0.2.29}/src/struct_sdk/core.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: struct-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.29
|
|
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
|
|
@@ -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.29"
|
|
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"
|
|
@@ -210,15 +210,30 @@ def _inject_handler(existing: Any, handler: Optional["StructCallbackHandler"]) -
|
|
|
210
210
|
# ---------------------------------------------------------------------------
|
|
211
211
|
# Provider / model detection
|
|
212
212
|
# ---------------------------------------------------------------------------
|
|
213
|
-
|
|
213
|
+
# Values MUST be `gen_ai.provider.name` well-known values from the OTel GenAI
|
|
214
|
+
# registry (now open-telemetry/semantic-conventions-genai; the attribute is
|
|
215
|
+
# marked Moved in the main semantic-conventions repo). Re-validated against the
|
|
216
|
+
# registry 2026-09-30, which defines exactly: openai, gcp.gen_ai, gcp.vertex_ai,
|
|
217
|
+
# gcp.gemini, anthropic, cohere, azure.ai.inference, azure.ai.openai,
|
|
218
|
+
# ibm.watsonx.ai, aws.bedrock, perplexity, x_ai, deepseek, groq, mistral_ai,
|
|
219
|
+
# moonshot_ai.
|
|
220
|
+
# Two values here were NOT in that enum and were corrected 2026-09-30:
|
|
221
|
+
# gcp.generative_ai -> gcp.gemini (ChatGoogleGenerativeAI targets
|
|
222
|
+
# generativelanguage.googleapis.com, which
|
|
223
|
+
# is exactly when the spec says gcp.gemini)
|
|
224
|
+
# mistral -> mistral_ai (also disagreed with this SDK's own
|
|
225
|
+
# OpenAI-compatible host map, which had
|
|
226
|
+
# mistral_ai right all along)
|
|
227
|
+
# fireworks / together / ollama are deliberate open-enum extensions: the spec
|
|
228
|
+
# defines no value for them and the enum is open.
|
|
214
229
|
_PROVIDER_MAP: dict[str, str] = {
|
|
215
230
|
"ChatOpenAI": "openai",
|
|
216
231
|
"AzureChatOpenAI": "azure.ai.openai",
|
|
217
232
|
"ChatAnthropic": "anthropic",
|
|
218
|
-
"ChatGoogleGenerativeAI": "gcp.
|
|
233
|
+
"ChatGoogleGenerativeAI": "gcp.gemini",
|
|
219
234
|
"ChatVertexAI": "gcp.vertex_ai",
|
|
220
235
|
"ChatCohere": "cohere",
|
|
221
|
-
"ChatMistralAI": "
|
|
236
|
+
"ChatMistralAI": "mistral_ai",
|
|
222
237
|
"ChatGroq": "groq",
|
|
223
238
|
"ChatBedrock": "aws.bedrock",
|
|
224
239
|
"ChatBedrockConverse": "aws.bedrock",
|
|
@@ -232,9 +247,15 @@ _PROVIDER_MAP: dict[str, str] = {
|
|
|
232
247
|
_MODULE_PROVIDER_MAP: dict[str, str] = {
|
|
233
248
|
"openai": "openai",
|
|
234
249
|
"anthropic": "anthropic",
|
|
235
|
-
|
|
250
|
+
# Order matters: first matching segment wins. langchain_google_vertexai
|
|
251
|
+
# splits into [langchain, google, vertexai], so "vertexai" must precede
|
|
252
|
+
# "google" or Vertex traffic is labelled gcp.gemini (the AI Studio endpoint).
|
|
253
|
+
"vertexai": "gcp.vertex_ai",
|
|
254
|
+
"google": "gcp.gemini",
|
|
236
255
|
"cohere": "cohere",
|
|
237
|
-
|
|
256
|
+
# The partner package is langchain_mistralai, whose segment is "mistralai".
|
|
257
|
+
"mistralai": "mistral_ai",
|
|
258
|
+
"mistral": "mistral_ai",
|
|
238
259
|
"groq": "groq",
|
|
239
260
|
"bedrock": "aws.bedrock",
|
|
240
261
|
"fireworks": "fireworks",
|
|
@@ -116,6 +116,14 @@ _OPENAI_COMPATIBLE_HOSTS: dict[str, str] = {
|
|
|
116
116
|
"api.groq.com": "groq",
|
|
117
117
|
"api.deepseek.com": "deepseek",
|
|
118
118
|
"api.mistral.ai": "mistral_ai",
|
|
119
|
+
# Enum values verified 2026-10-01 against each vendor's own API docs.
|
|
120
|
+
"api.perplexity.ai": "perplexity",
|
|
121
|
+
"api.moonshot.ai": "moonshot_ai",
|
|
122
|
+
"api.moonshot.cn": "moonshot_ai",
|
|
123
|
+
# Cohere's OpenAI-compatible endpoint is api.cohere.ai/compatibility/v1;
|
|
124
|
+
# its docs also use api.cohere.com for the same path.
|
|
125
|
+
"api.cohere.ai": "cohere",
|
|
126
|
+
"api.cohere.com": "cohere",
|
|
119
127
|
}
|
|
120
128
|
|
|
121
129
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|