JsonStructuredData

class JsonStructuredData<TStruct>(id: String, serializer: KSerializer<TStruct>, structureLanguage: JsonStructureLanguage, examples: List<TStruct>, jsonSchema: LLMParams.Schema.JSON) : StructuredData<TStruct> (source)

Represents a structure for handling and interacting with structured data of a specified type.

Parameters

TStruct

The type of data to be structured.

Constructors

Link copied to clipboard
constructor(id: String, serializer: KSerializer<TStruct>, structureLanguage: JsonStructureLanguage, examples: List<TStruct>, jsonSchema: LLMParams.Schema.JSON)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Represents the type of JSON schema that can be utilized for structured data definition. This defines the level of detail or complexity included in the schema.

Properties

Link copied to clipboard

A collection of example instances of the structured data type.

Link copied to clipboard
val id: String

A unique identifier for the structured data entity.

Link copied to clipboard

The schema that defines the structure and validation rules for the data.

Functions

Link copied to clipboard
open override fun definition(builder: TextContentBuilder): TextContentBuilder

Defines the structure of textual content using the provided TextContentBuilder.

Link copied to clipboard
open override fun parse(text: String): TStruct

Parses the given text into a structured data representation.

Link copied to clipboard
open override fun pretty(value: TStruct): String

Formats the given structured data into a human-readable string representation.