requestLLMStructured
expect inline suspend fun <T> requestLLMStructured(message: String, examples: List<T> = emptyList(), fixingParser: StructureFixingParser? = null): Result<StructuredResponse<T>>(source)
suspend fun <T : Any> requestLLMStructured(message: String, clazz: KClass<T>, examples: List<T> = emptyList(), fixingParser: StructureFixingParser? = null): Result<StructuredResponse<T>>(source)
Sends a structured request to the Large Language Model (LLM) and processes the response.
Return
A Result containing a StructuredResponse of the requested type T, or an error if the request fails.
Parameters
T
The type of the structured response required.
message
The input message to be sent to the LLM.
clazz
The Kotlin class type of the expected structured response.
examples
An optional list of example objects used to guide the model's structured response generation.
fixingParser
An optional parser to correct or validate the structured response.
actual inline suspend fun <T> requestLLMStructured(message: String, examples: List<T>, fixingParser: StructureFixingParser?): Result<StructuredResponse<T>>(source)
actual inline suspend fun <T> requestLLMStructured(message: String, examples: List<T>, fixingParser: StructureFixingParser?): Result<StructuredResponse<T>>(source)