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
Recursive Advisor that validates the structured JSON output of a chat client entity response against a generated JSON schema for the expected output type.

If the validation fails, the advisor will repeat the call up to a specified number of attempts.

Note: This advisor does not support streaming responses and will throw an UnsupportedOperationException if used in a streaming context.

Author:
Christian Tzolov