Following Amazon Bedrock's recommendations, deprecate individual model chat implementations (Anthropic, Cohere, Llama, Titan, etc.)
in favor of the unified BedrockProxyChatModel. This change promotes the use of Bedrock's Converse API which offers
benefits like model flexibility, extended functionality, and native tool support.
The Converse API does not support embedding operations, so these will remain in the current API and the embedding
model functionality in the existing InvokeModel API will be maintained
Introduce multimodality support for Mistral AI, which currently supports text and vision modalities.
Added integration tests and documentation for the new capability.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
- VectorStore implementations may still be returning the embedding values and mapping onto
Document.class with Jackson
This change ignores that field, but vector store implementations should change to not return
the embedding data that is no longer stored in Document
The OpenAiImageOptions class previously had inconsistent behavior when
setting width and height properties. This change ensures that the size
property is only computed when both dimensions are available, preventing
invalid states in the API requests.
Key changes:
- Update setWidth/setHeight to only set size when both are non-null
- Add test cases to verify null size when dimensions are incomplete
- Improve code organization with proper import conventions
This change aligns with OpenAI's API requirements for image generation
where both dimensions must be specified for valid requests.
The Ollama options builder API has been refactored to follow standard Java
builder pattern conventions. This change deprecates all builder methods
prefixed with 'with' in favor of more concise method names, improving API
consistency and usability.
The deprecated methods are marked for removal in version 1.0.0-M5, giving
users time to migrate to the new builder pattern. This change aligns with
our goal of providing a more intuitive and maintainable API surface.
Breaking Changes:
* builder() method now returns Builder instead of OllamaOptions
* Clients using the old fluent API will need to migrate to the new builder pattern
Refactor Ollama options builder methods
Ollama has recently introduced native support for JSON structured output, as described in https://ollama.com/blog/structured-outputs.
This PR introduces support for it, both for directly passing a JSON schema and when using the Spring AI output conversion APIs.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update WatsonxAi documentation
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update AnthropicChatOptions builder documentation
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update MistralAiChatOptions builder documentation
- Refactor builder methods in `ChatResponseMetadata` to remove `with` prefixes and introduce new methods with updated naming conventions.
- Deprecate existing `with*` methods while maintaining backward compatibility.
- Ensure dependent files and tests are compatible with the updated `ChatResponseMetadata` class.
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update the `copy()` method to use the new builder methods.
- Update MoonshotChatOptions builder documentation
- Deprecate existing FunctionCallingOptionsBuilder
- Create FunctionCallingOptions.Builder which extends ChatOptions.Builder
- Create DefaultFunctionCallingOptions which extends DefaultChatOptions and implements FunctionCallingOptions to serve the default FunctionCalling options
- Create DefaultFunctionCallingOptionsBuilder to build the default functioncalling options
- Update the usage of functioncalling options builder to use the newly added builder including the tests
Improve extensibility of DefaultChatOptionsBuilder
- Enable DefaultChatOptionsBuilder to accommodate any other sub types
- Introduce generics to support sub types that extend DefaultChatOptionsBuilder
- Update builder methods to return the sub type
- Make FunctionCallingOptions' builder()'s return type to accommodate sub types which can extend FunctionCallingOptions.Builder
- Deprecate the builder methods with the prefix `with`
- Fix OCI cohere chat model options and OCI Embedding model options
- Update references and docs
- Refactor the options builder methods to remove `with` as the suffix
- Update all the models under spring-ai-bedrock
- Deprecate the existing methods
- Update references and docs
feat(gemini) not null checks on safetySettings
feat(gemini) check safety settings not empty instead of not null
feat(gemini) Add VertexAiGeminiSafetySetting wrapper class
feat(gemini) Update documentation with new property
feat(gemini) Update equals, hashCode, and toString
- Fix Azure OpenAI chat model's functioncalling to report accumulated token usage
- Fix both call() and stream() operations
- For streaming operation, use buffering to store the usage from the last response when stream option include usage is enabled
- Add tests
- Fix the chat model's call() to calculate the cumulative usage
- Use an explicit internalCall to pass the previous chat response so that accumulation can be done
- Fix the chat model's stream() to calculate the cumulative usage
- Fix MistralAi API to include usgae in ChatCompletionChunk
- Use internalStream() to accumulate the usage
Add/update tests
- Deprecate existing ChatOptionsBuilder and its inner class DefaultChatOptions
- Create a new builder interface ChatOptions.Builder for building the Chat options
- Create an explicit DefaultChatOptions
- Create DefaultChatOptionBuilder which can create DefaultChatOptions
- Add javadoc for the deprecated Builder
Resolves#1875
- Fix OpenAI ChatModel's call() operation
- When toolcalling is used, calculate cumulative usage from the preceding ChatResponses
- Fix OpenAI ChatModel's stream() operation
- Make sure that cumulative usage is calculated from the ChatResponse which has a valid usage
- Use overlapping buffer to check and store the usage from the response that holds the usage.
- Add tests for both call() and stream()
The Document class previously allowed multiple media entries while also having a
text field, leading to ambiguity in content handling. This change enforces a
clear separation between text and media documents to prevent content type
confusion and simplify document processing.
A Document now must contain either text content or a single media entry, but
never both. This aligns with the class's primary use in ETL pipelines where
clear content type boundaries are essential for proper embedding generation and
vector database storage.
Additional architectural changes:
- Document now implements a cleaner API by removing deprecated methods
- Removed MediaContent interface implementation from Document class
- Document.getMedia() now returns a single Media object instead of Collection
- Removed EMPTY_TEXT constant in favor of proper null handling
- Constructor signatures simplified and streamlined
- Builder pattern improved to enforce single content type constraint
The breaking changes include:
- Media is now a single entry instead of a collection
- Content field renamed to text for clarity
- Removed support for mixed content types
- Simplified builder API to prevent ambiguous construction
Prefer using text-related methods over deprecated content methods to
better reflect the actual content type being handled and improve API clarity.
- Add BedrockMediaFormat class to handle media format conversions for documents, images and videos
- Enhance Media class with builder pattern and comprehensive format constants
- Refactor BedrockProxyChatModel to support multimodal content handling
- Add integration tests for PDF, image and video processing
- Add unit tests for Media and BedrockMediaFormat classes
- Upgrade AWS SDK version from 2.26.7 to 2.29.29
- Remove redundant aws.sdk.version property in favor of awssdk.version
Documentation updates for Bedrock Converse API
- Added multimodal support documentation (images, video, documents)
- Added deprecation notices for existing Bedrock model implementations
- Updated feature comparison table
- Added warning notes about transitioning to Converse API
- Upgrade Ollama version used for IT from 0.3.14 to 0.5.1
- Fix string comparison pattern in OllamaModelManager
- Re-enable stream function calling test
- Improve multimodal test assertions