Skip to content

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

[HOTFIX] Fix the typos in tutorial (#751)

qbcd690606959c8
diff --git a/docs/tutorial/zh_CN/src/task_long_term_memory.py b/docs/tutorial/zh_CN/src/task_long_term_memory.py
index 4c0653a4d..16fdf0726 100644
--- a/docs/tutorial/zh_CN/src/task_long_term_memory.py
+++ b/docs/tutorial/zh_CN/src/task_long_term_memory.py
@@ -78,7 +78,7 @@ asyncio.run(basic_usage())
# 与 ReAct 智能体集成
# ----------------------------------------
# AgentScope 中的 ``ReActAgent`` 在构造函数中包含 ``long_term_memory`` 和 ``long_term_memory_mode`` 两个参数,
-# 其中 ``long_term_memory`` 用于指定长期记忆实例,``long_term_memory_mode``的取值为 ``"agent_control"``, ``"static_control"`` 或 ``"both"``。
+# 其中 ``long_term_memory`` 用于指定长期记忆实例,``long_term_memory_mode`` 的取值为 ``"agent_control"``, ``"static_control"`` 或 ``"both"``。
#
# 当 ``long_term_memory_mode`` 设置为 ``"agent_control"`` 或 ``both`` 时,在 ``ReActAgent`` 的构造函数中将
# 注册两个工具函数:``record_to_memory`` 和 ``retrieve_from_memory``。
@@ -147,7 +147,7 @@ asyncio.run(retrieve_preferences())
# | ``retrieve``
# | ``record_to_memory``
# | ``retrieve_from_memory``
-# - - 如果想支持 “static_control” 模式,必须实现``record` 和 `retrieve` 方法。
+# - - 如果想支持 “static_control” 模式,必须实现 ``record`` 和 ``retrieve`` 方法。
# - 想要支持 “agent_control” 模式,必须实现 ``record_to_memory`` 和 ``retrieve_from_memory`` 方法。
# * - ``Mem0LongTermMemory``
# - \-
diff --git a/docs/tutorial/zh_CN/src/task_state.py b/docs/tutorial/zh_CN/src/task_state.py
index b55c2b9dc..0084eb97d 100644
--- a/docs/tutorial/zh_CN/src/task_state.py
+++ b/docs/tutorial/zh_CN/src/task_state.py
@@ -40,15 +40,15 @@ from agentscope.tool import Toolkit
# - 描述
# * - ``register_state``
# - | ``attr_name``,
-# | ``custom_to_json``(可选),
-# | ``custom_from_json``(可选)
+# | ``custom_to_json`` (可选),
+# | ``custom_from_json`` (可选)
# - 将属性注册为其状态,带有可选的序列化/反序列化函数。
# * - ``state_dict``
# -
# - 获取当前对象的状态字典
# * - ``load_state_dict``
# - | ``state_dict``,
-# | ``strict``(可选)
+# | ``strict`` (可选)
# - 将状态字典加载到当前对象
#
# 在 ``StateModule`` 的对象中,以下所有属性都将被视为其状态的一部分:
@@ -170,7 +170,7 @@ session = JSONSession(
async def example_session() -> None:
"""会话管理示例。"""
- # 可以保存多个状态,只需要输入的对象为 ``StateModule`` 的子类。
+ # 可以保存多个状态,只需要输入的对象为 `StateModule` 的子类。
await session.save_session_state(
agent=agent,
)
@@ -200,7 +200,7 @@ async def example_load_session() -> None:
# 从会话文件中加载状态
await session.load_session_state(
- # 这里使用的关键词参数必须与 ``save_session_state`` 中的参数一致
+ # 这里使用的关键词参数必须与 `save_session_state` 中的参数一致
agent=agent,
)
print("加载会话状态后智能体的状态:")
diff --git a/src/agentscope/tool/_toolkit.py b/src/agentscope/tool/_toolkit.py
index d6838f392..8fe721523 100644
--- a/src/agentscope/tool/_toolkit.py
+++ b/src/agentscope/tool/_toolkit.py
@@ -154,11 +154,11 @@ class Toolkit(StateModule):
if group_name in self.groups:
self.groups[group_name].active = active
- def remove_tool_groups(self, group_names: list[str]) -> None:
+ def remove_tool_groups(self, group_names: str | list[str]) -> None:
"""Remove tool functions from the toolkit by their group names.
Args:
- group_names (`str`):
+ group_names (`str | list[str]`):
The group names to be removed from the toolkit.
"""
if isinstance(group_names, str):