Skip to main content

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.

This endpoint requires LLM credentials. Because WebSocket cannot set HTTP headers, pass them as query params: ?llm_provider=...&llm_api_key=.... See BYOK.

Endpoint

wss://mcp.thetahealth.cn/ws/upload-health-report?token=<access_token>&llm_provider=dashscope&llm_api_key=<...>
Optional &connectionId=<...> for reconnection support.

Client → Server messages

// 1. Start
{ "type":"upload_start", "messageId":"<client-uuid>",
  "fileName":"report.pdf", "fileSize":1234567, "query":"Analyze my health report" }

// 2. Chunk (base64-encoded binary)
{ "type":"upload_chunk", "messageId":"...", "chunkIndex":0,
  "totalChunks":12, "data":"<base64>" }

// 3. End
{ "type":"upload_end", "messageId":"..." }

// Heartbeat
{ "type":"ping" }   // server responds with { "type":"pong", "timestamp":"..." }

// Query upload status
{ "type":"get_status", "messageId":"..." }

Server → Client messages

typeMeaning
upload_startedServer accepted upload_start
upload_progressPer-chunk progress
upload_completedCarries analysis (extracted indicators) + summary (NL summary)
analysis_progressParsing progress
analysis_completedParsing done
errorError
connection_statusConnect / disconnect notice
connection_timeoutIdle 5min (or 30min during active upload) closes the connection
After upload_completed the user’s health profile is updated asynchronously; subsequent /api/chat calls can pick up the new data via Agent tools.