genworker 默认暴露一组面向本地 Agent Runtime 的 HTTP 接口,核心能力集中在:
默认服务地址:
http://127.0.0.1:8000
POST /api/v1/chat/stream
Content-Type: application/json
用途:
典型请求体:
{
"message": "你好,帮我总结今天的任务重点",
"thread_id": "chat-001",
"tenant_id": "demo",
"worker_id": "analyst-01"
}
POST /api/v1/worker/task/stream
Content-Type: application/json
用途:
典型请求体:
{
"task": "检查我的收件箱并整理待办",
"tenant_id": "demo",
"worker_id": "analyst-01"
}
GET /health
用途:
GET /readiness
用途:
/health 更接近真实运行态GET /api/v1/debug/runtime
用途:
如果你启用了以下任一配置,API 将进入鉴权模式:
API_BEARER_TOKENAPI_KEY示例:
curl -s http://127.0.0.1:8000/api/v1/debug/runtime \
-H "Authorization: Bearer your-token"
/api/v1/chat/stream 与 /api/v1/worker/task/stream 默认是流式接口。
调用方需要注意:
curl -s http://127.0.0.1:8000/health
curl -s http://127.0.0.1:8000/readiness
curl -s http://127.0.0.1:8000/api/v1/debug/runtime
/health 正常但 /readiness 失败说明进程已启动,但默认运行链路尚未准备完成。优先检查:
优先检查代理层是否启用了响应缓冲。对于 Nginx,这通常意味着需要关闭 proxy_buffering。