Package-level declarations

Types

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

Represents a function that can be called by the AI model.

Link copied to clipboard
data class ChatCompletionRequest(val messages: List<Message>, val model: String, val store: Boolean = false, val reasoningEffort: String = "medium", val metadata: Metadata? = null, val maxCompletionTokens: Int? = null, val frequencyPenalty: Double? = 0.0, val responseFormat: ResponseFormat? = null, val temperature: Double = 1.0, val seed: Int? = null, val stream: Boolean = false, val streamOptions: ChatCompletionStreamOptions? = null, val tools: List<Tool>? = null)

Represents a request for generating a chat-based completions in an OpenAI-like environment.

Link copied to clipboard
data class ChatResponse(val id: String, val objectType: String = "chat.completions", val created: Long, val model: String, val serviceTier: String? = null, val systemFingerprint: String? = null, val usage: Usage, val choices: List<Choice>)

Represents a chat completion response from the OpenAI API.

Link copied to clipboard
data class Choice(val index: Int, val delta: Delta? = null, val message: Message? = null, val logprobs: String? = null, val finishReason: String? = null)

Represents a single choice in a chat completion response.

Link copied to clipboard
data class CompletionTokensDetails(val reasoningTokens: Int, val acceptedPredictionTokens: Int, val rejectedPredictionTokens: Int)

Detailed breakdown of completion tokens by category.

Link copied to clipboard
data class Delta(val role: ChatCompletionRole? = null, val content: String? = null)

Represents an incremental message update in a streaming chat completion.

Link copied to clipboard
data class FunctionObject(val name: String, val description: String? = null, val parameters: JsonElement? = null, val strict: Boolean? = false)

Represents a function that can be called by the model.

Link copied to clipboard
data class Message(val role: ChatCompletionRole, val content: MessageContent, val refusal: String? = null, val toolCalls: List<ToolCall>? = null)

Represents a message in a chat completion.

Link copied to clipboard
data class Metadata(val tags: Map<String, String>? = null)

Optional metadata associated with a request.

Link copied to clipboard
open class MockOpenai(port: Int = 0, verbose: Boolean = true) : AbstractMockLlm

Mock implementation of an OpenAI-compatible service for testing purposes.

Link copied to clipboard
data class ResponseFormat(val type: String, val jsonSchema: ResponseFormat.SchemaDescriptor? = null)

Specifies the format that the model must output.

Link copied to clipboard
data class TokenDetails(val cachedTokens: Int? = null)

Detailed breakdown of prompt tokens by category.

Link copied to clipboard
data class Tool(val type: String = "function", val function: FunctionObject)

Represents a tool that can be called by the model.

Link copied to clipboard
data class ToolCall(val id: String, val type: String = "function", val function: CallableFunction)

Represents a tool call generated by the model.

Link copied to clipboard
data class Usage(val promptTokens: Int, val completionTokens: Int, val totalTokens: Int, val completionTokensDetails: CompletionTokensDetails, val promptTokensDetails: TokenDetails? = null)

Usage statistics for a completion request.