Add confirm-gated resume API with resumable flag, Phase 5 finalize fault and rolling-restart replay tests, Mermaid strict mode, request body limits, and optional Runner Bearer auth between app and pi-agent. Co-authored-by: Cursor <cursoragent@cursor.com>
88 lines
3.2 KiB
Bash
88 lines
3.2 KiB
Bash
# =============================================================================
|
|
# 商务对接智能体系统 (Chat-Agent-System) - 开发环境配置文件模板 (.env.example)
|
|
# =============================================================================
|
|
|
|
# --- 1. 运行环境与基础目录 ---
|
|
ENV=dev
|
|
DATA_DIR=./data/dev
|
|
APP_PUBLISH_HOST=127.0.0.1
|
|
HTTP_PORT=8080
|
|
|
|
# --- 2. 智能体后端调度配置 ---
|
|
# 可选值: pi-agent | cursor-cli | stub
|
|
AGENT_BACKEND=pi-agent
|
|
AGENT_TIMEOUT=30m
|
|
|
|
# --- 3. Cursor CLI / SDK 后端配置 ---
|
|
# Cursor API Key (格式通常为 crsr_...)
|
|
CURSOR_API_KEY=
|
|
# 模型选择 (auto, claude-3-7-sonnet, gpt-4o 等)
|
|
CURSOR_MODEL=auto
|
|
# Cursor 可执行程序路径
|
|
CURSOR_BIN=/usr/local/bin/cursor
|
|
# Cursor Node 桥接脚本路径
|
|
CURSOR_BRIDGE_BIN=tools/cursor-bridge/index.mjs
|
|
|
|
# --- 4. Pi-Agent 容器与模型参数配置 (MiniMax-M3) ---
|
|
# 1) ENDPOINT URL (MiniMax API 地址)
|
|
MINIMAX_ENDPOINT_URL=https://api.minimaxi.com/v1
|
|
# 2) API TOKEN (用户自行设定,必填)
|
|
MINIMAX_API_KEY=
|
|
# 3) MODEL ID (模型名称)
|
|
MINIMAX_MODEL_ID=MiniMax-M3
|
|
# 4) API 协议类型 (openai-compatible 兼容协议)
|
|
MINIMAX_API_TYPE=openai-compatible
|
|
|
|
# --- 5. 网络搜索工具配置 (Tavily Search API Key 池) ---
|
|
# 支持单 Key 或多 Key 池 (逗号/分号/换行分隔,例如: tvly-xxx1,tvly-xxx2,tvly-xxx3)
|
|
# 当遇到 429 配额耗尽或 401/403 异常时,容器内的 Tavily 工具会自动轮询切换下一个 Key
|
|
TAVILY_API_KEYS=
|
|
|
|
# --- 6. Pi-Agent 容器服务端口与远程调用 (可选) ---
|
|
PI_AGENT_RUNNER_PORT=18865
|
|
# 若希望 Go 程序通过 HTTP 直连 pi-agent 容器,解除下方注释;若留空则走本机本地 pi CLI
|
|
# PI_AGENT_RUNNER_URL=http://127.0.0.1:18865
|
|
# Runner 服务间认证(生产必填;app 与 pi-agent 容器需相同值)
|
|
# RUNNER_AUTH_TOKEN=change-me-in-production
|
|
|
|
# --- 7. 本机 Pi CLI 本地回退配置 (当不使用容器时) ---
|
|
PI_AGENT_BIN=/opt/homebrew/bin/pi
|
|
PI_AGENT_BRIDGE_BIN=tools/pi-bridge/index.mjs
|
|
PI_AGENT_PROVIDER=minimax
|
|
PI_AGENT_MODEL=MiniMax-M3
|
|
|
|
# --- 8. 法规知识库配置 (复用已有 agent-regkb Docker 容器) ---
|
|
KB_DB_HOST=127.0.0.1
|
|
KB_DB_PORT=55432
|
|
KB_DB_USER=regkb
|
|
KB_DB_PASSWORD=shared_kb_secret_pass
|
|
KB_DB_NAME=regulations
|
|
|
|
# 向量检索 Embedding 配置 (复用原系统配置,用于合规检索条目召回)
|
|
EMBEDDING_ENDPOINT_URL=https://www.dmxapi.cn/v1/embeddings
|
|
EMBEDDING_PROVIDER=openai_compatible
|
|
EMBEDDING_MODEL=bge-m3
|
|
EMBEDDING_API_KEY=
|
|
|
|
# 重排 Reranker 配置
|
|
RERANKER_ENDPOINT_URL=https://www.dmxapi.cn/v1/rerank
|
|
RERANKER_PROVIDER=openai_compatible
|
|
RERANKER_MODEL=bge-reranker-v2-m3-free
|
|
RERANKER_API_KEY=
|
|
|
|
# --- 9. 系统管理员与认证准入配置 ---
|
|
# 超级管理员凭据 (系统启动时自动初始化为 role-admin)
|
|
ADMIN_USERNAME=admin
|
|
ADMIN_PASSWORD=admin-secret-password-123
|
|
|
|
# 全局准入策略 (是否开放自主注册与注册是否必须审批)
|
|
AUTH_REGISTRATION_ENABLED=true
|
|
AUTH_REQUIRE_APPROVAL=false
|
|
|
|
# CORS 允许来源(逗号分隔);main 环境必须显式配置,禁止 *
|
|
# dev/test 未配置时使用 localhost 默认值
|
|
# CORS_ALLOWED_ORIGINS=http://localhost:5173,http://127.0.0.1:8080
|
|
|
|
# 生产环境必须为 false;main 启动时若 true 将拒绝加载配置
|
|
# ALLOW_IN_MEMORY=false
|