ThreadHandlerImpl

class ThreadHandlerImpl(requestHelper: RequestHelper, endpoint: String) : ThreadHandler

Constructors

Link copied to clipboard
constructor(requestHelper: RequestHelper, endpoint: String)

Functions

Link copied to clipboard
open fun create(): Thread

Creates a new empty thread.

open override 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.

open override fun delete(id: String): ThreadDeletionStatus

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.

open override 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.

open override 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.

open override 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.

open override fun runs(threadId: String): RunHandler

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