Skip to content

Commit b397f32

Browse files
fix: Stringify gen_ai.tool.input attribute
1 parent 38d71b2 commit b397f32

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

sentry_sdk/integrations/openai_agents/spans/execute_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def execute_tool_span(
2929

3030
if should_send_default_pii():
3131
input = args[1]
32-
span.set_data(SPANDATA.GEN_AI_TOOL_INPUT, input)
32+
span.set_data(SPANDATA.GEN_AI_TOOL_INPUT, safe_repr(input))
3333

3434
return span
3535

sentry_sdk/integrations/openai_agents/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _create_mcp_execute_tool_spans(
228228
execute_tool_span.set_data(SPANDATA.GEN_AI_TOOL_NAME, output.name)
229229
if should_send_default_pii():
230230
execute_tool_span.set_data(
231-
SPANDATA.GEN_AI_TOOL_INPUT, output.arguments
231+
SPANDATA.GEN_AI_TOOL_INPUT, safe_repr(output.arguments)
232232
)
233233
execute_tool_span.set_data(
234234
SPANDATA.GEN_AI_TOOL_OUTPUT, safe_repr(output.output)

0 commit comments

Comments
 (0)