mirror of
https://github.com/agentuniverse-ai/agentUniverse.git
synced 2026-02-09 01:59:19 +08:00
Merge pull request #436 from NLLFish/chore/issue-255-enhancement-for-documentation
chore: fix typos and broken Markdown links; and enhance translation readability
This commit is contained in:
@@ -92,8 +92,8 @@
|
||||
|
||||
**5. Best Practices**
|
||||
* 5.1 Operations and Deployment
|
||||
* 5.1.1 [Docker Containerization Solution](In-Depth_Guides/Tech_Capabilities/Deployment/Docker_Container_Deployment.md)
|
||||
* 5.1.2 [K8S Solution](In-Depth_Guides/Tech_Capabilities/Deployment/K8S_Deployment.md)
|
||||
* 5.1.1 [Docker Containerization Solution](In-Depth_Guides/Deployment/Docker_Container_Deployment.md)
|
||||
* 5.1.2 [K8S Solution](In-Depth_Guides/Deployment/K8S_Deployment.md)
|
||||
|
||||
**6. Use Cases**
|
||||
* 6.1 RAG-Type Agent Examples
|
||||
|
||||
@@ -88,7 +88,9 @@ tool = ['sample_standard_app.intelligence.agentic.tool']
|
||||
## Configure for use in an Agent
|
||||
You can set up any tool you have created in the tool of your agent according to the contents of [Agent Creation and Usage section](../Agent/Agent_Create_And_Use.md).
|
||||
|
||||
Refer to the example: `demo_rag_agent`, with the specific file path being `sample_standard_app/intelligence/agentic/agent/agent_instance/rag_agent_case/demo_rag_agent.yaml`.
|
||||
For examples of tool definitions, please refer to [python_runner](../../../../../../examples/sample_apps/toolkit_demo_app/intelligence/agentic/tool/python_runner.yaml)
|
||||
|
||||
For examples of tool calls, please refer to [demo_agent_with_basic_tool.yaml](../../../../../../examples/sample_apps/toolkit_demo_app/intelligence/agentic/agent/agent_instance/demo_agent_with_basic_tool.yaml)
|
||||
|
||||
## Using the Tool Manager
|
||||
You can obtain the instance of the tool with the corresponding name through the `.get_instance_obj(xx_tool_name)` method in the Tool manager, and call it using the `run` method.
|
||||
|
||||
@@ -30,11 +30,11 @@ metadata:
|
||||
class: 'GoogleSearchTool'
|
||||
```
|
||||
|
||||
上述是一个实际的Tool配置的样例。除了上述介绍的标准配置项。
|
||||
上述是一个实际的Tool配置的样例。
|
||||
|
||||
您可以在我们的样例工程中的`sample_standard_app.intelligence.agentic.tool`路径下更多的tool配置yaml样例。
|
||||
除了上述介绍的标准配置项,您还可以在我们的样例工程中的`sample_standard_app.intelligence.agentic.tool`路径下,找到更多Tool的yaml配置文件样例。
|
||||
|
||||
除此之外agentuniverse不限制用户对tool yaml配置内容进行扩展,您可以根据自己的要求创建任何自定义配置key,但请注意不要与上述默认的配置关键字重名。
|
||||
除此之外agentuniverse不限制用户对Tool的yaml配置内容进行扩展,您可以根据自己的要求创建任何自定义配置key,但请注意不要与上述默认的配置关键字重名。
|
||||
|
||||
## 创建Tool领域行为定义 - tool_xx.py
|
||||
|
||||
@@ -87,9 +87,9 @@ tool = ['sample_standard_app.intelligence.agentic.tool']
|
||||
## 在Agent中配置使用
|
||||
您可以根据[智能体创建与使用](../智能体/智能体创建与使用.md)中的内容在agent的action下的tool中设置您创建的任意工具。
|
||||
|
||||
工具定义示例可参考:[duckduckgo_search_mcp_tool](../../../../../../examples/sample_apps/toolkit_demo_app/intelligence/agentic/tool/python_runner.yaml)
|
||||
工具定义示例可参考:[python_runner](../../../../../../examples/sample_apps/toolkit_demo_app/intelligence/agentic/tool/python_runner.yaml)
|
||||
|
||||
工具调用可参考示例:[demo_react_agent_with_single_mcp_tool](../../../../../../examples/sample_apps/toolkit_demo_app/intelligence/agentic/agent/agent_instance/demo_react_agent_with_single_tool.yaml)
|
||||
工具调用可参考示例:[demo_agent_with_basic_tool.yaml](../../../../../../examples/sample_apps/toolkit_demo_app/intelligence/agentic/agent/agent_instance/demo_agent_with_basic_tool.yaml)
|
||||
|
||||
## 使用Tool管理器
|
||||
通过Tool管理器中的`.get_instance_obj(xx_tool_name)` 方法可以获取对应名称的Tool实例, 使用`run`方法进行调用。
|
||||
|
||||
@@ -124,7 +124,7 @@ agent执行前的输入处理节点, agent的输入可以是自然语言或者js
|
||||
|
||||
该部分拥有两个输入参数,如下:
|
||||
* `input_object`: 智能体输入原始数据
|
||||
* 可通过 `input_object.get_data('input_key')` 方法获取input_object中的对于数据。
|
||||
* 可通过 `input_object.get_data('input_key')` 方法获取input_object中的对应数据。
|
||||
|
||||
例如: 用户对智能体输入`question=xxx`, 我们可以通过`input_object.get_data('question')`获取用户当前的提问。
|
||||
|
||||
@@ -168,7 +168,7 @@ def execute(self, input_object: InputObject, agent_input: dict) -> dict:
|
||||
```
|
||||
|
||||
#### 获取智能体对象属性
|
||||
智能体对象通过`self.agent_model`可以智能体的属性,在智能体领域行为定义中您可以读取在智能体配置部分配置的所有属性。
|
||||
智能体对象通过`self.agent_model`可以访问智能体的属性,在智能体领域行为的定义中,您可以读取在智能体配置部分配置的所有属性。
|
||||
|
||||
一个具体的例子如下:
|
||||
```text
|
||||
@@ -266,6 +266,7 @@ instruction: |
|
||||
通过这个过程我们可以将每次的输入与记忆或背景知识及任何你关注的信息通过该方法带入agent与LLM的交互中。
|
||||
|
||||
**方法二: 在parse_input方法或execute方法中调整prompt**
|
||||
|
||||
通过agent的`parse_input`方法或`execute`方法我们可以对agent做数据或行为上的定制,同时结合`self.agent_model`中的get方法与智能体输入参数`input_object`,这意味着您可以通过这些定制方法将你的任意设置内容进行修改。
|
||||
|
||||
### 从已有的智能体对象创建
|
||||
@@ -325,7 +326,7 @@ metadata:
|
||||
您可以在本文的[了解更多已有的智能体](#了解更多已有的智能体)部分查询更多的agent元信息并了解他们的作用。
|
||||
|
||||
# 如何使用智能体
|
||||
在agentUniverse中所有agent实体都由全局agent管理器进行管理,在任何框架执行过程中如果您需要使用智能体可以通过agent管理器。同时通过框架的服务化能力,您可以将agent快速服务化并通过标准的http或rpc协议对其进行网络调用。
|
||||
在agentUniverse中所有agent实体都由全局agent管理器进行管理。在框架执行的任何过程中,如果您需要使用智能体,均可以通过agent管理器实现。同时通过框架的服务化能力,您可以将agent快速服务化并通过标准的http或rpc协议对其进行网络调用。
|
||||
|
||||
## 方案一: 使用agent管理器
|
||||
通过agent管理器中的`get_instance_obj('agent_name_xxx')` 方法可以获取对应名称的agent实例,同时通过agent自身的`run(input='xxx')`方法使用agent,下面的test类中的`test_demo_agent(self)`方法就是使用该方式对于agent进行了调试。
|
||||
|
||||
@@ -124,7 +124,7 @@ async def acall(self, *args: Any, **kwargs: Any) -> Union[LLMOutput, AsyncIterat
|
||||
```
|
||||
|
||||
#### as_langchain方法
|
||||
agentUniverse在底层使用了langchain的能力,agentUniverse兼容使用langchain的LLM的定义方式,若您的项目已使用过langchain,那么在本方法中只需要将Langchain框架BaseLanguageModel基础模型放入即可将agentUniverse与langchain融合使用。agentUniverse在可支持与Langchain、Semantic Kernel等任何类似的orchestration框架融合,当前我们聚焦在langchain上。
|
||||
agentUniverse在底层使用了langchain的能力,agentUniverse兼容使用langchain的LLM的定义方式,若您的项目已使用过langchain,那么在本方法中只需要将Langchain框架BaseLanguageModel基础模型放入,即可将agentUniverse与langchain融合使用。agentUniverse可支持与Langchain、Semantic Kernel等任何类似的orchestration框架融合,但目前我们重点关注langchain。
|
||||
|
||||
```python
|
||||
from langchain_core.language_models.base import BaseLanguageModel
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
* 2.2.1 [智能体(Agent)](In-Depth_Guides/原理介绍/智能体/智能体.md)
|
||||
* 2.2.1.1 [智能体创建与使用](In-Depth_Guides/原理介绍/智能体/智能体创建与使用.md)
|
||||
* 2.2.1.2 [智能体及相关领域对象](In-Depth_Guides/原理介绍/智能体/智能体及相关领域对象.md)
|
||||
* 2.2.2 [模型(LLM)](In-Depth_Guides/原理介绍/智能体/模型.md)
|
||||
* 2.2.2 [模型(LLM)](In-Depth_Guides/原理介绍/智能体/智能体.md)
|
||||
* 2.2.2.1 [模型定义与使用](In-Depth_Guides/原理介绍/模型/模型定义与使用.md)
|
||||
* 2.2.2.2 [模型及相关领域对象](In-Depth_Guides/原理介绍/模型/模型及相关领域对象.md)
|
||||
* 2.2.3 [工具(Tool)](In-Depth_Guides/原理介绍/工具/工具.md)
|
||||
@@ -100,8 +100,8 @@
|
||||
|
||||
**5.最佳实践**
|
||||
* 5.1 运维部署
|
||||
* 5.1.1 [Docker容器化方案](In-Depth_Guides/技术组件/部署运维/Docker容器化部署.md)
|
||||
* 5.1.2 [K8S部署方案](In-Depth_Guides/技术组件/部署运维/K8S部署.md)
|
||||
* 5.1.1 [Docker容器化方案](In-Depth_Guides/部署运维/Docker容器化部署.md)
|
||||
* 5.1.2 [K8S部署方案](In-Depth_Guides/部署运维/K8S部署.md)
|
||||
|
||||
**6.实践应用**
|
||||
* 6.1 RAG类Agent案例
|
||||
|
||||
Reference in New Issue
Block a user