This version is still in development and is not considered stable yet. For the latest snapshot version, please use Spring AI 1.0.0-SNAPSHOT!spring-doc.cn

As of 02.05.2024 the old OutputParser, BeanOutputParser, ListOutputParser and MapOutputParser classes are deprecated in favor of the new StructuredOutputConverter, BeanOutputConverter, ListOutputConverter and MapOutputConverter implementations. the latter are drop-in replacements for the former ones and provide the same functionality. The reason for the change was primarily naming, as there isn’t any parsing being done, but also have aligned with the Spring org.springframework.core.convert.converter package brining in some improved functionality.
The StructuredOutputConverter is a best effort to convert the model output into a structured output. The AI Model is not guaranteed to return the structured output as requested. The model may not understand the prompt or be unable to generate the structured output as requested. Consider implementing a validation mechanism to ensure the model output is as expected.
The StructuredOutputConverter is not used for LLM Function Calling, as this feature inherently provides structured outputs by default.

Modelspring-doc.cn

Integration Tests / Samplesspring-doc.cn

OpenAIspring-doc.cn

OpenAiChatModelITspring-doc.cn

Anthropic Claude 3spring-doc.cn

AnthropicChatModelIT.javaspring-doc.cn

Azure OpenAIspring-doc.cn

AzureOpenAiChatModelIT.javaspring-doc.cn

Mistral AIspring-doc.cn

MistralAiChatModelIT.javaspring-doc.cn

Ollamaspring-doc.cn

OllamaChatModelIT.javaspring-doc.cn

Vertex AI Geminispring-doc.cn

VertexAiGeminiChatModelIT.javaspring-doc.cn

Bedrock Anthropic 2spring-doc.cn

BedrockAnthropicChatModelIT.javaspring-doc.cn

Bedrock Anthropic 3spring-doc.cn

BedrockAnthropic3ChatModelIT.javaspring-doc.cn

Bedrock Coherespring-doc.cn

BedrockCohereChatModelIT.javaspring-doc.cn

Bedrock Llamaspring-doc.cn

BedrockLlamaChatModelIT.java.javaspring-doc.cn