Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sentry_sdk/integrations/openai_agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
)

try:
# "agents" is too generic. If someone has an agents.py file in their project
# or another package that's importable via "agents", no ImportError would not
# be thrown and the integration would enable itself even if openai-agents is
# not installed. That's why we're adding the second, more specific import
# after it, even if we don't use it.
import agents
from agents.run import DEFAULT_AGENT_RUNNER

except ImportError:
raise DidNotEnable("OpenAI Agents not installed")
Expand Down