Chat

interface Chat

Given a chat conversation, the model will return a chat completion response.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun chatCompletion(request: ChatCompletionRequest, requestOptions: RequestOptions? = null): ChatCompletion

Creates a completion for the chat message.

Link copied to clipboard
open suspend fun chatCompletionMessages(id: String, after: String? = null, limit: Int? = null, order: SortOrder? = null, requestOptions: RequestOptions? = null): PaginatedList<ChatResultMessage>

List messages belonging to a stored completion.

Link copied to clipboard
abstract fun chatCompletions(request: ChatCompletionRequest, requestOptions: RequestOptions? = null): Flow<ChatCompletionChunk>

Stream variant of chatCompletion.

Link copied to clipboard
open suspend fun createChatCompletion(request: ChatCompletionRequest, options: ChatCompletionOptions, requestOptions: RequestOptions? = null): ChatCompletionResult

Create a completion using richer content and custom tool declarations.

Link copied to clipboard
open suspend fun deleteChatCompletion(id: String, requestOptions: RequestOptions? = null): Boolean

Delete a stored completion; returns false if it does not exist.

Link copied to clipboard
open suspend fun storedChatCompletion(id: String, requestOptions: RequestOptions? = null): ChatCompletionResult?

Retrieve a stored completion; returns null if it does not exist.

Link copied to clipboard
open suspend fun storedChatCompletions(query: ChatCompletionListQuery = ChatCompletionListQuery(), requestOptions: RequestOptions? = null): PaginatedList<ChatCompletionResult>

List stored completions with pagination and optional filters.

Link copied to clipboard
open fun streamChatCompletions(request: ChatCompletionRequest, options: ChatCompletionOptions, requestOptions: RequestOptions? = null): Flow<ChatCompletionResult>

Stream richer message and custom tool deltas.

Link copied to clipboard
open suspend fun updateChatCompletion(id: String, request: ChatCompletionUpdate, requestOptions: RequestOptions? = null): ChatCompletionResult

Update metadata on a stored completion.