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
2.0 KiB
2.0 KiB
Qingjian CS (AgentScope Official Multi-Agent)
按 AgentScope 官方范式实现:
ReActAgentToolkit.register_tool_function(...)OpenAIChatFormatterInMemoryMemorystructured_model输出Orchestrator编排(单阶段直达 Specialists)
架构
app/agents.pyPreSalesAgentQuoteAgentAfterSalesAgentRiskAgent
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:9528OPENAI_API_KEY必填OPENAI_BASE_URL默认https://ark.cn-beijing.volces.com/api/v3OPENAI_MODEL_NAME默认doubao-seed-2-0-pro-260215AUTO_QUOTE_WAIT_SECONDS默认18MESSAGE_DEBOUNCE_SECONDS默认0.2IMAGE_MESSAGE_DEBOUNCE_SECONDS默认0.4AGENT_MAX_ITERS默认1DECISION_TIMEOUT_SECONDS默认8STORE_BACKEND默认sqlite,可设mysqlSTORE_SQLITE_PATH可选MYSQL_HOST/MYSQL_PORT/MYSQL_USER/MYSQL_PASSWORD/MYSQL_DATABASE
可直接复制模板:
copy .env.example .env
启动(uv run)
当前环境建议使用(避免上层工程依赖干扰):
uv run --with websockets --with pydantic --with openai --with pymysql python run.py
生产建议(天网)
- WebSocket:单实例(防重复回复)
- HTTP API:多 worker(提升并发)
uv run powershell -File .\scripts\start_tianwang_prod.ps1 -Host 127.0.0.1 -Port 6060 -ApiWorkers 2
Golden 回放
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