JsonStructuredData
class JsonStructuredData<TStruct>(id: String, schema: LLMParams.Schema.JSON, examples: List<TStruct>, val serializer: KSerializer<TStruct>, val json: Json, definitionPrompt: (builder: TextContentBuilderBase<*>, structuredData: JsonStructuredData<TStruct>) -> TextContentBuilderBase<*> = ::defaultDefinitionPrompt) : StructuredData<TStruct, LLMParams.Schema.JSON> (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, schema: LLMParams.Schema.JSON, examples: List<TStruct>, serializer: KSerializer<TStruct>, json: Json, definitionPrompt: (builder: TextContentBuilderBase<*>, structuredData: JsonStructuredData<TStruct>) -> TextContentBuilderBase<*> = ::defaultDefinitionPrompt)
Types
Link copied to clipboard
object Companion
Companion object for the JsonStructuredData class, providing utility methods to facilitate the creation of JSON structures with associated schema generation.
Properties
Link copied to clipboard
kotlinx.serialization.json.Json instance to perform de/serialization.
Link copied to clipboard
The schema that defines the structure and validation rules for the data.
Link copied to clipboard
The serializer used to convert the data to and from JSON.