Skip to content

Commit f962f17

Browse files
committed
fix(docs): deal conflicts
2 parents 97d4d0c + 490b22d commit f962f17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1597
-829
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ipython_config.py
9898
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
9999
# This is especially recommended for binary packages to ensure reproducibility, and is more
100100
# commonly ignored for libraries.
101-
#uv.lock
101+
uv.lock
102102

103103
# poetry
104104
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,18 @@ uv pip install -e .
3939

4040
## Configuration
4141

42-
We recommand you to create a `config.yaml` file in the root directory of your own project, `VeADK` is able to read it automatically.
42+
We recommand you to create a `config.yaml` file in the root directory of your own project, `VeADK` is able to read it automatically. For running a minimal agent, you just need to set the following configs in your `config.yaml` file:
43+
44+
```yaml
45+
model:
46+
agent:
47+
provider: openai
48+
name: doubao-seed-1-6-250615
49+
api_base: https://ark.cn-beijing.volces.com/api/v3/
50+
api_key: # <-- set your Volcengine ARK api key here
51+
```
4352
44-
You can refer to the [example config file](config.yaml.example) for more details.
53+
You can refer to the [config instructions](https://volcengine.github.io/veadk-python/installation.html#%E9%85%8D%E7%BD%AE) for more details.
4554
4655
## Have a try
4756
@@ -61,8 +70,8 @@ print(res)
6170

6271
VeADK provides several useful command line tools for faster deployment and optimization, such as:
6372

64-
- `veadk deploy`: deploy your project to Volcengine VeFaaS platform (you can use `veadk init` to init a demo project first)
65-
- `veadk prompt`: otpimize the system prompt of your agent by PromptPilot
73+
- `veadk deploy`: deploy your project to [Volcengine VeFaaS platform](https://www.volcengine.com/product/vefaas) (you can use `veadk init` to init a demo project first)
74+
- `veadk prompt`: otpimize the system prompt of your agent by [PromptPilot](https://promptpilot.volcengine.com)
6675

6776
## Contribution
6877

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ model:
22
# [required] for running agent
33
agent:
44
provider: openai
5-
name: doubao-1-5-pro-256k-250115
5+
name: doubao-seed-1-6-250615
66
api_base: https://ark.cn-beijing.volces.com/api/v3/
7-
api_key:
7+
api_key:
88
# [optional] for llm-as-a-judge a evaluation
99
judge:
10-
name: doubao-1-5-pro-256k-250115
10+
name: doubao-seed-1-6-250615
1111
api_base: https://ark.cn-beijing.volces.com/api/v3/
1212
api_key:
1313
# [optional] for knowledgebase
@@ -40,6 +40,8 @@ tool:
4040
las:
4141
url: #mcp sse url
4242
dataset_id: #dataset name
43+
mcp_router:
44+
url: #mcp sse/streamable-http url
4345

4446

4547
observability:

config.yaml.simple

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
model:
2+
agent:
3+
provider: openai
4+
name: doubao-seed-1-6-250615
5+
api_base: https://ark.cn-beijing.volces.com/api/v3/
6+
api_key:

docs/docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineUserConfig({
1313

1414
navbar: ['/', '/introduction'],
1515

16-
sidebar: ['introduction', 'installation', 'get-started', 'agent', 'memory', 'knowledgebase', 'tracing', 'evaluation', 'deploy', 'cli', 'veadk-studio']
16+
sidebar: ['introduction', 'installation', 'get-started', 'agent', 'memory', 'tool', 'knowledgebase', 'tracing', 'evaluation', 'deploy', 'cli', 'veadk-studio']
1717
}),
1818

1919
bundler: viteBundler(),
156 KB
Loading
302 KB
Loading
532 KB
Loading

docs/docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ actions:
1313

1414
features:
1515
- title: 更丰富的内置工具
16-
details: Builtin工具,例如侧重头条、抖音搜索的web_search等;MCP工具,例如飞书Lark、数据湖LAS、优解PromptPilot等
16+
details: Builtin工具,例如侧重头条、抖音搜索的WEB_SEARCH等;MCP工具,例如飞书Lark、数据湖LAS、优解PromptPilot等
1717
- title: 更灵活的功能扩展
1818
details: 提供Agent各类组件的基础实现,通过插件方式灵活扩展。
1919
- title: 更完备的观测和评估管理
2020
details: 运行时数据通过OpenTelemetry协议无缝衔接APMPlus、Cozeloop、TLS;运行时数据生成测试数据集文件,可直接在本地和Cozeloop中进行评估测试。
2121
- title: 更强大的知识和记忆管理
22-
details: 知识库支持火山引擎各类现有数据库,例如关系型数据库、键值数据库、VikingDB知识库记忆库等。
22+
details: 知识库支持火山引擎各类现有数据库,例如关系型数据库、缓存数据库、VikingDB知识库记忆库等。
2323
- title: 更科学的结果评测
2424
details: 提供不确定性Tools(例如搜索类)场景下的测评解决方案,弥补传统仅根据输入输出进行评测而导致评测结果不符合预期的问题。
2525
- title: 更友好的最佳实践

docs/docs/agent.md

Lines changed: 79 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,61 @@
11
# 智能体
22

3+
智能体 Agent 是一个具备完整功能的执行单元,依托内置的大模型推理能力,其不仅可以独立完成各类任务、与用户进行智能交互、调用外部工具资源,还能实现与其他 Agent 之间的协同配合。
4+
35
## 属性
46

5-
Agent中主要包括如下属性
7+
Agent 中主要包括如下属性
68

79
| 属性 | 类型 | 说明 |
810
| --- | --- | --- |
9-
| name | str | Agent的名称,即标识符 |
10-
| description | str | Agent的描述,后续会被构建为系统提示词的一部分;也被用来在A2A协议中进行Agent挑选 |
11-
| instruction | str | Agent中内置模型的系统提示词 |
12-
| tools | list | Function call中的工具列表,既可以是本地工具,也可以是MCP工具 |
13-
| sub_agents | list | 子Agent列表,用于多Agent之间交互 |
14-
| long_term_memory | Vector database | 长期记忆,后端通常为一个向量数据库(Vector database),能够检索 |
15-
| knowledgebase | Vector database | 知识库,后端通常为一个向量数据库(Vector database),能够检索 |
16-
| tracers | list | 追踪器列表,能够定义不同的追踪方式,并在Agent执行完毕后对整体Tracing信息保存至本地 |
11+
| name | str | Agent 的名称,即标识符 |
12+
| description | str | Agent 的描述,后续会被构建为系统提示词的一部分,也被用来在A2A协议中进行 Agent 挑选 |
13+
| instruction | str | Agent 中内置模型的系统提示词 |
14+
| model_name | str | Agent 中内置模型的名称,默认从环境变量中获取 |
15+
| model_provider | str | Agent 中内置模型的提供商,默认从环境变量中获取 |
16+
| model_api_base | str | Agent 中内置模型的 API Base,默认从环境变量中获取 |
17+
| model_api_key | str | Agent 中内置模型的 API Key,默认从环境变量中获取 |
18+
| tools | list | Function call 中的工具列表,既可以是本地工具,也可以是 MCP 工具 |
19+
| sub_agents | list | 子 Agent 列表,用于多 Agent 之间交互 |
20+
| knowledgebase | KnowledgeBase | 知识库,后端支持本地内存(local)和数据库(opensearch、viking、redis、mysql),通常设置为一个能够检索的向量数据库 |
21+
| long_term_memory | LongTermMemory | 长期记忆,后端支持本地内存(local)和数据库(opensearch、viking、redis、mysql),通常设置为一个能够检索的向量数据库 |
22+
| tracers | list | 追踪器列表,能够定义不同的追踪方式,并在 Agent 执行完毕后将整体 Tracing 信息保存至本地 |
23+
| serve_url | str | Agent 服务主机的 URL,将显示在 Agent Card 中 |
24+
25+
您可以在[火山引擎方舟平台](https://www.volcengine.com/product/ark)选择适合您的大模型。
26+
27+
## 运行
28+
29+
在生产环境中,我们推荐您使用 VeADK 的`Runner`执行器来进行多租户服务与 Agent 运行,在多租场景下,`Runner`通过三个属性来确定资源空间:
30+
31+
- `app_name`:应用名称
32+
- `user_id`:用户ID
33+
- `session_id`:某个用户某次会话的ID
34+
35+
```python
36+
from veadk import Agent, Runner
37+
from veadk.memory.short_term_memory import ShortTermMemory
38+
39+
# Define Runner config
40+
APP_NAME = "..."
41+
USER_ID = "..."
42+
SESSION_ID = "..."
43+
44+
agent = Agent()
45+
46+
runner = Runner(
47+
agent=agent,
48+
short_term_memory=ShortTermMemory(),
49+
app_name=APP_NAME,
50+
user_id=USER_ID
51+
)
52+
53+
response = await runner.run(messages="...", session_id=SESSION_ID)
54+
```
1755

18-
## A2A智能体
56+
## A2A 智能体
1957

20-
当你的智能体部署到云上后,可以在本地被初始化为一个Remote Agent,也就是能够通过A2A协议来访问的智能体,初始化方法如下:
58+
当智能体部署到云上后,可以在本地被初始化为一个 Remote Agent,也就是能够通过 A2A 协议来访问的智能体,初始化方法如下:
2159

2260
```python
2361
remote_agent = RemoteVeAgent(
@@ -29,33 +67,50 @@ short_term_memory = ShortTermMemory()
2967
runner = Runner(
3068
agent=remote_agent,
3169
short_term_memory=short_term_memory
32-
)
70+
)
3371

3472
res = await runner.run(
3573
messages="...",
3674
session_id="sample_session"
37-
)
75+
)
3876
```
3977

40-
## 运行
78+
## 多智能体
79+
80+
使用 VeADK 可以构建多 Agent 协作, 主 Agent 通过 `sub_agents` 机制协调多个子 Agent 完成复杂任务。以下代码示例分别定义了三个 Agent:
4181

42-
在生产环境中,我们推荐您使用`Runner`来进行多租户服务:
82+
- weather_reporter:负责获取指定城市的天气信息(调用了 `get_city_weather` 工具)。
83+
- suggester:根据天气情况给出穿衣建议。
84+
- planner_agent:作为“调度员”,先调用 `weather_reporter` 获取天气,再调用 `suggester` 获取建议,最后将结果整合返回给用户。
85+
86+
该多智能体协作能更好的满足用户的需求。
4387

4488
```python
4589
from veadk import Agent, Runner
4690
from veadk.memory.short_term_memory import ShortTermMemory
91+
from veadk.tools.demo_tools import get_city_weather
4792

48-
# Define runner config
49-
APP_NAME = ""
50-
USER_ID = ""
51-
SESSION_ID = ""
93+
session_id = "..."
94+
prompt = "..."
5295

53-
agent = Agent()
96+
# define three agents, one for planner, two for write poem and polish
97+
weather_reporter = Agent(
98+
name="weather_reporter",
99+
description="A weather reporter agent to report the weather.",
100+
tools=[get_city_weather],
101+
)
102+
suggester = Agent(
103+
name="suggester",
104+
description="A suggester agent that can give some clothing suggestions according to a city's weather.",
105+
)
54106

55-
runner = Runner(
56-
agent=agent,
57-
short_term_memory=ShortTermMemory()
58-
)
107+
planner_agent = Agent(
108+
name="planner",
109+
description="A planner that can generate a suggestion according to a city's weather.",
110+
instruction="Invoke weather reporter agent first to get the weather, then invoke suggester agent to get the suggestion. Return the final response to user.",
111+
sub_agents=[weather_reporter, suggester],
112+
)
59113

114+
runner = Runner(agent=planner_agent, short_term_memory=ShortTermMemory())
60115
response = await runner.run(messages=prompt, session_id=session_id)
61116
```

0 commit comments

Comments
 (0)