Introduces a new API key management system that allows users to customize how
API keys are provided and managed in their Spring AI applications. This
change improves security and flexibility by:
- Adding core ApiKey interface and SimpleApiKey implementation
- Introducing @OpenAiApiKey qualifier for bean disambiguation
- Supporting custom API key providers for secure key management
- Adding auto-configuration support for API key injection
- Adding builder pattern for OpenAiApi configuration
- Deprecating public constructors in favor of builder API (since 1.0.0.M6)
The new system enables users to implement their own key management
strategies while maintaining backward compatibility with property-based
configuration.
Adds getNativeClient API to VectorStore interface allowing access to the underlying native client implementation.
This change:
- Adds getNativeClient() default method to VectorStore interface returning Optional<T>
- Implements getNativeClient() in all vector store implementations exposing their respective native clients
- Adds integration tests verifying native client access for all implementations
Fixes: #2137
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
- Amzon Bedrock chat models were deprecated to support Amazon Bedrock Converse API for the chat models.
- This PR removes all the references of the deprecated Amazon Bedrock chat models
- Remove Amazon Bedrock chat models for anthropic, anthropic3, cohere, jurassic2, titan
- Remove API, chat options and model
- Remove tests and doc references
- Update the doc to reflect the changes
- Update upgrade notes
Resolves#2124
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
Replace the existing builder implementation with a type-safe Step Builder pattern
to enforce required field initialization in a specific order. This change:
- Introduces a new builder() method that guides users through required fields
- Deprecates the old builder method with all parameters
- Makes field configuration more explicit and type-safe
- Updates all usage points to use the new builder pattern
The required fields must now be provided in sequence:
1. embeddingModel
2. apiKey
3. projectId
4. environment
5. indexName
This change improves API usability by preventing parameter confusion and ensuring
all required fields are set before optional configuration.
Implement filter-based deletion for WeaviateVectorStore by leveraging the
existing ID-based deletion mechanism.
Key changes:
- Add doDelete(Filter.Expression) implementation that delegates to the existing
ID-based deletion method
- Use similarity search with filter to find matching documents first
- Delete matched documents by their IDs
- Add integration tests for filter deletion scenarios:
* Deleting by simple equality filter
* Deleting by string-based filter expression
This maintains consistency with other vector store implementations while
working around Weaviate's limitations in direct filtered deletion.
* Adopted new tool calling logic in OllamaChatModel, while maintaining full API backward compatibility thanks to the LegacyToolCallingManager.
* Improved efficiency and robustness of merging options in prompts for Ollama.
* Update Ollama Autoconfiguration to use the new ToolCallingManager.
* Improved troubleshooting for new tool calling APIs and finalised changes for full backward compatibility.
* Updated Ollama Testcontainers dependency to 0.5.7.
Relates to gh-2049
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Implement filter-based deletion for CassandraVectorStore to support more
flexible document removal based on metadata filters.
Key changes:
- Add doDelete(Filter.Expression) implementation
- Implement workaround for Cassandra's limitations in direct filtered deletion
- Fetch matching documents first, then delete by IDs
- Add integration tests for various filter deletion scenarios
- Support simple and complex filter expressions
- Includes tests for:
* Deleting by simple equality filter
* Deleting by string-based filter expression
* Deleting by complex AND filter expression
Provides consistent deletion capabilities across vector store implementations
while addressing Cassandra-specific constraints.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Add string-based filter deletion alongside the Filter.Expression-based deletion
for Pinecone vector store and improve test organization through refactoring.
Key changes:
- Add delete(Filter.Expression) implementation using two-step process:
* Search for documents matching filter
* Delete matching documents by ID
- Leverage existing search functionality to maintain filter consistency
- Extract common test patterns into helper methods
- Create reusable document factory methods for test data
- Add comprehensive integration tests for filter deletion
- Standardize test cleanup and verification patterns
This maintains consistency with other vector store implementations while
working within Pinecone's API limitations. The test refactoring improves
maintainability and makes the test patterns clearer and more consistent.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Add string-based filter deletion alongside the Filter.Expression-based deletion
for Typesense vector store, providing consistent deletion capabilities with
other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation using Typesense filter expressions
- Leverage existing TypesenseFilterExpressionConverter for filter translation
- Use Typesense's DeleteDocumentsParameters for filtered deletion
- Add comprehensive integration tests for filter deletion
- Support both simple and complex filter expressions
This maintains consistency with other vector store implementations while
utilizing Typesense's native filtering capabilities for efficient metadata-based
deletion.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
- Delete the old maven central release workflow and replace it with the new workflow which uses nexus staging plugin
- Delete the artifactory staging release workflow as it is no longer needed
- This was used to push the artifacts into repo.spring.io libs-staging-local before pushing into sonatype staging. With the nexus staging plugin, we directly push the artifacts into sonatype staging
- Delete maven central staging release workflow as it is no longer needed as well
Refactors the test codebase to use tools instead of functions.
- Rename FunctionCallback to FunctionToolCallback
- Rename FunctionCallingOptions to ToolCallingChatOptions
- Update API methods from functions() to tools()
- Deprecate function-related methods in favor of tool alternatives
- Refactor MethodToolCallback implementation with improved builder pattern
- Update all tests to use new tool-based APIs
- Add funcs to tools migration guide
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
* Introduced ToolCallingManager to manage the tool calling activities for resolving and executing tools. A default implementation is provided. It can be used to handle explicit tool execution on the client-side, superseding the previous FunctionCallingHelper class. It’s ready to be instrumented via Micrometer, and support exception handling when tool calls fail.
* Introduced ToolCallExceptionConverter to handle exceptions in tool calling, and provided a default implementation propagating the error message to the chat morel.
* Introduced ToolCallbackResolver to resolve ToolCallback instances. A default implementation is provided (DelegatingToolCallbackResolver), capable of delegating the resolution to a series of resolvers, including static resolution (StaticToolCallbackResolver) and dynamic resolution from the Spring context (SpringBeanToolCallbackResolver).
* Improved configuration in ToolCallingChatOptions to enable/disable the tool execution within a ChatModel (superseding the previous proxyToolCalls option).
* Added unit and integration tests to cover all the new use cases and existing functionality which was not covered by autotests (tool resolution from Spring context).
* Deprecated FunctionCallbackResolver, AbstractToolCallSupport, and FunctionCallingHelper.
Relates to gh-2049
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Add string-based filter deletion alongside the Filter.Expression-based deletion
for Redis vector store, providing consistent deletion capabilities with
other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation using Redis FT.SEARCH and JSON.DEL
- Configure metadata fields properly to support numeric and tag operations
- Support both simple and complex filter expressions
- Handle Redis-specific JSON string responses in tests
- Add comprehensive integration tests for filter deletion cases
This maintains consistency with other vector store implementations while
utilizing Redis Search capabilities for efficient metadata-based deletion.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Add string-based filter deletion alongside the Filter.Expression-based deletion
for Qdrant vector store, providing consistent deletion capabilities with
other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation using Qdrant's filter API
- Leverage existing QdrantFilterExpressionConverter for filter translation
- Use Qdrant's native deleteAsync with filter capabilities
- Add comprehensive integration tests for filter deletion
- Support both simple and complex filter expressions
This maintains consistency with other vector store implementations while
utilizing Qdrant's native filtering capabilities for efficient metadata-based
deletion.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Add string-based filter deletion alongside the Filter.Expression-based deletion
for Oracle vector store, providing consistent deletion capabilities with
other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation using Oracle JSON_EXISTS
- Leverage existing SqlJsonPathFilterExpressionConverter for JSON path expressions
- Add comprehensive integration tests for filter deletion
- Support both simple and complex filter expressions
- Handle Oracle-specific JSON types in test assertions
This maintains consistency with other vector store implementations while
utilizing Oracle's JSON path capabilities for efficient metadata-based deletion.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Add string-based filter deletion alongside the Filter.Expression-based deletion
for Neo4j and OpenSearch vector stores, providing consistent deletion capabilities
with other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation for Neo4j store using Cypher queries
- Add delete(Filter.Expression) implementation for OpenSearch store using query_string
- Leverage existing filter expression converters for both stores
- Use Neo4j's transaction batching for efficient large-scale deletions
- Use OpenSearch's delete_by_query API for metadata-based deletion
- Add comprehensive integration tests for both stores covering:
* Simple equality filters
* String-based filter expressions
* Complex filter expressions with multiple conditions
This maintains consistency with other vector store implementations while utilizing
store-specific features for efficient metadata-based deletion.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Add string-based filter deletion alongside the Filter.Expression-based deletion
for MongoDB Atlas vector store, providing consistent deletion capabilities with
other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation for MongoDB Atlas store
- Leverage existing MongoDBAtlasFilterExpressionConverter for filter translation
- Use MongoTemplate's native query capabilities for deletion
- Add comprehensive integration tests for filter deletion
- Support both simple and complex filter expressions
This maintains consistency with other vector store implementations while
utilizing MongoDB-specific query capabilities for efficient metadata-based deletion.
Add string-based filter deletion alongside the Filter.Expression-based deletion
for Milvus vector store, providing consistent deletion capabilities with
other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation for Milvus store
- Leverage existing MilvusFilterExpressionConverter for filter translation
- Use Milvus client's native delete API with filter expressions
- Add comprehensive integration tests for filter deletion
- Support both simple and complex filter expressions
This maintains consistency with other vector store implementations while
utilizing Milvus-specific APIs for efficient metadata-based deletion.
Add string-based filter deletion alongside the Filter.Expression-based deletion
for MariaDB vector store, providing consistent deletion capabilities with
other vector store implementations.
Key changes:
- Add delete(Filter.Expression) implementation for MariaDB store
- Integrate with existing MariaDBFilterExpressionConverter
- Add comprehensive integration tests for filter deletion
- Support both simple and complex filter expressions
This maintains consistency with other vector store implementations and
enables flexible document deletion based on metadata filters.
- Remove model specific Usage implementations
- Add `Object getNativeUsage()` to Usage interface
- This will allow the model specific Usage data to be returned
- At the client side, client needs to cast the return type of `getNativeUsage` into the corresponding Usage returned by the model API
- Rename `generationTokens` to `completionTokens`
- Since `completion` token name is more common among the models, renaming generation tokens into completion tokens
- Maintain JSON deserialization compatibility for legacy `generationTokens` field
- Remove deprecated Long-based constructors to avoid API ambiguity
- Change the prompt, completion and total token return types from Long to Integer
- This is a breaking change that requires updating all constructor calls
- Integer is sufficient for token counts and aligns better with most model APIs
- Use DefaultUsage for most of the model specific usage handling
- When initializing set the native usage to the model specific usage type
- Ensure immutability by making all fields final and removing setters
- Add comprehensive test coverage for all functionality including edge cases
Resolves#1407
Testcontainers 1.20.4 provides a new module for typesense with
TypesenseContainer implementation.
Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
* Enhanced support for functions as tools via FunctionToolCallback (deprecating the existing FunctionInvokingFunctionCallback).
* Aligned JSON Schema generation and parsing logic between function-based and method-based tools.
* Deprecated previous client-side function calling APIs.
* Included AOT configuration for Tool-annotated methods in Spring beans.
Relates to gh-2049
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>