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

Source of the attachment.

Link copied to clipboard
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

A list of Message.Assistant responses representing multiple completion choices from the LLM.

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
sealed interface MessagePart

A discrete piece of content within a Message. Parts are typed by their direction and purpose: RequestPart parts go to the LLM, ResponsePart parts come from the LLM, and ContentPart parts (text, attachments) are valid in both directions.

Link copied to clipboard

Builder for creating MessagePart.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 modelId: String? = null, 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 MessagePart.Tool.Call instances from Java code.

Link copied to clipboard

Builder for creating MessagePart.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.