Skip to content

Commit 104fe1d

Browse files
committed
Fix openai-agents import
1 parent 0e6e808 commit 104fe1d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sentry_sdk/integrations/openai_agents/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
)
1010

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

1420
except ImportError:
1521
raise DidNotEnable("OpenAI Agents not installed")

0 commit comments

Comments
 (0)