Package-level declarations

Types

Link copied to clipboard

Builder for creating Message.Assistant instances from Java code.

Link copied to clipboard

Content of the attachment, check implementation nested classes for supported content types.

Link copied to clipboard
sealed interface CacheControl

Cache control configuration for prompt caching. Indicates that the LLM provider should cache content up to and including the element this is attached to.

Link copied to clipboard
sealed interface ContentPart

Represents a part of a message. Parts can be text ContentPart.Text, images ContentPart.Image, audio ContentPart.Audio, or files ContentPart.File. All attachment parts (all except ContentPart.Text) must implement Attachment interface.

Link copied to clipboard
Link copied to clipboard
sealed interface Message

Represents a message exchanged in a chat with LLM. Messages can be categorized by their type and role, denoting the purpose and source of the message.

Link copied to clipboard

Entry point for creating Message instances from Java code using the builder pattern.

Link copied to clipboard
sealed interface MessageMetaInfo

Meta-information associated with a message in a chat system.

Link copied to clipboard

Builder for creating Message.Reasoning instances from Java code.

Link copied to clipboard
data class RequestMetaInfo @JvmOverloads constructor(val timestamp: Instant, val metadata: JsonObject? = null) : MessageMetaInfo

Represents MessageMetaInfo specific to a request within the system.

Link copied to clipboard

Builder for creating RequestMetaInfo instances from Java code.

Link copied to clipboard
data class ResponseMetaInfo @JvmOverloads constructor(val timestamp: Instant, val totalTokensCount: Int? = null, val inputTokensCount: Int? = null, val outputTokensCount: Int? = null, val additionalInfo: Map<String, String> = emptyMap(), val metadata: JsonObject? = null) : MessageMetaInfo

Represents metadata associated with a response message in a chat system.

Link copied to clipboard

Builder for creating ResponseMetaInfo instances from Java code.

Link copied to clipboard

Builder for creating Message.System instances from Java code.

Link copied to clipboard

Builder for creating Message.Tool.Call instances from Java code.

Link copied to clipboard

Builder for creating Message.Tool.Result instances from Java code.

Link copied to clipboard

Builder for creating Message.User instances from Java code.

Functions

Link copied to clipboard

Creates a RequestMetaInfo with a java.time.Instant timestamp.

fun ResponseMetaInfo.Companion.fromJavaInstant(timestamp: Instant, totalTokensCount: Int? = null, inputTokensCount: Int? = null, outputTokensCount: Int? = null, metadata: JsonObject? = null): ResponseMetaInfo

Creates a ResponseMetaInfo with a java.time.Instant timestamp.

Link copied to clipboard
inline fun <T : CacheControl> CacheControl.require(): T

Requires this CacheControl to be of the specified type T, or throws an IllegalStateException.