@@ -146,8 +146,8 @@ def _create_span(self, run_id, parent_id, **kwargs):
146
146
watched_span = WatchedSpan (sentry_sdk .start_span (** kwargs ))
147
147
148
148
if kwargs .get ("op" , "" ).startswith ("ai.pipeline." ):
149
- if kwargs .get ("description " ):
150
- set_ai_pipeline_name (kwargs .get ("description " ))
149
+ if kwargs .get ("name " ):
150
+ set_ai_pipeline_name (kwargs .get ("name " ))
151
151
watched_span .is_pipeline = True
152
152
153
153
watched_span .span .__enter__ ()
@@ -186,7 +186,7 @@ def on_llm_start(
186
186
run_id ,
187
187
kwargs .get ("parent_run_id" ),
188
188
op = OP .LANGCHAIN_RUN ,
189
- description = kwargs .get ("name" ) or "Langchain LLM call" ,
189
+ name = kwargs .get ("name" ) or "Langchain LLM call" ,
190
190
origin = LangchainIntegration .origin ,
191
191
)
192
192
span = watched_span .span
@@ -208,7 +208,7 @@ def on_chat_model_start(self, serialized, messages, *, run_id, **kwargs):
208
208
run_id ,
209
209
kwargs .get ("parent_run_id" ),
210
210
op = OP .LANGCHAIN_CHAT_COMPLETIONS_CREATE ,
211
- description = kwargs .get ("name" ) or "Langchain Chat Model" ,
211
+ name = kwargs .get ("name" ) or "Langchain Chat Model" ,
212
212
origin = LangchainIntegration .origin ,
213
213
)
214
214
span = watched_span .span
@@ -312,7 +312,7 @@ def on_chain_start(self, serialized, inputs, *, run_id, **kwargs):
312
312
if kwargs .get ("parent_run_id" ) is not None
313
313
else OP .LANGCHAIN_PIPELINE
314
314
),
315
- description = kwargs .get ("name" ) or "Chain execution" ,
315
+ name = kwargs .get ("name" ) or "Chain execution" ,
316
316
origin = LangchainIntegration .origin ,
317
317
)
318
318
metadata = kwargs .get ("metadata" )
@@ -345,7 +345,7 @@ def on_agent_action(self, action, *, run_id, **kwargs):
345
345
run_id ,
346
346
kwargs .get ("parent_run_id" ),
347
347
op = OP .LANGCHAIN_AGENT ,
348
- description = action .tool or "AI tool usage" ,
348
+ name = action .tool or "AI tool usage" ,
349
349
origin = LangchainIntegration .origin ,
350
350
)
351
351
if action .tool_input and should_send_default_pii () and self .include_prompts :
@@ -378,9 +378,7 @@ def on_tool_start(self, serialized, input_str, *, run_id, **kwargs):
378
378
run_id ,
379
379
kwargs .get ("parent_run_id" ),
380
380
op = OP .LANGCHAIN_TOOL ,
381
- description = serialized .get ("name" )
382
- or kwargs .get ("name" )
383
- or "AI tool usage" ,
381
+ name = serialized .get ("name" ) or kwargs .get ("name" ) or "AI tool usage" ,
384
382
origin = LangchainIntegration .origin ,
385
383
)
386
384
if should_send_default_pii () and self .include_prompts :
0 commit comments