Skip to content

数据模型: Message

ToolCall

字段类型必选描述
idstring
typestring
functionobject
function.namestring
function.argumentsstring

数据模型示例

json
{
  "id": "string",
  "type": "function",
  "function": {
    "name": "string",
    "arguments": "string"
  }
}

MessageContent

字段类型必选描述
typestring
textstring
image_urlobject
image_url.urlstring图片 URL 或 base64
image_url.detailstring
input_audioobject
input_audio.datastringBase64 编码的音频数据
input_audio.formatstring
fileobject
file.filenamestring
file.file_datastring
file.file_idstring
video_urlobject
video_url.urlstring

数据模型示例

json
{
  "type": "string",
  "text": "string",
  "image_url": {
    "url": "string",
    "detail": "string"
  },
  "input_audio": {
    "data": "string",
    "format": "string"
  },
  "file": {
    "filename": "string",
    "file_data": "string",
    "file_id": "string"
  },
  "video_url": {
    "url": "string"
  }
}

Message

字段类型必选描述
rolestring消息角色
contentany消息内容
namestring发送者名称
tool_callsarray of any
tool_call_idstring工具调用 ID(用于 tool 角色消息)
reasoning_contentstring推理内容

数据模型示例

json
{
  "role": "string",
  "content": null,
  "name": "string",
  "tool_calls": [
    {
      "id": "string",
      "type": "function",
      "function": {
        "name": "string",
        "arguments": "string"
      }
    }
  ],
  "tool_call_id": "string",
  "reasoning_content": "string"
}

Released under the MIT License.