Ver código fonte

Merge branch 'main' of https://github.com/datawhalechina/hello-agents

jjyaoao 5 meses atrás
pai
commit
c860256ff4

+ 1 - 1
docs/chapter10/Chapter10-Agent-Communication-Protocols.md

@@ -1793,7 +1793,7 @@ for i in range(10):
         }
         }
     )
     )
 
 
-print(f"✅ Registered {len(discovery.list_services())} compute nodes")
+print(f"✅ Registered {len(discovery.list_all_services())} compute nodes")
 
 
 # 3. Create task scheduler Agent
 # 3. Create task scheduler Agent
 scheduler = SimpleAgent(
 scheduler = SimpleAgent(

+ 2 - 2
docs/chapter10/第十章 智能体通信协议.md

@@ -1020,7 +1020,7 @@ try:
 except Exception as e:
 except Exception as e:
     print(f"\n❌ 错误: {e}")
     print(f"\n❌ 错误: {e}")
     import traceback
     import traceback
-    traceback.print_exc(
+    traceback.print_exc()
 
 
 ```
 ```
 
 
@@ -1793,7 +1793,7 @@ for i in range(10):
         }
         }
     )
     )
 
 
-print(f"✅ 注册了 {len(discovery.list_services())} 个计算节点")
+print(f"✅ 注册了 {len(discovery.list_all_services())} 个计算节点")
 
 
 # 3. 创建任务调度Agent
 # 3. 创建任务调度Agent
 scheduler = SimpleAgent(
 scheduler = SimpleAgent(

+ 6 - 6
docs/chapter16/第十六章 毕业设计.md

@@ -258,27 +258,27 @@ README 是项目的门面,一个好的 README 应该包含以下内容:
 
 
 ### 安装依赖
 ### 安装依赖
 
 
-\`\`\`bash
+
 pip install -r requirements.txt
 pip install -r requirements.txt
-\`\`\`
+
 
 
 ### 配置API密钥
 ### 配置API密钥
 
 
-\`\`\`bash
+
 # 创建.env文件
 # 创建.env文件
 cp .env.example .env
 cp .env.example .env
 
 
 # 编辑.env文件,填入你的API密钥
 # 编辑.env文件,填入你的API密钥
-\`\`\`
+
 
 
 ### 运行项目
 ### 运行项目
 
 
-\`\`\`bash
+
 # 启动Jupyter Notebook
 # 启动Jupyter Notebook
 jupyter lab
 jupyter lab
 
 
 # 打开main.ipynb并运行
 # 打开main.ipynb并运行
-\`\`\`
+
 
 
 ## 📖 使用示例
 ## 📖 使用示例
 
 

+ 1 - 1
docs/chapter3/Chapter3-Fundamentals-of-Large-Language-Models.md

@@ -37,7 +37,7 @@ $$P(w_i∣w_{i−1})=\frac{Count(w_{i−1},w_i)}{Count(w_{i−1})}$$
 
 
 Here, the `Count()` function represents "counting":
 Here, the `Count()` function represents "counting":
 
 
-- $Count(w_i−1,w_i)$: represents the total number of times the word pair $(w_{i−1},w_i)$ appears consecutively in the corpus.
+- $Count(w_{i−1},w_i)$: represents the total number of times the word pair $(w_{i−1},w_i)$ appears consecutively in the corpus.
 - $Count(w_{i−1})$: represents the total number of times the single word $w_{i−1}$ appears in the corpus.
 - $Count(w_{i−1})$: represents the total number of times the single word $w_{i−1}$ appears in the corpus.
 
 
 The formula's meaning is: we use "the number of times word pair $Count(w_i−1,w_i)$ appears" divided by "the total number of times word $Count(w_{i−1})$ appears" as an approximate estimate of $P(w_i∣w_{i−1})$.
 The formula's meaning is: we use "the number of times word pair $Count(w_i−1,w_i)$ appears" divided by "the total number of times word $Count(w_{i−1})$ appears" as an approximate estimate of $P(w_i∣w_{i−1})$.

+ 1 - 1
docs/chapter3/第三章 大语言模型基础.md

@@ -37,7 +37,7 @@ $$P(w_i∣w_{i−1})=\frac{Count(w_{i−1},w_i)}{Count(w_{i−1})}$$
 
 
 这里的 `Count()` 函数就代表“计数”:
 这里的 `Count()` 函数就代表“计数”:
 
 
-- $Count(w_i−1,w_i)$:表示词对 $(w_{i−1},w_i)$ 在语料库中连续出现的总次数。
+- $Count(w_{i−1},w_i)$:表示词对 $(w_{i−1},w_i)$ 在语料库中连续出现的总次数。
 - $Count(w_{i−1})$:表示单个词 $w_{i−1}$ 在语料库中出现的总次数。
 - $Count(w_{i−1})$:表示单个词 $w_{i−1}$ 在语料库中出现的总次数。
 
 
 公式的含义就是:我们用“词对 $Count(w_i−1,w_i)$ 出现的次数”除以“词 $Count(w_{i−1})$ 出现的总次数”,来作为 $P(w_i∣w_{i−1})$ 的一个近似估计。
 公式的含义就是:我们用“词对 $Count(w_i−1,w_i)$ 出现的次数”除以“词 $Count(w_{i−1})$ 出现的总次数”,来作为 $P(w_i∣w_{i−1})$ 的一个近似估计。

+ 1 - 1
docs/chapter6/第六章 框架开发实践.md

@@ -418,7 +418,7 @@ model_client = OpenAIChatCompletionClient(
 
 
 <strong>多智能体协作层 (Multi-Agent Cooperation)</strong> 是 AgentScope 的核心创新所在。`MsgHub` 作为消息中心,负责智能体间的消息路由和状态管理;而 `Pipeline` 系统则提供了灵活的工作流编排能力,支持顺序、并发等多种执行模式。这种设计使得开发者可以轻松构建复杂的多智能体协作场景。
 <strong>多智能体协作层 (Multi-Agent Cooperation)</strong> 是 AgentScope 的核心创新所在。`MsgHub` 作为消息中心,负责智能体间的消息路由和状态管理;而 `Pipeline` 系统则提供了灵活的工作流编排能力,支持顺序、并发等多种执行模式。这种设计使得开发者可以轻松构建复杂的多智能体协作场景。
 
 
-最上层的<strong>开发与部署层 (Deployment & Devvelopment)</strong>则体现了 AgentScope 对工程化的重视。`AgentScope Runtime` 提供了生产级的运行时环境,而 `AgentScope Studio` 则为开发者提供了完整的可视化开发工具链。
+最上层的<strong>开发与部署层 (Deployment & Development)</strong>则体现了 AgentScope 对工程化的重视。`AgentScope Runtime` 提供了生产级的运行时环境,而 `AgentScope Studio` 则为开发者提供了完整的可视化开发工具链。
 
 
 (2)消息驱动
 (2)消息驱动
 
 

+ 1 - 1
docs/chapter7/第七章 构建你的Agent框架.md

@@ -1287,7 +1287,7 @@ _extract_message_content:从OpenAI的响应中提取文本
 _parse_function_call_arguments:解析模型返回的JSON字符串参数
 _parse_function_call_arguments:解析模型返回的JSON字符串参数
 _convert_parameter_types:转换参数类型
 _convert_parameter_types:转换参数类型
 
 
-这些功能可以使其具备原生的OpenAI Functioncall的能力,对比使用prompt约束的方式,具备更强的鲁棒性。
+这些功能可以使其具备原生的OpenAI Function Calling的能力,对比使用prompt约束的方式,具备更强的鲁棒性。
 ```python
 ```python
 def _invoke_with_tools(self, messages: list[dict[str, Any]], tools: list[dict[str, Any]], tool_choice: Union[str, dict], **kwargs):
 def _invoke_with_tools(self, messages: list[dict[str, Any]], tools: list[dict[str, Any]], tool_choice: Union[str, dict], **kwargs):
         """调用底层OpenAI客户端执行函数调用"""
         """调用底层OpenAI客户端执行函数调用"""