多轮 ReAct Agent · 联网搜索 · 网页精读 · LLM 合成
所有接口基于 http://localhost:8800,支持 CORS 跨域访问。
健康检查,返回服务状态和配置信息。
curl http://localhost:8800/api/health
同步深度研究 — 提交问题,等待完整结果返回。
curl -X POST http://localhost:8800/api/research \
-H "Content-Type: application/json" \
-d '{"question":"2024年诺贝尔物理学奖得主是谁?"}'
返回 JSON:{"question","answer","success","turns","tokens_used","time_seconds"}
流式研究 — SSE (Server-Sent Events) 实时推送搜索进度。
// JavaScript SSE
const response = await fetch('/api/research/stream', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({question: "你的问题"})
});
const reader = response.body.getReader();
// ... read stream
import requests
resp = requests.post(
"http://localhost:8800/api/research",
json={"question": "量子计算的最新进展"}
)
result = resp.json()
print(result["answer"])
fetch("http://localhost:8800/api/research", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ question: "OpenAI latest news" })
}).then(r => r.json()).then(console.log)