Skip to content

Commit 72a1d94

Browse files
Merge pull request #254 from openai/erinkav/message-content
Add message content type
2 parents 94d6407 + 14138f3 commit 72a1d94

File tree

1 file changed

+104
-11
lines changed

1 file changed

+104
-11
lines changed

openapi.yaml

Lines changed: 104 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3887,7 +3887,7 @@ paths:
38873887
"thread_abc123",
38883888
"msg_abc123"
38893889
);
3890-
3890+
38913891
console.log(deletedMessage);
38923892
}
38933893
response: |
@@ -3896,7 +3896,7 @@ paths:
38963896
"object": "thread.message.deleted",
38973897
"deleted": true
38983898
}
3899-
3899+
39003900
39013901
/threads/runs:
39023902
post:
@@ -8592,7 +8592,7 @@ components:
85928592
description: |
85938593
The intended purpose of the uploaded file.
85948594
8595-
Use "assistants" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages), "batch" for [Batch API](/docs/guides/batch), and "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tuning).
8595+
Use "assistants" for [Assistants](/docs/api-reference/assistants) and [Message](/docs/api-reference/messages) files, "vision" for Assistants image file inputs, "batch" for [Batch API](/docs/guides/batch), and "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tuning).
85968596
type: string
85978597
enum: ["assistants", "batch", "fine-tune"]
85988598
required:
@@ -9225,7 +9225,7 @@ components:
92259225
enum: ["file"]
92269226
purpose:
92279227
type: string
9228-
description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, and `fine-tune-results`.
9228+
description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`.
92299229
enum:
92309230
[
92319231
"assistants",
@@ -9234,7 +9234,7 @@ components:
92349234
"batch_output",
92359235
"fine-tune",
92369236
"fine-tune-results",
9237-
9237+
"vision"
92389238
]
92399239
status:
92409240
type: string
@@ -10961,6 +10961,7 @@ components:
1096110961
items:
1096210962
oneOf:
1096310963
- $ref: "#/components/schemas/MessageContentImageFileObject"
10964+
- $ref: "#/components/schemas/MessageContentImageUrlObject"
1096410965
- $ref: "#/components/schemas/MessageContentTextObject"
1096510966
x-oaiExpandable: true
1096610967
assistant_id:
@@ -11062,6 +11063,7 @@ components:
1106211063
oneOf:
1106311064
- $ref: "#/components/schemas/MessageDeltaContentImageFileObject"
1106411065
- $ref: "#/components/schemas/MessageDeltaContentTextObject"
11066+
- $ref: "#/components/schemas/MessageDeltaContentImageUrlObject"
1106511067
x-oaiExpandable: true
1106611068
required:
1106711069
- id
@@ -11100,10 +11102,21 @@ components:
1110011102
- `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
1110111103
- `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
1110211104
content:
11103-
type: string
11104-
minLength: 1
11105-
maxLength: 256000
11106-
description: The content of the message.
11105+
oneOf:
11106+
- type: string
11107+
description: The text contents of the message.
11108+
title: Text content
11109+
- type: array
11110+
description: An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models/overview).
11111+
title: Array of content parts
11112+
items:
11113+
oneOf:
11114+
- $ref: "#/components/schemas/MessageContentImageFileObject"
11115+
- $ref: "#/components/schemas/MessageContentImageUrlObject"
11116+
- $ref: "#/components/schemas/MessageRequestContentTextObject"
11117+
x-oaiExpandable: true
11118+
minItems: 1
11119+
x-oaiExpandable: true
1110711120
attachments:
1110811121
type: array
1110911122
items:
@@ -11194,8 +11207,13 @@ components:
1119411207
type: object
1119511208
properties:
1119611209
file_id:
11197-
description: The [File](/docs/api-reference/files) ID of the image in the message content.
11210+
description: The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content.
1119811211
type: string
11212+
detail:
11213+
type: string
11214+
description: Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.
11215+
enum: ["auto", "low", "high"]
11216+
default: "auto"
1119911217
required:
1120011218
- file_id
1120111219
required:
@@ -11218,8 +11236,67 @@ components:
1121811236
type: object
1121911237
properties:
1122011238
file_id:
11221-
description: The [File](/docs/api-reference/files) ID of the image in the message content.
11239+
description: The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content.
11240+
type: string
11241+
detail:
1122211242
type: string
11243+
description: Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.
11244+
enum: ["auto", "low", "high"]
11245+
default: "auto"
11246+
required:
11247+
- index
11248+
- type
11249+
11250+
MessageContentImageUrlObject:
11251+
title: Image URL
11252+
type: object
11253+
description: References an image URL in the content of a message.
11254+
properties:
11255+
type:
11256+
type: string
11257+
enum: ["image_url"]
11258+
description: The type of the content part.
11259+
image_url:
11260+
type: object
11261+
properties:
11262+
url:
11263+
type: string
11264+
description: "The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp."
11265+
format: uri
11266+
detail:
11267+
type: string
11268+
description: Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto`
11269+
enum: ["auto", "low", "high"]
11270+
default: "auto"
11271+
required:
11272+
- url
11273+
required:
11274+
- type
11275+
- image_url
11276+
11277+
MessageDeltaContentImageUrlObject:
11278+
title: Image URL
11279+
type: object
11280+
description: References an image URL in the content of a message.
11281+
properties:
11282+
index:
11283+
type: integer
11284+
description: The index of the content part in the message.
11285+
type:
11286+
description: Always `image_url`.
11287+
type: string
11288+
enum: ["image_url"]
11289+
image_url:
11290+
type: object
11291+
properties:
11292+
url:
11293+
description: "The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp."
11294+
type: string
11295+
detail:
11296+
type: string
11297+
description: Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`.
11298+
enum: ["auto", "low", "high"]
11299+
default: "auto"
1122311300
required:
1122411301
- index
1122511302
- type
@@ -11253,6 +11330,22 @@ components:
1125311330
- type
1125411331
- text
1125511332

11333+
MessageRequestContentTextObject:
11334+
title: Text
11335+
type: object
11336+
description: The text content that is part of a message.
11337+
properties:
11338+
type:
11339+
description: Always `text`.
11340+
type: string
11341+
enum: ["text"]
11342+
text:
11343+
type: string
11344+
description: Text content to be sent to the model
11345+
required:
11346+
- type
11347+
- text
11348+
1125611349
MessageContentTextAnnotationsFileCitationObject:
1125711350
title: File citation
1125811351
type: object

0 commit comments

Comments
 (0)