nodeLLMRequestStructured

A node that appends a user message to the LLM prompt and requests structured data from the LLM with optional error correction capabilities.

Parameters

name

Optional node name.

config

A configuration defining structures and behavior.


inline fun <T> AIAgentSubgraphBuilderBase<*, *>.nodeLLMRequestStructured(name: String? = null, examples: List<T> = emptyList(), fixingParser: StructureFixingParser? = null): AIAgentNodeDelegate<String, Result<StructuredResponse<T>>>(source)

A node that appends a user message to the LLM prompt and requests structured data from the LLM with optional error correction capabilities.

This is a simple version of the full nodeLLMRequestStructured. Unlike the full version, it does not require specifying struct definitions and structured output modes manually. It attempts to find the best approach to provide a structured output based on the defined model capabilities.

Parameters

name

Optional node name.

examples

Optional list of examples in case manual mode will be used. These examples might help the model to understand the format better.

fixingParser

Optional parser that handles malformed responses by using an auxiliary LLM to intelligently fix parsing errors. When specified, parsing errors trigger additional LLM calls with error context to attempt correction of the structure format.