Skip to content

Commit 9001126

Browse files
authored
Update HuggingFace Hub integration (#4746)
Make our existing `huggingface_hub` integration compatible with the new AI Agents insights module. All spans created by the integrations should should create all spans applicable form the [AI Insights ](https://develop.sentry.dev/sdk/telemetry/traces/modules/ai-agents/)documentation. All spans must have the correct span.op, span.name/span.description and span.data/span.attributes set. This makes our SDK and data compatible with v1.36.0 of the Semantic conventions for generative AI systems of OpenTelementry. There are some cases where our AI Insights documentation diverges from Otels semantic conventions. Details for those attributes can be found in the [Sentry conventions](https://getsentry.github.io/sentry-conventions/generated/attributes/gen_ai.html).
1 parent 6463f73 commit 9001126

File tree

6 files changed

+1050
-220
lines changed

6 files changed

+1050
-220
lines changed

scripts/populate_tox/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@
155155
},
156156
"huggingface_hub": {
157157
"package": "huggingface_hub",
158+
"deps": {
159+
"*": ["responses"],
160+
},
158161
},
159162
"langchain-base": {
160163
"package": "langchain",

sentry_sdk/consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ class OP:
795795
GEN_AI_CREATE_AGENT = "gen_ai.create_agent"
796796
GEN_AI_EMBEDDINGS = "gen_ai.embeddings"
797797
GEN_AI_EXECUTE_TOOL = "gen_ai.execute_tool"
798+
GEN_AI_GENERATE_TEXT = "gen_ai.generate_text"
798799
GEN_AI_HANDOFF = "gen_ai.handoff"
799800
GEN_AI_PIPELINE = "gen_ai.pipeline"
800801
GEN_AI_INVOKE_AGENT = "gen_ai.invoke_agent"

sentry_sdk/integrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def iter_default_integrations(with_auto_enabling_integrations):
141141
"gql": (3, 4, 1),
142142
"graphene": (3, 3),
143143
"grpc": (1, 32, 0), # grpcio
144-
"huggingface_hub": (0, 22),
144+
"huggingface_hub": (0, 24, 7),
145145
"langchain": (0, 1, 0),
146146
"langgraph": (0, 6, 6),
147147
"launchdarkly": (9, 8, 0),

0 commit comments

Comments
 (0)