How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.71.0
Steps to Reproduce
sentry_sdk.init(integrations=[OpenAIAgentsIntegration()], send_default_pii=True, traces_sample_rate=1.0) with openai-agents installed.
- Enable
DeprecationWarnings (python -W error::DeprecationWarning, or any dependency that does so process-wide).
- Run an agent whose model response contains a function call.
Expected Result
No warning from sentry_sdk.
Actual Result
PydanticDeprecatedSince20: The `dict` method is deprecated; use `model_dump` instead.
sentry_sdk/integrations/openai_agents/utils.py:229
The same warning comes from line 236 when a message contains non-text content such as a refusal.
|
for output in result.output: |
|
if output.type == "function_call": |
|
output_messages["tool"].append(output.dict()) |
|
elif output.type == "message": |
|
for output_message in output.content: |
|
try: |
|
output_messages["response"].append(output_message.text) |
|
except AttributeError: |
|
# Unknown output message type, just return the json |
|
output_messages["response"].append(output_message.dict()) |
Every supported openai-agents version requires Pydantic v2, so model_dump() is a drop-in replacement.
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.71.0
Steps to Reproduce
sentry_sdk.init(integrations=[OpenAIAgentsIntegration()], send_default_pii=True, traces_sample_rate=1.0)withopenai-agentsinstalled.DeprecationWarnings (python -W error::DeprecationWarning, or any dependency that does so process-wide).Expected Result
No warning from
sentry_sdk.Actual Result
The same warning comes from line 236 when a message contains non-text content such as a refusal.
sentry-python/sentry_sdk/integrations/openai_agents/utils.py
Lines 227 to 236 in 8afefe8
Every supported
openai-agentsversion requires Pydantic v2, somodel_dump()is a drop-in replacement.