StructuredData

abstract class StructuredData<TStruct>(val id: String, val examples: List<TStruct>, val schema: LLMParams.Schema) : StructuredDataDefinition(source)

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

This abstract class provides a base for defining structured data entities that are identified by a unique id, involve a list of examples of a specific type TStruct, and adhere to a given schema.

Parameters

TStruct

The type of the structured data that this class handles.

Inheritors

Constructors

Link copied to clipboard
constructor(id: String, examples: List<TStruct>, schema: LLMParams.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

Defines the structure of textual content using the provided TextContentBuilder.

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

Parses the given text into a structured data representation.

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

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