Skip to content

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

Fix some typos in the tutorial (#804)

qbc45f56b03a180
diff --git a/docs/tutorial/en/src/task_model.py b/docs/tutorial/en/src/task_model.py
index 4218032c7..3fffb2227 100644
--- a/docs/tutorial/en/src/task_model.py
+++ b/docs/tutorial/en/src/task_model.py
@@ -56,6 +56,18 @@ The supported model APIs and providers include:
.. note:: When using vLLM, you need to configure the appropriate tool calling parameters for different models during deployment, such as ``--enable-auto-tool-choice``, ``--tool-call-parser``, etc. For more details, refer to the `official vLLM documentation <https://docs.vllm.ai/en/latest/features/tool_calling.html>`_.
+.. note:: For OpenAI-compatible models (e.g. vLLM, Deepseek), developers can use the ``OpenAIChatModel`` class, and specify the API endpoint by the ``client_args`` parameter: ``client_args={"base_url": "http://your-api-endpoint"}``. For example:
+
+ .. code-block:: python
+
+ OpenAIChatModel(client_args={"base_url": "http://localhost:8000/v1"})
+
+.. note:: Model behavior parameters (such as temperature, maximum length, etc.) can be preset in the constructor function via the ``generate_kwargs`` parameter. For example:
+
+ .. code-block:: python
+
+ OpenAIChatModel(generate_kwargs={"temperature": 0.3, "max_tokens": 1000})
+
To provide unified model interfaces, the above model classes has the following common methods:
- The first three arguments of the ``__call__`` method are ``messages`` , ``tools`` and ``tool_choice``, representing the input messages, JSON schema of tool functions, and tool selection mode, respectively.
diff --git a/docs/tutorial/en/src/task_tool.py b/docs/tutorial/en/src/task_tool.py
index eebdf9ad0..927346f69 100644
--- a/docs/tutorial/en/src/task_tool.py
+++ b/docs/tutorial/en/src/task_tool.py
@@ -260,6 +260,7 @@ async def streaming_function() -> AsyncGenerator[ToolResponse, None]:
text="1234",
),
],
+ stream=True,
)
# Simulate interruption
diff --git a/docs/tutorial/zh_CN/src/task_model.py b/docs/tutorial/zh_CN/src/task_model.py
index 8eb74f035..800b5a9b1 100644
--- a/docs/tutorial/zh_CN/src/task_model.py
+++ b/docs/tutorial/zh_CN/src/task_model.py
@@ -54,7 +54,19 @@ AgentScope 目前支持的模型 API 和模型提供商包括:
- ✅
- ✅
-.. note:: 当使用 vLLM 时,您需要在部署时为不同模型配置相应的工具调用参数,例如 ``--enable-auto-tool-choice``、``--tool-call-parser`` 等参数。更多详情请参考 `vLLM 官方文档 <https://docs.vllm.ai/en/latest/features/tool_calling.html>`_。
+.. note:: 当使用 vLLM 时,需要在部署时为不同模型配置相应的工具调用参数,例如 ``--enable-auto-tool-choice``、``--tool-call-parser`` 等参数。更多详情请参考 `vLLM 官方文档 <https://docs.vllm.ai/en/latest/features/tool_calling.html>`_。
+
+.. note:: 兼容 OpenAI API 的模型(例如 vLLM 部署的模型),推荐使用 ``OpenAIChatModel``,并通过 ``client_args={"base_url": "http://your-api-endpoint"}`` 参数指定 API 端点。例如:
+
+ .. code-block:: python
+
+ OpenAIChatModel(client_args={"base_url": "http://localhost:8000/v1"})
+
+.. note:: 模型的行为参数(如温度、最大长度等)可以通过 ``generate_kwargs`` 参数在构造函数中提前设定。例如:
+
+ .. code-block:: python
+
+ OpenAIChatModel(generate_kwargs={"temperature": 0.3, "max_tokens": 1000})
为了提供统一的模型接口,上述所有类均被统一为:
diff --git a/docs/tutorial/zh_CN/src/task_prompt.py b/docs/tutorial/zh_CN/src/task_prompt.py
index 1e4196cef..17370834e 100644
--- a/docs/tutorial/zh_CN/src/task_prompt.py
+++ b/docs/tutorial/zh_CN/src/task_prompt.py
@@ -27,8 +27,8 @@ AgentScope 内置的格式化器如下所列
- 用户-助手场景
- 多智能体场景
* - OpenAI
- - ``OpenAIFormatter``
- - ``OpenAIFormatter``
+ - ``OpenAIChatFormatter``
+ - ``OpenAIMultiAgentFormatter``
* - Anthropic
- ``AnthropicChatFormatter``
- ``AnthropicMultiAgentFormatter``
diff --git a/docs/tutorial/zh_CN/src/task_tool.py b/docs/tutorial/zh_CN/src/task_tool.py
index d4e00ecb4..6e0fabfb9 100644
--- a/docs/tutorial/zh_CN/src/task_tool.py
+++ b/docs/tutorial/zh_CN/src/task_tool.py
@@ -264,6 +264,7 @@ async def streaming_function() -> AsyncGenerator[ToolResponse, None]:
text="1234",
),
],
+ stream=True,
)
# 模拟中断