Package-level declarations

Types

Link copied to clipboard
data class ChatMessageDelta(val role: ChatUser? = null, val content: String? = null, val toolCalls: List<ToolCallDelta>? = null)

Represents the "delta," or changes of a chat message. This is used by streams stream 1 token at a time.

Link copied to clipboard
data class CodeInterpreter(val input: String, val outputs: List<CodeInterpreter.Output>)

Represents the data for a Tool.Type.CODE_INTERPRETER tool call. This contains the code that was run by the code interpreter, and the outputs of the code interpreter.

Link copied to clipboard
data class CodeInterpreterToolCall(val id: String, val codeInterpreter: CodeInterpreter) : ToolCall

Represents a tool call by an com.cjcrafter.openai.assistants.Assistant to a code interpreter.

Link copied to clipboard
data class Function

Represents a function for use by ChatGPT in a chat completion. A function is just like an API endpoint. ChatGPT will call the endpoint with parameters, and expect you, the developer, to respond with information.

Link copied to clipboard
data class FunctionCall(var name: String, var arguments: String, var output: String? = null)

Represents a function call by either a chat completion, or an Assistant.

Link copied to clipboard
data class FunctionCallDelta(val name: String?, val arguments: String)

Represents the "delta," or changes of a function call. This is used by streams to stream 1 token at a time.

Link copied to clipboard

Represents the parameters of the function. You can think of this like a method signature, where each property is a parameter to a method.

Link copied to clipboard
data class FunctionProperty(var type: String, var description: String? = null, var enum: MutableList<String>? = null)

Represents 1 single parameter from a map of parameters for a function.

Link copied to clipboard
data class FunctionToolCall(val id: String, val function: FunctionCall) : ToolCall

Represents a tool call for Tool.Type.FUNCTION.

Link copied to clipboard
data class RetrievalToolCall(val id: String, val retrieval: Map<String, String>) : ToolCall

Represents a tool call for Tool.Type.RETRIEVAL.

Link copied to clipboard
sealed class Tool

Represents a tool that can be used by ChatGPT in a chat completion.

Link copied to clipboard
sealed class ToolCall

Wraps a tool call by ChatGPT. You should check the type of the tool call, and handle the request. For example, if the type is Tool.Type.FUNCTION, you should call the function and return the result.

Link copied to clipboard
data class ToolCallDelta(val index: Int, val id: String? = null, val type: Tool.Type? = null, val function: FunctionCallDelta? = null)

Represents the "delta," or changes of a tool call. This is used by streams to stream 1 token at a time.

Link copied to clipboard
sealed class ToolChoice

Sometimes, you may want chat to be forced to use a tool. Sometimes you may want to prevent chat from using a tool. This sealed class represents all options that can be used with the Chat endpoint.

Functions

Link copied to clipboard

Creates a FunctionTool using the FunctionTool.Builder using Kotlin DSL.