Skip to content

Commit c16daa0

Browse files
fix(openai-agents): Use isinstance to determine tool type
1 parent 852b88a commit c16daa0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • sentry_sdk/integrations/openai_agents/patches

‎sentry_sdk/integrations/openai_agents/patches/tools.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
try:
1717
import agents
18+
from agents import FunctionTool
1819
except ImportError:
1920
raise DidNotEnable("OpenAI Agents not installed")
2021

@@ -33,7 +34,7 @@ async def _get_all_tools(
3334
wrapped_tools = []
3435
for tool in tools:
3536
# Wrap only the function tools (for now)
36-
if tool.__class__.__name__ != "FunctionTool":
37+
if not isinstance(tool, FunctionTool):
3738
wrapped_tools.append(tool)
3839
continue
3940

0 commit comments

Comments
 (0)