Messages
List messages
Create message
Modify message
Retrieve message
Delete message
ModelsExpand Collapse
type AnnotationUnion interface{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
type FileCitationAnnotation struct{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
FileCitation FileCitationAnnotationFileCitation
The ID of the specific File the citation is from.
The text in the message content that needs to be replaced.
Always file_citation.
type FilePathAnnotation struct{…}A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
FilePath FilePathAnnotationFilePath
The ID of the file that was generated.
The text in the message content that needs to be replaced.
Always file_path.
type AnnotationDeltaUnion interface{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
type FileCitationDeltaAnnotation struct{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
The index of the annotation in the text content part.
Always file_citation.
FileCitation FileCitationDeltaAnnotationFileCitationoptional
The ID of the specific File the citation is from.
The specific quote in the file.
The text in the message content that needs to be replaced.
type FilePathDeltaAnnotation struct{…}A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
The index of the annotation in the text content part.
Always file_path.
FilePath FilePathDeltaAnnotationFilePathoptional
The ID of the file that was generated.
The text in the message content that needs to be replaced.
type FileCitationAnnotation struct{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
FileCitation FileCitationAnnotationFileCitation
The ID of the specific File the citation is from.
The text in the message content that needs to be replaced.
Always file_citation.
type FileCitationDeltaAnnotation struct{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
The index of the annotation in the text content part.
Always file_citation.
FileCitation FileCitationDeltaAnnotationFileCitationoptional
The ID of the specific File the citation is from.
The specific quote in the file.
The text in the message content that needs to be replaced.
type FilePathAnnotation struct{…}A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
FilePath FilePathAnnotationFilePath
The ID of the file that was generated.
The text in the message content that needs to be replaced.
Always file_path.
type FilePathDeltaAnnotation struct{…}A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
The index of the annotation in the text content part.
Always file_path.
FilePath FilePathDeltaAnnotationFilePathoptional
The ID of the file that was generated.
The text in the message content that needs to be replaced.
type ImageFile struct{…}
The File ID of the image in the message content. Set purpose="vision" when uploading the File if you need to later display the file content.
Detail ImageFileDetailoptionalSpecifies the detail level of the image if specified by the user. low uses fewer tokens, you can opt in to high resolution using high.
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.
type ImageFileDelta struct{…}
Detail ImageFileDeltaDetailoptionalSpecifies the detail level of the image if specified by the user. low uses fewer tokens, you can opt in to high resolution using high.
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.
The File ID of the image in the message content. Set purpose="vision" when uploading the File if you need to later display the file content.
type ImageFileDeltaBlock struct{…}References an image File in the content of a message.
References an image File in the content of a message.
The index of the content part in the message.
Always image_file.
type ImageURL struct{…}
The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.
Detail ImageURLDetailoptionalSpecifies the detail level of the image. low uses fewer tokens, you can opt in to high resolution using high. Default value is auto
Specifies the detail level of the image. low uses fewer tokens, you can opt in to high resolution using high. Default value is auto
type ImageURLContentBlock struct{…}References an image URL in the content of a message.
References an image URL in the content of a message.
The type of the content part.
type ImageURLDelta struct{…}
Detail ImageURLDeltaDetailoptionalSpecifies the detail level of the image. low uses fewer tokens, you can opt in to high resolution using high.
Specifies the detail level of the image. low uses fewer tokens, you can opt in to high resolution using high.
The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.
type ImageURLDeltaBlock struct{…}References an image URL in the content of a message.
References an image URL in the content of a message.
The index of the content part in the message.
Always image_url.
type Message struct{…}Represents a message within a thread.
Represents a message within a thread.
The identifier, which can be referenced in API endpoints.
If applicable, the ID of the assistant that authored this message.
Attachments []MessageAttachmentA list of files attached to the message, and the tools they were added to.
A list of files attached to the message, and the tools they were added to.
The ID of the file to attach to the message.
Tools []MessageAttachmentToolUnionoptionalThe tools to add this file to.
The tools to add this file to.
type CodeInterpreterTool struct{…}
The type of tool being defined: code_interpreter
type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}
The type of tool being defined: file_search
The Unix timestamp (in seconds) for when the message was completed.
Content []MessageContentUnionThe content of the message in array of text and/or images.
The content of the message in array of text and/or images.
type ImageURLContentBlock struct{…}References an image URL in the content of a message.
References an image URL in the content of a message.
The type of the content part.
type TextContentBlock struct{…}The text content that is part of a message.
The text content that is part of a message.
Always text.
type RefusalContentBlock struct{…}The refusal content generated by the assistant.
The refusal content generated by the assistant.
Always refusal.
The Unix timestamp (in seconds) for when the message was created.
The Unix timestamp (in seconds) for when the message was marked as incomplete.
IncompleteDetails MessageIncompleteDetailsOn an incomplete message, details about why the message is incomplete.
On an incomplete message, details about why the message is incomplete.
Reason stringThe reason the message is incomplete.
The reason the message is incomplete.
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, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
The object type, which is always thread.message.
Role MessageRoleThe entity that produced the message. One of user or assistant.
The entity that produced the message. One of user or assistant.
The ID of the run associated with the creation of this message. Value is null when messages are created manually using the create message or create thread endpoints.
Status MessageStatusThe status of the message, which can be either in_progress, incomplete, or completed.
The status of the message, which can be either in_progress, incomplete, or completed.
The thread ID that this message belongs to.
type MessageContentUnion interface{…}References an image File in the content of a message.
References an image File in the content of a message.
type ImageURLContentBlock struct{…}References an image URL in the content of a message.
References an image URL in the content of a message.
The type of the content part.
type TextContentBlock struct{…}The text content that is part of a message.
The text content that is part of a message.
Always text.
type RefusalContentBlock struct{…}The refusal content generated by the assistant.
The refusal content generated by the assistant.
Always refusal.
type MessageContentDeltaUnion interface{…}References an image File in the content of a message.
References an image File in the content of a message.
type ImageFileDeltaBlock struct{…}References an image File in the content of a message.
References an image File in the content of a message.
The index of the content part in the message.
Always image_file.
type TextDeltaBlock struct{…}The text content that is part of a message.
The text content that is part of a message.
The index of the content part in the message.
Always text.
type RefusalDeltaBlock struct{…}The refusal content that is part of a message.
The refusal content that is part of a message.
The index of the refusal part in the message.
Always refusal.
type ImageURLDeltaBlock struct{…}References an image URL in the content of a message.
References an image URL in the content of a message.
The index of the content part in the message.
Always image_url.
type MessageContentPartParamUnionResp interface{…}References an image File in the content of a message.
References an image File in the content of a message.
type ImageURLContentBlock struct{…}References an image URL in the content of a message.
References an image URL in the content of a message.
The type of the content part.
type TextContentBlockParam struct{…}The text content that is part of a message.
The text content that is part of a message.
Text content to be sent to the model
Always text.
type MessageDeleted struct{…}
type MessageDelta struct{…}The delta containing the fields that have changed on the Message.
The delta containing the fields that have changed on the Message.
The content of the message in array of text and/or images.
The content of the message in array of text and/or images.
type ImageFileDeltaBlock struct{…}References an image File in the content of a message.
References an image File in the content of a message.
The index of the content part in the message.
Always image_file.
type TextDeltaBlock struct{…}The text content that is part of a message.
The text content that is part of a message.
The index of the content part in the message.
Always text.
type RefusalDeltaBlock struct{…}The refusal content that is part of a message.
The refusal content that is part of a message.
The index of the refusal part in the message.
Always refusal.
type ImageURLDeltaBlock struct{…}References an image URL in the content of a message.
References an image URL in the content of a message.
The index of the content part in the message.
Always image_url.
Role MessageDeltaRoleoptionalThe entity that produced the message. One of user or assistant.
The entity that produced the message. One of user or assistant.
type MessageDeltaEvent struct{…}Represents a message delta i.e. any changed fields on a message during streaming.
Represents a message delta i.e. any changed fields on a message during streaming.
The identifier of the message, which can be referenced in API endpoints.
The delta containing the fields that have changed on the Message.
The object type, which is always thread.message.delta.
type RefusalContentBlock struct{…}The refusal content generated by the assistant.
The refusal content generated by the assistant.
Always refusal.
type RefusalDeltaBlock struct{…}The refusal content that is part of a message.
The refusal content that is part of a message.
The index of the refusal part in the message.
Always refusal.
type Text struct{…}
Annotations []AnnotationUnion
type FileCitationAnnotation struct{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
FileCitation FileCitationAnnotationFileCitation
The ID of the specific File the citation is from.
The text in the message content that needs to be replaced.
Always file_citation.
type FilePathAnnotation struct{…}A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
FilePath FilePathAnnotationFilePath
The ID of the file that was generated.
The text in the message content that needs to be replaced.
Always file_path.
The data that makes up the text.
type TextContentBlock struct{…}The text content that is part of a message.
The text content that is part of a message.
Always text.
type TextContentBlockParam struct{…}The text content that is part of a message.
The text content that is part of a message.
Text content to be sent to the model
Always text.
type TextDelta struct{…}
type FileCitationDeltaAnnotation struct{…}A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
The index of the annotation in the text content part.
Always file_citation.
FileCitation FileCitationDeltaAnnotationFileCitationoptional
The ID of the specific File the citation is from.
The specific quote in the file.
The text in the message content that needs to be replaced.
type FilePathDeltaAnnotation struct{…}A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.
The index of the annotation in the text content part.
Always file_path.
FilePath FilePathDeltaAnnotationFilePathoptional
The ID of the file that was generated.
The text in the message content that needs to be replaced.
The data that makes up the text.
type TextDeltaBlock struct{…}The text content that is part of a message.
The text content that is part of a message.
The index of the content part in the message.
Always text.