ThreadHandler

interface ThreadHandler

Handler used to interact with a Thread objects.

Inheritors

Functions

Link copied to clipboard
open fun create(): Thread

Creates a new empty thread.

abstract fun create(request: CreateThreadRequest): Thread

Creates a new thread with the given options.

Link copied to clipboard
Link copied to clipboard

Deletes the given thread from the OpenAI API.

Deletes the thread with the given id from the OpenAI API.

Link copied to clipboard
@Contract(pure = true)
open fun messages(thread: Thread): MessageHandler

Returns a handler for interacting with the messages in the given thread.

@Contract(pure = true)
abstract fun messages(threadId: String): MessageHandler

Returns a handler for interacting with the messages in the thread with the given id.

Link copied to clipboard
open fun modify(thread: Thread, request: ModifyThreadRequest): Thread

Modifies the given thread to have the given updated values.

abstract fun modify(id: String, request: ModifyThreadRequest): Thread

Modifies the thread with the given id to have the given updated values.

Link copied to clipboard
Link copied to clipboard
@Contract(pure = true)
open fun retrieve(thread: Thread): Thread

Retrieves the updated thread object from the given thread.

@Contract(pure = true)
abstract fun retrieve(id: String): Thread

Retrieves the thread with the given id.

Link copied to clipboard
@Contract(pure = true)
open fun runs(thread: Thread): RunHandler

Returns a handler for interacting with the runs in the given thread.

@Contract(pure = true)
abstract fun runs(threadId: String): RunHandler

Returns a handler for interacting with the runs in the thread with the given id.