Package org.springframework.ai.converter
@NonNullApi
@NonNullFields
package org.springframework.ai.converter
Provides converters for transforming AI model text outputs into structured Java types.
The output of AI models traditionally arrives as a String, even if you ask for
the reply to be in JSON. This package provides specialized converters that employ
meticulously crafted prompts and parsing logic to convert text responses into usable
data structures for application integration.
For detailed documentation and usage examples, see the Structured Output Converter Reference Guide.
-
ClassDescriptionAbstract
StructuredOutputConverterimplementation that uses a pre-configuredDefaultConversionServiceto convert the LLM output into the desired type format.AbstractStructuredOutputConverterimplementation that uses a pre-configuredMessageConverterto convert the LLM output into the desired type format.An implementation ofStructuredOutputConverterthat transforms the LLM output to a specific object type using JSON schema.A compositeResponseTextCleanerthat applies multiple cleaners in sequence.Builder forCompositeResponseTextCleaner.Implementations of this interface provides instructions for how the output of a language generative should be formatted.StructuredOutputConverterimplementation that uses aDefaultConversionServiceto convert the LLM output into aListinstance.StructuredOutputConverterimplementation that uses a pre-configuredMappingJackson2MessageConverterto convert the LLM output into a java.util.Map<String, Object> instance.AResponseTextCleanerthat removes markdown code block formatting from LLM responses.Strategy interface for cleaning LLM response text before parsing.Converts the (raw) LLM output into a structured responses of type.AResponseTextCleanerthat removes thinking tags from LLM responses.Builder forThinkingTagCleaner.AResponseTextCleanerthat trims leading and trailing whitespace from text.