Class StructuredOutputValidationAdvisor

java.lang.Object
org.springframework.ai.chat.client.advisor.StructuredOutputValidationAdvisor
All Implemented Interfaces:
Advisor, CallAdvisor, StreamAdvisor, org.springframework.core.Ordered

public final class StructuredOutputValidationAdvisor extends Object implements CallAdvisor, StreamAdvisor
Advisor that validates the structured JSON output of a chat client response against a JSON schema derived from the configured output type or a pre-supplied schema string.

When validation fails, the advisor appends the validation error to the user message and re-invokes the model, repeating up to maxRepeatAttempts times.

Streaming responses are not supported.

Author:
Christian Tzolov