camel-ai 0.2.73a1__py3-none-any.whl → 0.2.73a2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of camel-ai might be problematic. Click here for more details.
- camel/__init__.py +1 -1
- camel/agents/chat_agent.py +26 -1
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py +101 -1101
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit_ts.py +1177 -0
- camel/toolkits/hybrid_browser_toolkit/ts/websocket-server.js +46 -2
- camel/toolkits/hybrid_browser_toolkit_py/__init__.py +17 -0
- camel/toolkits/hybrid_browser_toolkit_py/actions.py +417 -0
- camel/toolkits/hybrid_browser_toolkit_py/agent.py +311 -0
- camel/toolkits/hybrid_browser_toolkit_py/browser_session.py +740 -0
- camel/toolkits/hybrid_browser_toolkit_py/config_loader.py +447 -0
- camel/toolkits/hybrid_browser_toolkit_py/hybrid_browser_toolkit.py +1994 -0
- camel/toolkits/hybrid_browser_toolkit_py/snapshot.py +227 -0
- camel/toolkits/hybrid_browser_toolkit_py/stealth_script.js +0 -0
- camel/toolkits/hybrid_browser_toolkit_py/unified_analyzer.js +1002 -0
- camel/toolkits/slack_toolkit.py +38 -48
- {camel_ai-0.2.73a1.dist-info → camel_ai-0.2.73a2.dist-info}/METADATA +1 -1
- {camel_ai-0.2.73a1.dist-info → camel_ai-0.2.73a2.dist-info}/RECORD +19 -9
- {camel_ai-0.2.73a1.dist-info → camel_ai-0.2.73a2.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.73a1.dist-info → camel_ai-0.2.73a2.dist-info}/licenses/LICENSE +0 -0
camel/__init__.py
CHANGED
camel/agents/chat_agent.py
CHANGED
|
@@ -2929,7 +2929,32 @@ class ChatAgent(BaseAgent):
|
|
|
2929
2929
|
if function_name in self._internal_tools:
|
|
2930
2930
|
tool = self._internal_tools[function_name]
|
|
2931
2931
|
try:
|
|
2932
|
-
|
|
2932
|
+
# Try different invocation paths in order of preference
|
|
2933
|
+
if hasattr(tool, 'func') and hasattr(
|
|
2934
|
+
tool.func, 'async_call'
|
|
2935
|
+
):
|
|
2936
|
+
# Case: FunctionTool wrapping an MCP tool
|
|
2937
|
+
result = await tool.func.async_call(**args)
|
|
2938
|
+
|
|
2939
|
+
elif hasattr(tool, 'async_call') and callable(
|
|
2940
|
+
tool.async_call
|
|
2941
|
+
):
|
|
2942
|
+
# Case: tool itself has async_call
|
|
2943
|
+
result = await tool.async_call(**args)
|
|
2944
|
+
|
|
2945
|
+
elif hasattr(tool, 'func') and asyncio.iscoroutinefunction(
|
|
2946
|
+
tool.func
|
|
2947
|
+
):
|
|
2948
|
+
# Case: tool wraps a direct async function
|
|
2949
|
+
result = await tool.func(**args)
|
|
2950
|
+
|
|
2951
|
+
elif asyncio.iscoroutinefunction(tool):
|
|
2952
|
+
# Case: tool is itself a coroutine function
|
|
2953
|
+
result = await tool(**args)
|
|
2954
|
+
|
|
2955
|
+
else:
|
|
2956
|
+
# Fallback: synchronous call
|
|
2957
|
+
result = tool(**args)
|
|
2933
2958
|
|
|
2934
2959
|
# Only record the tool response message, not the assistant
|
|
2935
2960
|
# message assistant message with tool_calls was already
|