Some checks failed
Pre-commit / run (ubuntu-latest) (push) Has been cancelled
Deploy Sphinx documentation to Pages / build_en (ubuntu-latest, 3.10) (push) Has been cancelled
Deploy Sphinx documentation to Pages / build_zh (ubuntu-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.12) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.12) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.12) (push) Has been cancelled
60 lines
1.6 KiB
Markdown
60 lines
1.6 KiB
Markdown
# Qingjian CS (AgentScope Official Multi-Agent)
|
||
|
||
按 AgentScope 官方范式实现:
|
||
- `ReActAgent`
|
||
- `Toolkit.register_tool_function(...)`
|
||
- `OpenAIChatFormatter`
|
||
- `InMemoryMemory`
|
||
- `structured_model` 输出
|
||
- `Orchestrator` 编排(Router + Specialists)
|
||
|
||
## 架构
|
||
|
||
- `app/agents.py`
|
||
- `RouterAgent`
|
||
- `PreSalesAgent`
|
||
- `QuoteAgent`
|
||
- `AfterSalesAgent`
|
||
- `RiskAgent`
|
||
- `app/orchestrator.py`
|
||
- 统一编排与状态合并
|
||
- `app/state_machine.py`
|
||
- 售后状态机 + 迁移规则
|
||
- `app/store.py`
|
||
- 会话/事件持久化(SQLite / MySQL)
|
||
- `app/client.py`
|
||
- 轻简API WebSocket 收发与调度
|
||
|
||
## 环境变量
|
||
|
||
- `QINGJIAN_WS_URI` 默认 `ws://127.0.0.1:9528`
|
||
- `OPENAI_API_KEY` 必填
|
||
- `OPENAI_BASE_URL` 默认 `https://ark.cn-beijing.volces.com/api/v3`
|
||
- `OPENAI_MODEL_NAME` 默认 `doubao-seed-2-0-pro-260215`
|
||
- `AUTO_QUOTE_WAIT_SECONDS` 默认 `18`
|
||
- `MESSAGE_DEBOUNCE_SECONDS` 默认 `6`
|
||
- `STORE_BACKEND` 默认 `sqlite`,可设 `mysql`
|
||
- `STORE_SQLITE_PATH` 可选
|
||
- `MYSQL_HOST/MYSQL_PORT/MYSQL_USER/MYSQL_PASSWORD/MYSQL_DATABASE`
|
||
|
||
## 启动(uv run)
|
||
|
||
当前环境建议使用(避免上层工程依赖干扰):
|
||
|
||
```powershell
|
||
uv run --with websockets --with pydantic --with openai --with pymysql python run.py
|
||
```
|
||
|
||
## Golden 回放
|
||
|
||
```powershell
|
||
uv run --with websockets --with pydantic --with openai --with pymysql python scripts/replay_golden.py --mode heuristic
|
||
```
|
||
|
||
- `heuristic`:无模型依赖,做规则/状态机回放。
|
||
- `full`:走完整多 Agent(需完整 AgentScope 运行依赖 + 有效模型 key)。
|
||
|
||
## 开发规则
|
||
|
||
每次开发前先阅读:[DEVELOPMENT_RULES.md](./DEVELOPMENT_RULES.md)
|