Build and run agents you can see, understand and trust.
Python agentchatbotlarge-language-modelsllmllm-agentmcpmulti-agentmulti-modalreact-agentrealtime-agentvoice-agentvoice-assistant
fix(agent): separate the logic of the arguments `enable_meta_tool` and `plan_notebook` (#880)
Zheng Dayu7f83c1eda397
diff --git a/src/agentscope/agent/_react_agent.py b/src/agentscope/agent/_react_agent.pyindex f221b1f2a..07cbd3605 100644--- a/src/agentscope/agent/_react_agent.py+++ b/src/agentscope/agent/_react_agent.py@@ -225,15 +225,24 @@ class ReActAgent(ReActAgentBase):self.plan_notebook = Noneif plan_notebook:self.plan_notebook = plan_notebook- self.toolkit.create_tool_group(- "plan_related",- description=self.plan_notebook.description,- )- for tool in plan_notebook.list_tools():- self.toolkit.register_tool_function(- tool,- group_name="plan_related",+ # When enable_meta_tool is True, plan tools are in plan_related+ # group and active by agent.+ # Otherwise, plan tools in bassic group and always active.+ if enable_meta_tool:+ self.toolkit.create_tool_group(+ "plan_related",+ description=self.plan_notebook.description,)+ for tool in plan_notebook.list_tools():+ self.toolkit.register_tool_function(+ tool,+ group_name="plan_related",+ )+ else:+ for tool in plan_notebook.list_tools():+ self.toolkit.register_tool_function(+ tool,+ )# If print the reasoning hint messagesself.print_hint_msg = print_hint_msg