Microsoft Azure · Schema
The message object
Represents a message within a [thread](/docs/api-reference/threads).
API ManagementCloudCloud ComputingEnterpriseInfrastructure as a ServicePlatform as a ServiceT1
Properties
| Name | Type | Description |
|---|---|---|
| id | string | The identifier, which can be referenced in API endpoints. |
| object | string | The object type, which is always `thread.message`. |
| created_at | integer | The Unix timestamp (in seconds) for when the message was created. |
| thread_id | string | The [thread](/docs/api-reference/threads) ID that this message belongs to. |
| role | string | The entity that produced the message. One of `user` or `assistant`. |
| content | array | The content of the message in array of text and/or images. |
| assistant_id | string | If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. |
| run_id | string | If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message. |
| file_ids | array | A list of [file](/docs/api-reference/files) IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a me |
| metadata | object | Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/messageObject",
"title": "The message object",
"type": "object",
"description": "Represents a message within a [thread](/docs/api-reference/threads).",
"properties": {
"id": {
"description": "The identifier, which can be referenced in API endpoints.",
"type": "string"
},
"object": {
"description": "The object type, which is always `thread.message`.",
"type": "string",
"enum": [
"thread.message"
],
"x-ms-enum": {
"name": "MessageObjectType",
"modelAsString": true,
"values": [
{
"value": "thread.message",
"description": "The message object type which is `thread.message`"
}
]
}
},
"created_at": {
"description": "The Unix timestamp (in seconds) for when the message was created.",
"type": "integer"
},
"thread_id": {
"description": "The [thread](/docs/api-reference/threads) ID that this message belongs to.",
"type": "string"
},
"role": {
"description": "The entity that produced the message. One of `user` or `assistant`.",
"type": "string",
"enum": [
"user",
"assistant"
],
"x-ms-enum": {
"name": "MessageObjectRole",
"modelAsString": true,
"values": [
{
"value": "user",
"description": "Message object role as `user`"
},
{
"value": "assistant",
"description": "Message object role as `assistant`"
}
]
}
},
"content": {
"description": "The content of the message in array of text and/or images.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/messageContentImageFileObject"
},
{
"$ref": "#/components/schemas/messageContentTextObject"
}
]
}
},
"assistant_id": {
"description": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.",
"type": "string",
"nullable": true
},
"run_id": {
"description": "If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message.",
"type": "string",
"nullable": true
},
"file_ids": {
"description": "A list of [file](/docs/api-reference/files) IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message.",
"default": [],
"maxItems": 10,
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.\n",
"type": "object",
"nullable": true
}
},
"required": [
"id",
"object",
"created_at",
"thread_id",
"role",
"content",
"assistant_id",
"run_id",
"file_ids",
"metadata"
]
}