Documentation Index
Fetch the complete documentation index at: https://docs.mirobody.ai/llms.txt
Use this file to discover all available pages before exploring further.
此接口需要 LLM 凭证。 WebSocket 无法设置 HTTP Header,统一通过 query 传:?llm_provider=...&llm_api_key=...。详见 BYOK 协议。
wss://mcp.thetahealth.cn/ws/upload-health-report?token=<access_token>&llm_provider=dashscope&llm_api_key=<...>
可选 &connectionId=<...> 支持断线重连。
客户端 → 服务端消息
// 1. 起步
{ "type":"upload_start", "messageId":"<client-uuid>",
"fileName":"report.pdf", "fileSize":1234567, "query":"分析我的体检报告" }
// 2. 分片(base64 编码)
{ "type":"upload_chunk", "messageId":"...", "chunkIndex":0,
"totalChunks":12, "data":"<base64>" }
// 3. 结束
{ "type":"upload_end", "messageId":"..." }
// 心跳
{ "type":"ping" } // 服务端回 { "type":"pong", "timestamp":"..." }
// 查询上传状态
{ "type":"get_status", "messageId":"..." }
服务端 → 客户端消息
type | 含义 |
|---|
upload_started | 服务端接收了 upload_start |
upload_progress | 分片上传进度 |
upload_completed | 携带 analysis(指标抽取结果)+ summary(自然语言摘要) |
analysis_progress | 解析进度 |
analysis_completed | 解析完成 |
error | 错误 |
connection_status | 连接/断连通知 |
connection_timeout | 空闲 5 分钟(active 时延长到 30 分钟)会关闭连接 |
upload_completed 后用户健康档案异步更新;下次 /api/chat 即可被 Agent 工具读到。