Companion

Companion object for the JsonStructure class, providing utility methods to facilitate the creation of JSON structures with associated schema generation.

Properties

Link copied to clipboard

Default Json instance for JsonStructure.json

Functions

Link copied to clipboard
inline fun <TStruct> create(json: Json = defaultJson, schemaGenerator: JsonSchemaGenerator = StandardJsonSchemaGenerator.Default, descriptionOverrides: Map<String, String> = emptyMap(), excludedProperties: Set<String> = emptySet(), examples: List<TStruct> = emptyList(), noinline definitionPrompt: (builder: TextContentBuilderBase<*>, structuredData: JsonStructure<TStruct>) -> TextContentBuilderBase<*> = ::defaultDefinitionPrompt): JsonStructure<TStruct>
fun <TStruct> create(id: String, serializer: KSerializer<TStruct>, json: Json = defaultJson, schemaGenerator: JsonSchemaGenerator = StandardJsonSchemaGenerator.Default, descriptionOverrides: Map<String, String> = emptyMap(), excludedProperties: Set<String> = emptySet(), examples: List<TStruct> = emptyList(), definitionPrompt: (builder: TextContentBuilderBase<*>, structuredData: JsonStructure<TStruct>) -> TextContentBuilderBase<*> = ::defaultDefinitionPrompt): JsonStructure<TStruct>

Factory method to create JSON structure with auto-generated JSON schema.

Link copied to clipboard

Default prompt explaining the structure of JsonStructure to the LLM.