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
Default Json instance for JsonStructuredData.json
Functions
Link copied to clipboard
inline fun <TStruct> createJsonStructure(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: JsonStructuredData<TStruct>) -> TextContentBuilderBase<*> = ::defaultDefinitionPrompt): JsonStructuredData<TStruct>
fun <TStruct> createJsonStructure(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: JsonStructuredData<TStruct>) -> TextContentBuilderBase<*> = ::defaultDefinitionPrompt): JsonStructuredData<TStruct>
Factory method to create JSON structure with auto-generated JSON schema.
Link copied to clipboard
fun <TStruct> defaultDefinitionPrompt(builder: TextContentBuilderBase<*>, structuredData: JsonStructuredData<TStruct>): TextContentBuilderBase<*>
Default prompt explaining the structure of JsonStructuredData to the LLM.