Skip to content

訊息 ​

彙總聊天、工具呼叫和用量統計中常見物件。

訊息物件 ​

欄位類型說明
rolestring訊息角色
contentstring/array文字或多模態內容
namestring可選名稱
tool_callsarrayassistant 發起的工具呼叫
tool_call_idstringtool 訊息關聯的呼叫 ID

內容片段 ​

類型說明
text文字輸入
image_url圖片 URL 或 base64 圖片
input_audio音訊輸入,包含 data 和 format
file檔案輸入,取決於模型和頻道

多模態範例 ​

json
{
  "role": "user",
  "content": [
    {"type": "text", "text": "描述这张图片"},
    {"type": "image_url", "image_url": {"url": "https://example.com/image.png"}}
  ]
}

圖片、音訊和檔案的欄位格式不是所有模型都支援。呼叫前請確認模型能力、檔案大小和上游頻道限制。