Class StructuredOutputValidationAdvisor.Builder
java.lang.Object
org.springframework.ai.chat.client.advisor.StructuredOutputValidationAdvisor.Builder
- Enclosing class:
- StructuredOutputValidationAdvisor
Builder class for StructuredOutputValidationAdvisor.
-
Method Summary
Modifier and TypeMethodDescriptionadvisorOrder(int advisorOrder) Sets the advisor order.build()Builds the StructuredOutputValidationAdvisor.maxRepeatAttempts(int repeatAttempts) Sets the number of repeat attempts.objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets the ObjectMapper to be used for JSON processing.outputType(com.fasterxml.jackson.core.type.TypeReference<T> outputType) Sets the output type using a TypeReference.outputType(io.modelcontextprotocol.json.TypeRef<T> outputType) Sets the output type using a TypeRef.outputType(Type outputType) Sets the output type using a Type.outputType(org.springframework.core.ParameterizedTypeReference<T> outputType) Sets the output type using a ParameterizedTypeReference.
-
Method Details
-
advisorOrder
Sets the advisor order.- Parameters:
advisorOrder- the advisor order- Returns:
- this builder
-
outputType
Sets the output type using a Type.- Parameters:
outputType- the output type- Returns:
- this builder
-
outputType
public <T> StructuredOutputValidationAdvisor.Builder outputType(io.modelcontextprotocol.json.TypeRef<T> outputType) Sets the output type using a TypeRef.- Type Parameters:
T- the type parameter- Parameters:
outputType- the output type- Returns:
- this builder
-
outputType
public <T> StructuredOutputValidationAdvisor.Builder outputType(com.fasterxml.jackson.core.type.TypeReference<T> outputType) Sets the output type using a TypeReference.- Type Parameters:
T- the type parameter- Parameters:
outputType- the output type- Returns:
- this builder
-
outputType
public <T> StructuredOutputValidationAdvisor.Builder outputType(org.springframework.core.ParameterizedTypeReference<T> outputType) Sets the output type using a ParameterizedTypeReference.- Type Parameters:
T- the type parameter- Parameters:
outputType- the output type- Returns:
- this builder
-
maxRepeatAttempts
Sets the number of repeat attempts.- Parameters:
repeatAttempts- the number of repeat attempts- Returns:
- this builder
-
objectMapper
public StructuredOutputValidationAdvisor.Builder objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets the ObjectMapper to be used for JSON processing.- Parameters:
objectMapper- the ObjectMapper- Returns:
- this builder
-
build
Builds the StructuredOutputValidationAdvisor.- Returns:
- a new StructuredOutputValidationAdvisor instance
- Throws:
IllegalArgumentException- if outputType is not set
-