Package org.springframework.ai.parser
Class BeanOutputParser<T>
java.lang.Object
org.springframework.ai.parser.BeanOutputParser<T>
- Type Parameters:
T
- The target type to which the output will be converted.
- All Implemented Interfaces:
FormatProvider
,OutputParser<T>
,Parser<T>
Deprecated.
- Author:
- Mark Pollack, Christian Tzolov, Sebastian Ullrich, Kirk Lund
-
Constructor Summary
ConstructorDescriptionBeanOutputParser
(Class<T> clazz) Deprecated.Constructor to initialize with the target type's class.BeanOutputParser
(Class<T> clazz, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Deprecated.Constructor to initialize with the target type's class, a custom object mapper, and a line endings normalizer to ensure consistent line endings on any platform. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Provides the expected format of the response, instructing that it should adhere to the generated JSON schema.protected com.fasterxml.jackson.databind.ObjectMapper
Deprecated.Configures and returns an object mapper for JSON operations.Deprecated.
-
Constructor Details
-
BeanOutputParser
Deprecated.Constructor to initialize with the target type's class.- Parameters:
clazz
- The target type's class.
-
BeanOutputParser
Deprecated.Constructor to initialize with the target type's class, a custom object mapper, and a line endings normalizer to ensure consistent line endings on any platform.- Parameters:
clazz
- The target type's class.objectMapper
- Custom object mapper for JSON operations. endings.
-
-
Method Details
-
parse
Deprecated. -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Deprecated.Configures and returns an object mapper for JSON operations.- Returns:
- Configured object mapper.
-
getFormat
Deprecated.Provides the expected format of the response, instructing that it should adhere to the generated JSON schema.- Specified by:
getFormat
in interfaceFormatProvider
- Returns:
- The instruction format string.
-
BeanOutputConverter
instead. An implementation ofOutputParser
that transforms the LLM output to a specific object type using JSON schema. This parser works by generating a JSON schema based on a given Java class, which is then used to validate and transform the LLM output into the desired type.