Package-level declarations

Types

Link copied to clipboard

Exception indicating an error during the parsing of structured output from a language model.

Link copied to clipboard
abstract class Structure<TStruct, TSchema : LLMParams.Schema>(val id: String, val schema: TSchema, val examples: List<TStruct>) : StructureDefinition

Represents a generic structure for handling data with a specific schema.

Link copied to clipboard

Represents the definition of structured data, enabling content construction and customization.

Link copied to clipboard

An object that provides utilities for formatting structured output prompts.

Link copied to clipboard
sealed interface StructuredRequest<T>

Defines how structured outputs should be generated.

Link copied to clipboard
data class StructuredRequestConfig<T>(val default: StructuredRequest<T>? = null, val byProvider: Map<LLMProvider, StructuredRequest<T>> = emptyMap())

Configures structured output behavior. Defines which structures in which modes should be used for each provider when requesting a structured output.

Link copied to clipboard
data class StructuredResponse<T>(val data: T, val structure: Structure<T, *>, val message: Message.Assistant)

Represents a container for structured data parsed from a response message.

Functions

Link copied to clipboard
fun <T> TextContentBuilderBase<*>.structure(structure: Structure<T, *>, value: T)

Adds a structured representation of the given value to the TextContentBuilderBase.