With Example Converter
Decorator for Spring's StructuredOutputConverter that adds few-shot examples to the output format description.
Few-shot examples are often used in prompt engineering to help AI models understand the expected output format by providing concrete example outputs. This converter generates such examples automatically using dummy data and injects them into the format description returned by [getFormat()].
Parameters
the output type for the converter
the underlying output converter to which conversion is delegated
the class type for which dummy example instances will be generated
determines whether to include both success and failure examples (true) or just a simple example (false)
whether to generate examples or not. This class does nothing if it is false Wraps an existing StructuredOutputConverter with this class to enhance its format description for LLM prompting.