跳转到主要内容
POST
/
api
/
agent
/
invoke
curl --request POST \
  --url https://zeus-api.agentspro.cn/api/agent/invoke \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "message": "帮我分析 sales.csv 的数据趋势",
    "llm_config": {
      "baseUrl": "https://api.openai.com/v1",
      "apiKey": "sk-...",
      "modelName": "gpt-4o",
      "temperature": 0.7
    },
    "session_id": "sess_456",
    "mode": "agent",
    "enable_sandbox": true,
    "knowledge_base_ids": ["kb_789"],
    "enable_memory": true,
    "tools": [
      {
        "type": "mcp",
        "name": "tavily",
        "base_url": "https://mcp.tavily.com/mcp",
        "api_key": "tvly-..."
      }
    ]
  }'
data: {"type": "message_chunk", "content": "我来帮你分析"}
data: {"type": "message_chunk", "content": " sales.csv 的数据趋势"}
data: {"type": "tool_call", "tool_name": "sandbox_exec", "tool_args": {...}}
data: {"type": "tool_result", "tool_name": "sandbox_exec", "result": "..."}
data: {"type": "message_chunk", "content": "根据分析结果..."}
data: {"type": "done", "session_id": "sess_456"}
Zeus 的核心入口。启动一次 Agent 对话,支持 MCP/OAuth 工具、知识库 RAG、记忆、沙盒代码执行、Skills、HITL 审批等完整能力。 返回 SSE 流式响应,消息格式参见 Streaming
Authorization
string
必填
Bearer JWT Token(user_id 从中自动提取,用于 Store 隔离)

核心参数

message
string
必填
用户消息内容
llm_config
object
必填
LLM 模型配置(来自前端 localStorage)
session_id
string
会话 ID,用于 Checkpointer 持久化。不传则自动生成
mode
string
默认值:"agent"
对话模式:
  • agent — 完整功能模式(默认)
  • ask — 只读问答模式,禁用写入工具
  • plan — 交互式规划模式

工具配置

tools
array
默认值:"[]"
统一的工具列表。每个工具通过 type 字段区分类型
enable_sandbox
boolean
默认值:"true"
是否启用沙盒代码执行工具(E2B)
是否启用 Web Search Tool(Tavily + DuckDuckGo)

RAG & Memory

knowledge_base_ids
array
默认值:"[]"
知识库 ID 列表。传入后自动注册 search_knowledge_base 工具
enable_memory
boolean
默认值:"false"
是否启用 Memory Tool(长期记忆读写)

Skills

skills
object
Skills 激活配置

上下文

chat_history
array
默认值:"[]"
历史对话消息列表 [{ role, content, timestamp? }]
resource_files
array
默认值:"[]"
资源文件列表 [{ name, content, type }](如 Markdown 提示词)
sandbox_files
array
默认值:"[]"
已上传到沙盒的文件 [{ name, path, type, size? }]
chat_attachments
array
默认值:"[]"
用户添加的聊天附件 [{ id, name, size, type, content }]

HITL 审批

tool_interrupt_config
object
工具中断配置(Human-in-the-Loop)
curl --request POST \
  --url https://zeus-api.agentspro.cn/api/agent/invoke \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "message": "帮我分析 sales.csv 的数据趋势",
    "llm_config": {
      "baseUrl": "https://api.openai.com/v1",
      "apiKey": "sk-...",
      "modelName": "gpt-4o",
      "temperature": 0.7
    },
    "session_id": "sess_456",
    "mode": "agent",
    "enable_sandbox": true,
    "knowledge_base_ids": ["kb_789"],
    "enable_memory": true,
    "tools": [
      {
        "type": "mcp",
        "name": "tavily",
        "base_url": "https://mcp.tavily.com/mcp",
        "api_key": "tvly-..."
      }
    ]
  }'
data: {"type": "message_chunk", "content": "我来帮你分析"}
data: {"type": "message_chunk", "content": " sales.csv 的数据趋势"}
data: {"type": "tool_call", "tool_name": "sandbox_exec", "tool_args": {...}}
data: {"type": "tool_result", "tool_name": "sandbox_exec", "result": "..."}
data: {"type": "message_chunk", "content": "根据分析结果..."}
data: {"type": "done", "session_id": "sess_456"}