@@ -249,9 +249,16 @@ export namespace FilePathDeltaAnnotation {
249249export interface ImageFile {
250250 /**
251251 * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
252- * in the message content.
252+ * in the message content. Set `purpose="vision"` when uploading the File if you
253+ * need to later display the file content.
253254 */
254255 file_id : string ;
256+
257+ /**
258+ * Specifies the detail level of the image if specified by the user. `low` uses
259+ * fewer tokens, you can opt in to high resolution using `high`.
260+ */
261+ detail ?: 'auto' | 'low' | 'high' ;
255262}
256263
257264/**
@@ -268,9 +275,16 @@ export interface ImageFileContentBlock {
268275}
269276
270277export interface ImageFileDelta {
278+ /**
279+ * Specifies the detail level of the image if specified by the user. `low` uses
280+ * fewer tokens, you can opt in to high resolution using `high`.
281+ */
282+ detail ?: 'auto' | 'low' | 'high' ;
283+
271284 /**
272285 * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
273- * in the message content.
286+ * in the message content. Set `purpose="vision"` when uploading the File if you
287+ * need to later display the file content.
274288 */
275289 file_id ?: string ;
276290}
@@ -293,6 +307,63 @@ export interface ImageFileDeltaBlock {
293307 image_file ?: ImageFileDelta ;
294308}
295309
310+ export interface ImageURL {
311+ /**
312+ * The external URL of the image, must be a supported image types: jpeg, jpg, png,
313+ * gif, webp.
314+ */
315+ url : string ;
316+
317+ /**
318+ * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in
319+ * to high resolution using `high`. Default value is `auto`
320+ */
321+ detail ?: 'auto' | 'low' | 'high' ;
322+ }
323+
324+ /**
325+ * References an image URL in the content of a message.
326+ */
327+ export interface ImageURLContentBlock {
328+ image_url : ImageURL ;
329+
330+ /**
331+ * The type of the content part.
332+ */
333+ type : 'image_url' ;
334+ }
335+
336+ export interface ImageURLDelta {
337+ /**
338+ * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in
339+ * to high resolution using `high`.
340+ */
341+ detail ?: 'auto' | 'low' | 'high' ;
342+
343+ /**
344+ * The URL of the image, must be a supported image types: jpeg, jpg, png, gif,
345+ * webp.
346+ */
347+ url ?: string ;
348+ }
349+
350+ /**
351+ * References an image URL in the content of a message.
352+ */
353+ export interface ImageURLDeltaBlock {
354+ /**
355+ * The index of the content part in the message.
356+ */
357+ index : number ;
358+
359+ /**
360+ * Always `image_url`.
361+ */
362+ type : 'image_url' ;
363+
364+ image_url ?: ImageURLDelta ;
365+ }
366+
296367/**
297368 * Represents a message within a
298369 * [thread](https://platform.openai.com/docs/api-reference/threads).
@@ -406,13 +477,19 @@ export namespace Message {
406477 * References an image [File](https://platform.openai.com/docs/api-reference/files)
407478 * in the content of a message.
408479 */
409- export type MessageContent = ImageFileContentBlock | TextContentBlock ;
480+ export type MessageContent = ImageFileContentBlock | ImageURLContentBlock | TextContentBlock ;
481+
482+ /**
483+ * References an image [File](https://platform.openai.com/docs/api-reference/files)
484+ * in the content of a message.
485+ */
486+ export type MessageContentDelta = ImageFileDeltaBlock | TextDeltaBlock | ImageURLDeltaBlock ;
410487
411488/**
412489 * References an image [File](https://platform.openai.com/docs/api-reference/files)
413490 * in the content of a message.
414491 */
415- export type MessageContentDelta = ImageFileDeltaBlock | TextDeltaBlock ;
492+ export type MessageContentPartParam = ImageFileContentBlock | ImageURLContentBlock | TextContentBlockParam ;
416493
417494export interface MessageDeleted {
418495 id : string ;
@@ -479,6 +556,21 @@ export interface TextContentBlock {
479556 type : 'text' ;
480557}
481558
559+ /**
560+ * The text content that is part of a message.
561+ */
562+ export interface TextContentBlockParam {
563+ /**
564+ * Text content to be sent to the model
565+ */
566+ text : string ;
567+
568+ /**
569+ * Always `text`.
570+ */
571+ type : 'text' ;
572+ }
573+
482574export interface TextDelta {
483575 annotations ?: Array < AnnotationDelta > ;
484576
@@ -507,9 +599,9 @@ export interface TextDeltaBlock {
507599
508600export interface MessageCreateParams {
509601 /**
510- * The content of the message.
602+ * The text contents of the message.
511603 */
512- content : string ;
604+ content : string | Array < MessageContentPartParam > ;
513605
514606 /**
515607 * The role of the entity that is creating the message. Allowed values include:
@@ -591,14 +683,20 @@ export namespace Messages {
591683 export import ImageFileContentBlock = MessagesAPI . ImageFileContentBlock ;
592684 export import ImageFileDelta = MessagesAPI . ImageFileDelta ;
593685 export import ImageFileDeltaBlock = MessagesAPI . ImageFileDeltaBlock ;
686+ export import ImageURL = MessagesAPI . ImageURL ;
687+ export import ImageURLContentBlock = MessagesAPI . ImageURLContentBlock ;
688+ export import ImageURLDelta = MessagesAPI . ImageURLDelta ;
689+ export import ImageURLDeltaBlock = MessagesAPI . ImageURLDeltaBlock ;
594690 export import Message = MessagesAPI . Message ;
595691 export import MessageContent = MessagesAPI . MessageContent ;
596692 export import MessageContentDelta = MessagesAPI . MessageContentDelta ;
693+ export import MessageContentPartParam = MessagesAPI . MessageContentPartParam ;
597694 export import MessageDeleted = MessagesAPI . MessageDeleted ;
598695 export import MessageDelta = MessagesAPI . MessageDelta ;
599696 export import MessageDeltaEvent = MessagesAPI . MessageDeltaEvent ;
600697 export import Text = MessagesAPI . Text ;
601698 export import TextContentBlock = MessagesAPI . TextContentBlock ;
699+ export import TextContentBlockParam = MessagesAPI . TextContentBlockParam ;
602700 export import TextDelta = MessagesAPI . TextDelta ;
603701 export import TextDeltaBlock = MessagesAPI . TextDeltaBlock ;
604702 export import MessagesPage = MessagesAPI . MessagesPage ;
0 commit comments