Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

fix: unstable `test_tool_calling_math_async` (#2234)

Zecheng Zhang5074dd7dd568
diff --git a/camel/utils/mcp.py b/camel/utils/mcp.py
index bcb4a415d..189208db6 100644
--- a/camel/utils/mcp.py
+++ b/camel/utils/mcp.py
@@ -69,7 +69,7 @@ class MCPServer:
func = getattr(instance, name, None)
if func is None or not callable(func):
raise ValueError(
- f"Method {name} not found in class {cls.__name} or "
+ f"Method {name} not found in class {cls.__name__} or "
"cannot be called."
)
wrapper = self.make_wrapper(func)
diff --git a/test/agents/test_chat_agent.py b/test/agents/test_chat_agent.py
index e5ff62660..c5f4b1c22 100644
--- a/test/agents/test_chat_agent.py
+++ b/test/agents/test_chat_agent.py
@@ -996,10 +996,12 @@ async def test_tool_calling_math_async(step_call_count=3):
meta_dict=None,
content="You are a help assistant.",
)
+ model_config = ChatGPTConfig(temperature=0)
math_funcs = sync_funcs_to_async([FunctionTool(MathToolkit().multiply)])
model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_4O_MINI,
+ model_config_dict=model_config.as_dict(),
)
agent = ChatAgent(
system_message=system_message,
@@ -1015,7 +1017,7 @@ async def test_tool_calling_math_async(step_call_count=3):
role_name="User",
role_type=RoleType.USER,
meta_dict=dict(),
- content="Calculate the result of: 2*8",
+ content="Calculate the result of: 2*8 with decimal places 0",
)
model_backend_rsp_tool = ChatCompletion(