Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineUserConfig({

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

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

bundler: viteBundler(),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions docs/docs/veadk-studio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# VeADK Studio

VeADK Studio是我们提供的一站式Agent开发平台,提供本地Agent优化、观测等功能。

![VeADK Studio主页](/images/studio-index.png)

## 前置准备

你需要在你的Agent项目中准备一个`agent.py`文件,导出`agent`和`short_term_memory`两个全局变量:

```python
agent = ...

short_term_memory = ...
```

## 启动

在你准备好的Agent项目目录下执行以下命令:

```bash
veadk-studio
```

Studio将会自动加载你的`agent.py`文件,启动一个本地服务器。注意,服务地址与端口必须固定为`127.0.0.1:8000`。

访问`http://127.0.0.1:8000`即可打开Studio:

![VeADK Studio主页](/images/studio-index.png)

## 功能介绍

VeADK Studio的主页包括两个入口:

- **Local agent**:你的本地Agent项目
- **Remote agent**:连接一个已经部署到VeFaaS的Agent(即将上线)

点击Local agent后,即可体验本地优化观测等各项功能:

![VeADK Studio智能体页面](/images/studio-chat.png)

### 交互

Studio中采用流式(SSE通信)与你定义的Agent进行交互,期间会自动加载短期与长期记忆。

只要服务端保持连接,历史会话便不会消失。

### 工具调用

当发生工具调用时,可显示工具的状态和输入输出。

![VeADK Studio智能体页面](/images/studio-tool.png)

### Prompt优化

VeADK通过AgentPilot提供Prompt优化功能,你可以在Studio中对Prompt进行优化与替换。

![VeADK Studio智能体页面](/images/studio-refine-prompt.png)

### 调用追踪

本地可查看调用链与具体的事件信息、Tracing Span的属性信息等。

![VeADK Studio智能体页面](/images/studio-tracing.png)

### 效果评估

VeADK通过DeepEval提供效果评估功能,你可以在Studio中对Agent的效果进行评估(例如输入输出情况)。

![VeADK Studio智能体页面](/images/studio-evaluation.png)

在生成评估结果后,评估器输出的评估Reason可作为进一步Prompt优化的Feedback反馈:

![VeADK Studio智能体页面](/images/studio-eval-to-refine.png)

### 云端部署

该功能即将上线。
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "veadk-python"
version = "1.0.0"
version = "0.1.0"
description = "Volcengine agent development kit, integrations with Volcengine cloud services."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
28 changes: 26 additions & 2 deletions veadk/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
import os
import shutil
import sys
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path

import typer
import uvicorn

from veadk.cli.studio.fast_api import get_fast_api_app
from veadk.utils.logger import get_logger
from veadk.version import VERSION

Expand Down Expand Up @@ -153,9 +155,31 @@ def studio(
):
path = Path(path).resolve()

from veadk.cli.studio.fast_api import get_fast_api_app
agent_py_path = os.path.join(path, "agent.py")
if not os.path.exists(agent_py_path):
raise FileNotFoundError(f"agent.py not found in {path}")

app = get_fast_api_app(agents_dir=str(path))
spec = spec_from_file_location("agent", agent_py_path)
if spec is None:
raise ImportError(f"Could not load spec for agent from {agent_py_path}")

module = module_from_spec(spec)

try:
spec.loader.exec_module(module)
except Exception as e:
raise ImportError(f"Failed to execute agent.py: {e}")

agent = None
short_term_memory = None
try:
agent = module.agent
short_term_memory = module.short_term_memory
except AttributeError as e:
missing = str(e).split("'")[1] if "'" in str(e) else "unknown"
raise AttributeError(f"agent.py is missing required variable: {missing}")

app = get_fast_api_app(agent, short_term_memory)

uvicorn.run(
app,
Expand Down
247 changes: 0 additions & 247 deletions veadk/cli/studio/agent_processor.py

This file was deleted.

Loading