Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class ArrayPropertyDefinition(val type: List<String> = listOf("array"), val description: String? = null, val nullable: Boolean? = null, val items: PropertyDefinition? = null, val minItems: UInt? = null, val maxItems: UInt? = null, val default: JsonElement? = null) : ValuePropertyDefinition

Represents an array property

Link copied to clipboard
Link copied to clipboard
data class BooleanPropertyDefinition(val type: List<String> = listOf("boolean"), val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null) : ValuePropertyDefinition

Represents a boolean property

Link copied to clipboard
data class FunctionCallingSchema(val type: String = "function", val name: String, val title: String? = null, val description: String? = null, val strict: Boolean? = true, val parameters: ParametersDefinition)

FunctionCallingSchema describes a function/tool call in LLM function calling APIs.

Link copied to clipboard
data class JsonSchema(val name: String, val strict: Boolean = false, val description: String? = null, val schema: JsonSchemaDefinition)

Represents a JSON Schema definition

Link copied to clipboard

Builder for JsonSchema instances.

Link copied to clipboard
data class JsonSchemaDefinition(val id: String? = null, val schema: String? = null, val type: String = "object", val properties: Map<String, PropertyDefinition> = emptyMap(), val required: List<String> = emptyList(), val additionalProperties: JsonElement? = null, val description: String? = null, val items: PropertyDefinition? = null)

Represents a JSON Schema definition.

Link copied to clipboard
annotation class JsonSchemaDsl

Marker annotation for the JSON Schema DSL.

Link copied to clipboard
Link copied to clipboard
data class NumericPropertyDefinition(val type: List<String>, val description: String? = null, val nullable: Boolean? = null, val multipleOf: Double? = null, val minimum: Double? = null, val exclusiveMinimum: Double? = null, val maximum: Double? = null, val exclusiveMaximum: Double? = null, val default: JsonElement? = null, val constValue: JsonElement? = null) : ValuePropertyDefinition

Represents a numeric property (integer or number).

Link copied to clipboard
Link copied to clipboard
data class ObjectPropertyDefinition(val type: List<String> = listOf("object"), val description: String? = null, val nullable: Boolean? = null, val properties: Map<String, PropertyDefinition>? = null, val required: List<String>? = null, val additionalProperties: JsonElement? = null, val default: JsonElement? = null) : ValuePropertyDefinition

Represents an object property

Link copied to clipboard
data class ParametersDefinition(val properties: Map<String, PropertyDefinition> = emptyMap(), val required: List<String> = emptyList(), val additionalProperties: Boolean = false)

JSON schema defining the function's input arguments.

Link copied to clipboard

Builder for defining property types and constraints.

Link copied to clipboard

Represents a property definition in a JSON Schema.

Link copied to clipboard

Serializer for PropertyDefinition that handles polymorphic serialization.

Link copied to clipboard

Represents a reference to another element

Link copied to clipboard

A custom serializer for handling JSON values that can either be a single string or a list of strings. This serializer ensures that both formats are correctly deserialized into a List<String> and serialized back into their appropriate JSON representation.

Link copied to clipboard
Link copied to clipboard
data class StringPropertyDefinition(val type: List<String> = listOf("string"), val description: String? = null, val nullable: Boolean? = null, val format: String? = null, val enum: List<String>? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null, val default: JsonElement? = null, val constValue: JsonElement? = null) : ValuePropertyDefinition

Represents a string property.

Link copied to clipboard

Represents a value-based property definition in a JSON Schema.

Functions

Link copied to clipboard

Encodes the given FunctionCallingSchema instance into a JsonObject representation.

Encodes the given JsonSchema instance into a JsonObject representation.

Link copied to clipboard

Encodes the FunctionCallingSchema instance into its JSON string representation.

Encodes the JsonSchema instance into its JSON string representation.

Link copied to clipboard

DSL for building JSON Schema objects in a type-safe and readable way.