Skip to content

Commit 4f140e2

Browse files
committed
add tool name
1 parent f0fb4e3 commit 4f140e2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry_sdk/integrations/langchain.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def on_llm_start(
186186
watched_span = self._create_span(
187187
run_id,
188188
kwargs.get("parent_run_id"),
189-
op=OP.GEN_AI_,
189+
op=OP.GEN_AI_RUN,
190190
name=kwargs.get("name") or "Langchain LLM call",
191191
origin=LangchainIntegration.origin,
192192
)
@@ -388,6 +388,9 @@ def on_tool_start(self, serialized, input_str, *, run_id, **kwargs):
388388
name=serialized.get("name") or kwargs.get("name") or "AI tool usage",
389389
origin=LangchainIntegration.origin,
390390
)
391+
watched_span.span.set_data(
392+
SPANDATA.GEN_AI_TOOL_NAME, serialized.get("name")
393+
)
391394
if should_send_default_pii() and self.include_prompts:
392395
set_data_normalized(
393396
watched_span.span,

0 commit comments

Comments
 (0)