requestLLMStructured

inline suspend fun <T> requestLLMStructured(message: String, 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.

Parameters

message

The input message to be sent to the LLM.

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.