Skip to content

Commit 7d12bab

Browse files
committed
update docs and prompts
1 parent 9ae5ed8 commit 7d12bab

3 files changed

Lines changed: 51 additions & 31 deletions

File tree

docs/docs/deploy.md

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,39 @@
22

33
VeADK提供了一个云引擎,配合命令行脚手架,你可以方便地:
44

5-
- 将你的本地Agent项目上传到云端([火山引擎函数服务平台](https://www.volcengine.com/product/vefaas)
6-
- 启动一个新的样例模板项目进行开发
5+
- 快速开始:启动一个新的样例模板项目进行开发
6+
- 从已有项目:将你本地的 Agent 项目上传至[火山引擎函数服务平台](https://www.volcengine.com/product/vefaas)
77

8-
部署到云端时,你可以指定两种部署模式来对外提供服务:
8+
部署时,你可以指定两种部署模式来对外提供服务:
99

1010
- A2A与MCP Server(一体化启动)
1111
- A2A 提供标准的`message_send`等接口
1212
- MCP 提供`run_agent`工具方法
1313
- VeADK Web(兼容Google ADK Web)
14+
- 提供一个Web界面,方便你在浏览器中进行体验
1415

15-
VeADK Web 将会为你提供一个Web界面,方便你在浏览器中进行体验。
16-
17-
## 脚手架
16+
## 快速开始
1817

1918
### 初始化
2019

21-
你可以运行`init`命令来初始化一个新的Agent项目:
20+
你可以运行`veadk init`命令来初始化一个新的Agent项目:
2221

2322
```bash
2423
$ veadk init
25-
Directory name [veadk-cloud-proj]:
24+
Welcome use VeADK to create your project. We will generate a `weather-reporter` application for you.
25+
Local directory name [veadk-cloud-proj]:
2626
Volcengine FaaS application name [veadk-cloud-agent]:
27-
Volcengine gateway instance name []:
28-
Volcengine gateway service name []:
29-
Volcengine gateway upstream name []:
27+
Volcengine API Gateway instance name []:
28+
Volcengine API Gateway service name []:
29+
Volcengine API Gateway upstream name []:
3030
Choose a deploy mode:
3131
1. A2A/MCP Server
3232
2. VeADK Web / Google ADK Web
3333
Enter your choice (1, 2): 1
34-
Your project has beed created.
34+
Template project has been generated at .../veadk-cloud-proj
35+
Edit .../veadk-cloud-proj/src to define your agents
36+
Edit .../veadk-cloud-proj/deploy.py to define your deployment attributes
37+
Run python `deploy.py` for deployment on Volcengine FaaS platform.
3538
```
3639

3740
它会提示你输入如下几个参数:
@@ -49,17 +52,16 @@ Your project has beed created.
4952

5053
```bash
5154
└── veadk-cloud-proj
52-
├── config.yaml.example # 环境变量配置文件
55+
├── config.yaml.example # 定义环境变量
5356
├── deploy.py # 部署脚本
54-
├── README.md
5557
└── src
56-
├── agent.py # 定义 agent 导出
57-
├── app.py # 服务端启动脚本
58-
├── run.sh # 启动脚本
59-
── weather_agent # Agent 实现
60-
├── __init__.py
61-
├── agent.py # Agent 实例化
62-
└── requirements.txt # 依赖
58+
├── agent.py # agent 运行时数据导出
59+
├── app.py # Server 定义
60+
├── requirements.txt # 依赖
61+
── run.sh # 启动脚本
62+
└── weather_report # agent module
63+
├── __init__.py # 必须包含`from . import agent`
64+
└── agent.py # agent 定义
6365
```
6466

6567
你所创建的`config.yaml`不会被上传到云端,其中的属性值将会以环境变量的形式上传至VeFaaS平台。
@@ -92,6 +94,24 @@ Your project has beed created.
9294
| SHORT_TERM_MEMORY_BACKEND | 启动 ADK Web 时的短期记忆后端 | `local` \| `mysql` | 优先级低于在`agent.py`中定义的短期记忆 |
9395
| LONG_TERM_MEMORY_BACKEND | 启动 ADK Web 时的长期记忆后端 | `opensearch` \| `viking` | 优先级低于在`agent.py`中定义的长期记忆 |
9496

97+
## 从已有项目
98+
99+
如果你已经在本地有一个 agent 项目,你可以使用`veadk deploy`命令将你当前的项目上传至云端。
100+
101+
`veadk deploy`接收的参数如下:
102+
103+
| 名称 | 类型 | 释义 |
104+
| - | - | - |
105+
| `--access-key` | 字符串 | 火山引擎AK |
106+
| `--secret-key` | 字符串 | 火山引擎SK |
107+
| `--vefaas-app-name` | 字符串 | 火山引擎 VeFaaS 平台应用名称 |
108+
| `--veapig-instance-name` | 字符串 | 火山引擎 APIG 实例名称 |
109+
| `--veapig-service-name` | 字符串 | 火山引擎 APIG 服务名称 |
110+
| `--veapig-upstream-name` | 字符串 | 火山引擎 APIG Upstream 名称 |
111+
| `--short-term-memory-backend` | `local` \| `mysql` | 短期记忆后端 |
112+
| `--use-adk-web` | FLAG | 设置后将会在云端启动 web,否则为 A2A / MCP 模式 |
113+
| `--path` | 字符串 | 本地项目路径,默认为当前目录 |
114+
95115
## Cloud Agent Engine
96116

97117
如果你已经有一个较为成熟的Agent项目,你可以通过VeADK中提供的云引擎来部署你的项目。VeFaaS平台所需的部署文件我们将会为你自动生成到你的项目路径中。
@@ -116,11 +136,8 @@ cloud_app = engine.deploy(...)
116136
| gateway_name | str | 火山引擎网关实例名称 |
117137
| gateway_service_name | str | 火山引擎网关服务名称 |
118138
| gateway_upstream_name | str | 火山引擎网关Upstream名称 |
119-
| use_studio | bool | 是否在云端使用VeADK Studio |
120139
| use_adk_web | bool | 是否在云端使用VeADK Web / Google Web |
121140

122-
注意:`use_studio``use_adk_web`不可同时为`True`
123-
124141
## Cloud App
125142

126143
当你使用`CloudAgentEngine`部署完成后,将返回一个`CloudApp`实例,代表云应用,主要功能包括:

veadk/cli/cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
1516
import click
1617

1718
from veadk.cli.cli_deploy import deploy
1819
from veadk.cli.cli_init import init
1920
from veadk.cli.cli_prompt import prompt
2021
from veadk.cli.cli_web import web
21-
from veadk.utils.logger import get_logger
2222
from veadk.version import VERSION
2323

24-
logger = get_logger(__name__)
25-
2624

2725
@click.group()
2826
@click.version_option(

veadk/cli/cli_init.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import warnings
1516
from typing import Any
1617

1718
import click
1819

20+
warnings.filterwarnings(
21+
"ignore", category=UserWarning, module="pydantic._internal._fields"
22+
)
23+
1924

2025
def _render_prompts() -> dict[str, Any]:
2126
vefaas_application_name = click.prompt(
@@ -66,14 +71,14 @@ def init() -> None:
6671

6772
import veadk.integrations.ve_faas as vefaas
6873

69-
cwd = Path.cwd()
70-
local_dir_name = click.prompt("Local directory name", default="veadk-cloud-proj")
71-
target_dir_path = cwd / local_dir_name
72-
7374
click.echo(
7475
"Welcome use VeADK to create your project. We will generate a `weather-reporter` application for you."
7576
)
7677

78+
cwd = Path.cwd()
79+
local_dir_name = click.prompt("Local directory name", default="veadk-cloud-proj")
80+
target_dir_path = cwd / local_dir_name
81+
7782
if target_dir_path.exists():
7883
click.confirm(
7984
f"Directory '{target_dir_path}' already exists, do you want to overwrite it",

0 commit comments

Comments
 (0)