跳转到主要内容

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 工具读到。