Skip to content

Build and run agents you can see, understand and trust.

[HOTFIX] Fix the bug in the plan module (#771)

DavdGaob9d0d2cffe10
diff --git a/docs/tutorial/en/src/task_plan.py b/docs/tutorial/en/src/task_plan.py
index 8c1abcc40..556408a82 100644
--- a/docs/tutorial/en/src/task_plan.py
+++ b/docs/tutorial/en/src/task_plan.py
@@ -133,7 +133,7 @@ plan_notebook = PlanNotebook()
async def list_tools() -> None:
"""List the tool functions provided by PlanNotebook."""
print("The tools provided by PlanNotebook:")
- for tool in await plan_notebook.list_tools():
+ for tool in plan_notebook.list_tools():
print(tool.__name__)
diff --git a/docs/tutorial/zh_CN/src/task_plan.py b/docs/tutorial/zh_CN/src/task_plan.py
index 58f56441a..09644263c 100644
--- a/docs/tutorial/zh_CN/src/task_plan.py
+++ b/docs/tutorial/zh_CN/src/task_plan.py
@@ -125,7 +125,7 @@ plan_notebook = PlanNotebook()
async def list_tools() -> None:
"""列出PlanNotebook提供的工具函数。"""
print("PlanNotebook提供的工具:")
- for tool in await plan_notebook.list_tools():
+ for tool in plan_notebook.list_tools():
print(tool.__name__)
diff --git a/src/agentscope/_version.py b/src/agentscope/_version.py
index eb8425f9a..1e49881c2 100644
--- a/src/agentscope/_version.py
+++ b/src/agentscope/_version.py
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
"""The version of agentscope."""
-__version__ = "1.0.2"
+__version__ = "1.0.3"
diff --git a/src/agentscope/agent/_react_agent.py b/src/agentscope/agent/_react_agent.py
index 581e6425d..51fdd0ecd 100644
--- a/src/agentscope/agent/_react_agent.py
+++ b/src/agentscope/agent/_react_agent.py
@@ -191,7 +191,7 @@ class ReActAgent(ReActAgentBase):
"plan_related",
description=self.plan_notebook.description,
)
- for tool in asyncio.run(plan_notebook.list_tools()):
+ for tool in plan_notebook.list_tools():
self.toolkit.register_tool_function(
tool,
group_name="plan_related",
diff --git a/src/agentscope/plan/_plan_notebook.py b/src/agentscope/plan/_plan_notebook.py
index 9830bc842..e4c1afc18 100644
--- a/src/agentscope/plan/_plan_notebook.py
+++ b/src/agentscope/plan/_plan_notebook.py
@@ -748,7 +748,7 @@ class PlanNotebook(StateModule):
self.current_plan = historical_plan
return res
- async def list_tools(
+ def list_tools(
self,
) -> list[Callable[..., Coroutine[Any, Any, ToolResponse]]]:
"""List all tool functions provided to agent
diff --git a/tests/plan_test.py b/tests/plan_test.py
index 7b6225923..8994d8ca6 100644
--- a/tests/plan_test.py
+++ b/tests/plan_test.py
@@ -117,7 +117,7 @@ class PlanTest(IsolatedAsyncioTestCase):
plan_notebook = PlanNotebook()
self.assertListEqual(
- [_.__name__ for _ in await plan_notebook.list_tools()],
+ [_.__name__ for _ in plan_notebook.list_tools()],
[
"view_subtasks",
"update_subtask_state",