Package-level declarations

Types

Link copied to clipboard

Simple implementation of GenericJsonSchemaGenerator that produces LLMParams.Schema.JSON.Basic. Generates LLM-agnostic schema not tied to any specific provider format. For LLMs requiring custom formats when using native structured output, consider provider-specific generators instead.

Link copied to clipboard

Generic extensions of JsonSchemaGenerator that provides some common base implementations of visit methods. This class can be used as a base to implement custom generators that share generic schema generation logic.

Link copied to clipboard

Collection of special constants, such as keys and data types, from JSON schema definition.

Link copied to clipboard
abstract class JsonSchemaGenerator

JSON schema generator from Kotlin serializable classes, to be used with LLM structured output functionality. This generator creates JSON schemas that can be included in LLM prompts to encourage structured outputs that match your Kotlin data models. The generated schemas help LLMs understand the expected response format.

Link copied to clipboard

Full implementation of GenericJsonSchemaGenerator to generate advanced generic LLMParams.Schema.JSON.Standard. Generates LLM-agnostic schema not tied to any specific provider format. For LLMs requiring custom formats when using native structured output, consider provider-specific generators instead.

Functions

Link copied to clipboard

Recursively counts the number of occurrences of the specified JsonElement within this JsonElement.

Link copied to clipboard

Utility function to get all subtype serial descriptors from a given polymorphic serial descriptor, that can handle both PolymorphicKind.OPEN and PolymorphicKind.SEALED kinds.