diff --git a/sentry_sdk/integrations/openai_agents/patches/tools.py b/sentry_sdk/integrations/openai_agents/patches/tools.py index 8ba398a27e..2ddf7e7592 100644 --- a/sentry_sdk/integrations/openai_agents/patches/tools.py +++ b/sentry_sdk/integrations/openai_agents/patches/tools.py @@ -15,6 +15,7 @@ try: import agents + from agents import FunctionTool except ImportError: raise DidNotEnable("OpenAI Agents not installed") @@ -33,7 +34,7 @@ async def _get_all_tools( wrapped_tools = [] for tool in tools: # Wrap only the function tools (for now) - if tool.__class__.__name__ != "FunctionTool": + if not isinstance(tool, FunctionTool): wrapped_tools.append(tool) continue