Thread

@Serializable
data class Thread(val id: ThreadId, val objectType: String? = null, val createdAt: Int, val toolResources: ToolResources? = null, val metadata: Map<String, String>)

Represents a thread that contains messages.

Constructors

Link copied to clipboard
constructor(id: ThreadId, objectType: String? = null, createdAt: Int, toolResources: ToolResources? = null, metadata: Map<String, String>)

Properties

Link copied to clipboard
@SerialName(value = "created_at")
val createdAt: Int

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

Link copied to clipboard
@SerialName(value = "id")
val id: ThreadId

The identifier of the thread, which can be referenced in API endpoints.

Link copied to clipboard
@SerialName(value = "metadata")
val metadata: Map<String, String>

A map representing a set of key-value pairs that can be attached to the thread. This can be useful for storing additional information about the thread in a structured format. Keys can be a maximum of 64 characters long, and values can be a maximum of 512 characters long.

Link copied to clipboard
@SerialName(value = "object")
val objectType: String? = null

The object type, which is always thread.

Link copied to clipboard
@SerialName(value = "tool_resources")
val toolResources: ToolResources? = null

A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.