Baseten · Schema
ChatCompletionMessage
A message in the conversation. Supports roles: `system`, `user`, `assistant`, and `tool`.
AIMLInferenceDeploymentMLOpsOpenAI CompatibleAnthropic CompatibleTruss
Properties
| Name | Type | Description |
|---|---|---|
| role | string | The role of the message author: `system` (instructions), `user` (input), `assistant` (model response), or `tool` (tool result). |
| content | object | The message content. Can be a string or an array of content parts (text, image, audio) for multimodal inputs. |
| name | string | An optional name for the participant. Useful for distinguishing between multiple users or assistants. |
| tool_calls | array | Tool calls generated by the model (for assistant messages). |
| tool_call_id | string | The ID of the tool call this message responds to (required for tool messages). |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/ChatCompletionMessage",
"title": "ChatCompletionMessage",
"type": "object",
"required": [
"role"
],
"description": "A message in the conversation. Supports roles: `system`, `user`, `assistant`, and `tool`.",
"properties": {
"role": {
"type": "string",
"enum": [
"system",
"user",
"assistant",
"tool"
],
"description": "The role of the message author: `system` (instructions), `user` (input), `assistant` (model response), or `tool` (tool result)."
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/ChatCompletionContentPartTextParam"
},
{
"$ref": "#/components/schemas/ChatCompletionContentPartImageParam"
},
{
"$ref": "#/components/schemas/ChatCompletionContentPartInputAudioParam"
}
]
}
}
],
"description": "The message content. Can be a string or an array of content parts (text, image, audio) for multimodal inputs."
},
"name": {
"type": "string",
"description": "An optional name for the participant. Useful for distinguishing between multiple users or assistants."
},
"tool_calls": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ChatCompletionMessageToolCallParam"
},
"description": "Tool calls generated by the model (for assistant messages)."
},
"tool_call_id": {
"type": "string",
"description": "The ID of the tool call this message responds to (required for tool messages)."
}
}
}