Skip to content

Commit 27e94cc

Browse files
committed
fix(openai-agents): Move _set_agent_data call to ai_client_span function
1 parent 9b58d31 commit 27e94cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sentry_sdk/integrations/openai_agents/spans/ai_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ def ai_client_span(agent, get_response_kwargs):
2828
# TODO-anton: remove hardcoded stuff and replace something that also works for embedding and so on
2929
span.set_data(SPANDATA.GEN_AI_OPERATION_NAME, "chat")
3030

31+
_set_agent_data(span, agent)
32+
3133
return span
3234

3335

3436
def update_ai_client_span(span, agent, get_response_kwargs, result):
3537
# type: (sentry_sdk.tracing.Span, Agent, dict[str, Any], Any) -> None
36-
_set_agent_data(span, agent)
3738
_set_usage_data(span, result.usage)
3839
_set_input_data(span, get_response_kwargs)
3940
_set_output_data(span, result)

0 commit comments

Comments
 (0)