Package-level declarations
Types
The OpenAI API returns a list of ChatChoice
. Each choice has a generated message (ChatChoice.message) and a finish reason (ChatChoice.finishReason). For most use cases, you only need the generated message.
The OpenAI API returns a list of ChatChoiceChunk. The "new content" is saved to the delta property. To access everything that is currently generated, use message.
ChatGPT's biggest innovation is its conversation memory. To remember the conversation, we need to map each message to who sent it. This data class wraps a message with the user who sent the message.
The ChatResponse
contains all the data returned by the OpenAI Chat API. For most use cases, ChatResponse.get (passing 0 to the index argument) is all you need.
The ChatResponseChunk contains all the data returned by the OpenAI Chat API. For most use cases, ChatResponseChunk.get (passing 0 to the index argument) is all you need.
Functions
Creates a ChatRequest using the ChatRequest.Builder using Kotlin DSL.
Adds a Tool.FunctionTool to the ChatRequest using Kotlin DSL.