requestLLMStructured

fun <T> requestLLMStructured(config: ERROR CLASS: Symbol not found for StructuredRequestConfig<T>, fixingParser: ERROR CLASS: Symbol not found for StructureFixingParser?? = null, executorService: ExecutorService? = null): ERROR CLASS: Symbol not found for Result<ERROR CLASS: Symbol not found for StructuredResponse<T>>(source)

Sends a structured request to the language model using a StructuredRequestConfig.

Return

a Result containing a StructuredResponse on success or an error on failure

Parameters

config

the configuration describing the expected structured output and parsing behavior

executorService

an optional executor service for managing the execution context; if null, the default dispatcher is used


fun <T> requestLLMStructured(serializer: ERROR CLASS: Symbol not found for KSerializer<T>, examples: List<T> = emptyList(), fixingParser: ERROR CLASS: Symbol not found for StructureFixingParser?? = null, executorService: ExecutorService? = null): ERROR CLASS: Symbol not found for Result<ERROR CLASS: Symbol not found for StructuredResponse<T>>(source)

Sends a structured request to the language model using an explicit serializer and example values.

Return

a Result containing a StructuredResponse on success or an error on failure

Parameters

serializer

the serializer describing how to encode/decode the structured type T

examples

example values to guide the model towards the expected structure

fixingParser

an optional parser used to repair malformed structured responses

executorService

an optional executor service for managing the execution context; if null, the default dispatcher is used