AssistantHandler

Represents the handler for the assistants endpoint. This class holds all the actions that can be performed on an assistant.

Inheritors

Functions

Link copied to clipboard
abstract fun create(request: CreateAssistantRequest): Assistant

Creates a new assistant with the given properties. This method will return the data associated with the assistant.

Link copied to clipboard

Attempts to delete the given assistant. To confirm deletion, you should check AssistantDeletionStatus.deleted.

Attempts to delete the assistant with the given id. To confirm deletion, you should check AssistantDeletionStatus.deleted.

Link copied to clipboard
@Contract(pure = true)
open fun list(): ListAssistantResponse

Lists the 20 most recent assistants.

@Contract(pure = true)
abstract fun list(request: ListAssistantRequest?): ListAssistantResponse

Lists assistants with the given query parameters.

Link copied to clipboard
open fun modify(assistant: Assistant, request: ModifyAssistantRequest): Assistant

Shorthand to modify the given assistant. Note that this method will return a new instance of the assistant, and will not modify the given instance.

abstract fun modify(id: String, request: ModifyAssistantRequest): Assistant

Modifies the given assistant. For any nonnull fields in the given request, the corresponding field in the assistant will be overwritten.

Link copied to clipboard
@Contract(pure = true)
open fun retrieve(assistant: Assistant): Assistant

Retrieves the assistant with the given id. This method will return a new instance of the assistant, and will not modify the given instance.

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

Retrieve the assistant with the given id.