跳转到主要内容

端点

聊天(SSE 流式传输)

POST /api/v1/agent/chat
向 Apollo Brain 发送消息,并通过 Server-Sent Events (SSE) 接收流式响应。 请求体:
{
  "message": "What tasks are due this week?",
  "session_id": "optional-session-uuid",
  "context": {
    "current_page": "/tasks",
    "selected_project_id": "optional-project-uuid"
  }
}
SSE 事件:
事件说明
contentAI 响应中的文本令牌
tool_callAI 正在调用工具(包含工具名称和参数)
tool_result工具执行的结果
confirmation_requiredHITL — 写入操作需要审批
done流式传输完成
error发生错误

确认操作

POST /api/v1/agent/confirm
批准或拒绝 HITL 确认请求。 请求体:
{
  "session_id": "session-uuid",
  "confirmation_id": "confirmation-uuid",
  "approved": true
}

列出会话

GET /api/v1/agent/sessions
返回已验证用户的所有聊天会话。

生成标题

POST /api/v1/agent/generate-title
根据对话内容自动为聊天会话生成描述性标题。

记忆偏好

GET/POST /api/v1/agent/memory/preferences
读取或更新用户的 AI 记忆偏好(程序性记忆)。