Represents a message within a thread.

interface ThreadMessage {
    assistant_id: null | string;
    content: (MessageContentImageFile | MessageContentText)[];
    created_at: number;
    file_ids: string[];
    id: string;
    metadata: unknown;
    object: "thread.message";
    role: "assistant" | "user";
    run_id: null | string;
    thread_id: string;
}

Properties

assistant_id: null | string

If applicable, the ID of the assistant that authored this message.

The content of the message in array of text and/or images.

created_at: number

The Unix timestamp (in seconds) for when the message was created.

file_ids: string[]

A list of file 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.

id: string

The identifier, which can be referenced in API endpoints.

metadata: unknown

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 maxium of 512 characters long.

object: "thread.message"

The object type, which is always thread.message.

role: "assistant" | "user"

The entity that produced the message. One of user or assistant.

run_id: null | string

If applicable, the ID of the run associated with the authoring of this message.

thread_id: string

The thread ID that this message belongs to.

Generated using TypeDoc