Package org.springframework.ai.converter
Interface StructuredOutputConverter<T>
- Type Parameters:
T- Specifies the desired response type.
- All Superinterfaces:
org.springframework.core.convert.converter.Converter<String,,T> FormatProvider
- All Known Implementing Classes:
AbstractConversionServiceOutputConverter,AbstractMessageOutputConverter,BeanOutputConverter,ListOutputConverter,MapOutputConverter
public interface StructuredOutputConverter<T>
extends org.springframework.core.convert.converter.Converter<String,T>, FormatProvider
Converts the (raw) LLM output into a structured responses of type. The
FormatProvider.getFormat() method should provide the LLM prompt description of
the desired format.- Author:
- Mark Pollack, Christian Tzolov, Filip Hrisafov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for when there is no JSON schema available. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns the JSON schema for the structured output of an LLM call.Methods inherited from interface org.springframework.core.convert.converter.Converter
andThen, convertMethods inherited from interface org.springframework.ai.converter.FormatProvider
getFormat
-
Field Details
-
NO_JSON_SCHEMA
Constant for when there is no JSON schema available.- See Also:
-
-
Method Details
-
getJsonSchema
Returns the JSON schema for the structured output of an LLM call.- Returns:
- the JSON schema or
NO_JSON_SCHEMAif not available - Since:
- 2.0.0
-