AssistantHandlerImpl

class AssistantHandlerImpl(requestHelper: RequestHelper, endpoint: String) : AssistantHandler

Holds the default underlying implementation of the AssistantHandler interface.

Parameters

requestHelper

The request helper to use

endpoint

The assistants endpoint

Constructors

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

Functions

Link copied to clipboard
open override 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.

open override fun delete(id: String): AssistantDeletionStatus

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.

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

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

open override fun retrieve(id: String): Assistant

Retrieve the assistant with the given id.