- Introduce top level properties to support conditional logic
- The properties will have the format like "spring.ai.vectorstore.type=<vectorstore provider>" to enable specific vectore store implementation
- By default, these will be enabled when no specific properties are set. To disable, set any value other than the provider name for example, none"
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
- Conditionally enable invidividual models within the provider
- Introduce top level properties to support conditional logic
- The properties will have the format like "spring.ai.model.<chat/embedding/image etc.,>=<provider>" to enable specific chat/embedding/image/audio/moderation models by the provider. By default, these will be enabled when no specific properties are set. To disable, set any value other than the provider name for example, "none"
- For the auto configurations where the provider has multiple models, split the autoconfiguration into per model auto-configuration classes. This will enable the isolated auto-configurations for each provider and its model.
- This PR addresses this for OpenAI and others will follow in subsequent PRs
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
Update the vector store starters with the new observation autoconfig dependency
Other maven configuraiton changes
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Move vector store auto-configuration classes to dedicated modules under auto-configurations/vector-stores/:
- Creates separate modules for Cassandra, Chroma, Elasticsearch, GemFire, HanaDB, MariaDB, MongoDB Atlas, Neo4j, OpenSearch, Oracle, PGVector, and Redis vector stores
- Updates package names to follow the pattern org.springframework.ai.vectorstore.<implementation>.autoconfigure
- Renames corresponding starter modules to follow the pattern spring-ai-starter-vector-store-<implementation>
- Updates import paths in affected classes
- Relocates test resources alongside their respective implementations
- Updates imports in spring-ai-spring-boot-docker-compose and spring-ai-spring-boot-testcontainers
This change improves modularity by allowing each vector store implementation to be
independently versioned and maintained, following the migration pattern established
with previous vector store autoconfiguraiton and starters .
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Move vector store auto-configuration classes to dedicated modules under auto-configurations/vector-stores/:
- Creates separate modules for Milvus, Pinecone, Qdrant, and Typesense vector stores
- Moves CommonVectorStoreProperties to spring-ai-core for better reusability
- Updates pom.xml dependencies to maintain proper relationships between modules
- Name the artifacts based on the pattern spring-ai-autoconfigure-vector-store-<implementation>.
For example - spring-ai-autoconfigure-vectore-store-milvus
- Package names follow the pattern org.springframework.ai.vectorstore.<implementation>.autoconfigure
- Naming the correspondinbg starter modules accordingly (spring-ai-starter-vector-store-milvus for example).
This change improves modularity by allowing each vector store implementation to be
independently versioned and maintained, continuing the migration pattern established
with previous vector stores.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
- Split spring-ai-spring-boot-autoconfigure into modules
- This PR addresses the restructuring of the following spring boot autoconfigurations:
- spring-ai retry -> common
- spring-ai chat client/model/memory -> chat
- spring-ai chat/embedding/image observation -> observation
- spring-ai chat/embedding models -> models
- Update the Spring AI BOM and boot starters with the new autoconfigure modules
- Rename the autoconfiguration and starters
- The package name for the models in autoconfiguration classes will have `org.springframework.ai.model.<name>.autoconfigure`
- Both the autoconfiguration and starters will have the prefix `spring-ai-autoconfigure-model` and `spring-ai-starter-model` respectively
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
Fixes: #938
Issue link: https://github.com/spring-projects/spring-ai/issues/938
This commit integrates Couchbase as a vector store option in Spring AI, providing:
- CouchbaseSearchVectorStore implementation with vector similarity search capabilities
- Support for metadata filtering with SQL++ expression conversion
- Spring Boot auto-configuration and starter module for easy integration
- Comprehensive documentation covering setup, configuration, and usage examples
- Integration tests using TestContainers with Couchbase 7.6
The implementation supports configuring dimensions, similarity functions (dot_product/l2_norm),
and optimization strategies (recall/latency). Schema initialization is now opt-in via
the initializeSchema property. Documentation includes both auto-configuration and
manual configuration instructions, along with property configuration details.
Signed-off-by: Abhiraj <abhiraj.official15@gmail.com>
co-authored-by: Laurent Doguin <laurent.doguin@gmail.com>
- Update ToolCallback import to use relative package path
- Remove qodana.yaml file from the project
Signed-off-by: gongzhongqiang <gongzhongqiang@apache.org>
This change ensures that @Tool annotated methods can be properly discovered even when the tool objects are wrapped
in Spring AOP proxies, which is common when using aspects or other proxy-based features.
- Enhance MethodToolCallbackProvider to properly handle AOP proxied tool objects by detecting proxies
and retrieving their target classes when scanning for @Tool annotated methods.
- Add test suite in MethodToolCallbackProviderAopTests.java to verify AOP proxy handling
Resolves#2356
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Adding `equals` and `hashCode` methods for proper object comparison.
- Implementing a deep `copy()` method, creating new instances of mutable collections (List, Set, Map, Metadata) to prevent shared state.
- Adding `AzureOpenAiChatOptionsTests` to verify `copy()`, builders, setters, and default values.
Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
- Reorganize sections to focus on Milestones vs Snapshots instead of specific versions
- Add Central Portal Snapshots repository configuration for both Maven and Gradle
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Fix Embedding equals() using Arrays.equals() for embedding array comparison
- Fix Embedding hashCode() using Arrays.hashCode() for proper array hashing
- Add final modifiers to fields in Embedding classes
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
- Add null check for isError() method in SyncMcpToolCallback
- Implement consistent error handling in AsyncMcpToolCallback to match SyncMcpToolCallback behavior
- Throw IllegalStateException with error content when tool calls fail
Resolves#2447
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Co-authored-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Add SseHttpClientTransportAutoConfigurationTests to verify conditional bean creation for HTTP client transports
- Add SseWebFluxTransportAutoConfigurationTests to verify conditional bean creation for WebFlux client transports
- Test both auto-configurations with various conditions including presence/absence of WebFluxSseClientTransport and MCP client enabled/disabled states
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Existing example displays a typo in the code example for Runtime Options:
ChatResponse response = chatModel.call(
new Prompt(
"Generate the names of 5 famous pirates.",
OpenAiChatOptions.builder()
.model("gpt-4-o")
.temperature(0.4)
.build()
));
Using gpt-4-0 generates this error:
org.springframework.ai.retry.NonTransientAiException: 404 - {
"error": {
"message": "The model `gpt-4-o` does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
Changing the model String in the example to "gpt-4o" resolves this.
Replace direct dependencies with ObjectProvider pattern in SSE transport auto-configurations.
- Uses ObjectProvider for ObjectMapper and WebClient.Builder dependencies
- Removes redundant @ConditionalOnMissingBean methods
- Provides fallback instantiation when dependencies are not available
Resolves#2440
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Add prefixedToolName utility method to ensure consistent tool name formatting
- E nforce alphanumeric, underscore, and hyphen characters only in tool names
- Limit tool names to 64 characters maximum
- Use original tool name in actual calls while using formatted names in definitions
- Add error handling for tool call responses in SyncMcpToolCallback
- Update tests to reflect the changes
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Remove deprecations from models, vector stores and usage
- Deprecations from FunctionCallback and ObservationContext/Convention will be in a separate PR
Models updates
- Remove AbstractToolCallSupport from the models which use ToolCallingManager
- Remove deprecated constructors and their usage
- Remove FunctionCallbackResolver and FunctionCallbacks usage in the models
- Add back deprecations for VectorStoreChatMemoryAdvisor until builder is fixed
- Update OpenAiPaymentTransactionIT to use ToolCallbackResolver in config
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
Enhances MCP tool naming by prefixing tool names with their client + transport name
to prevent conflicts when multiple MCP clients expose tools with the same name.
- Modifies client info in McpClientAutoConfiguration to include transport name
- Updates SyncMcpToolCallback and AsyncMcpToolCallback to prefix tool names with client + transport name
- Adds test coverage for tools with identical names but different client info
Resolves#2393
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Implement the new ToolCallback.call(String, ToolContext) method in both Sync and Async MCP tool callbacks.
- Since MCP tools don't support tool context, the implementation ignores the context parameter and
delegates to the existing call(String) method. Added test to verify the behavior.
Resolves#2378
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
When streaming happens on an event loop, due to the fact that currently
tools can only be synchronous and blocking, every tool call needs to be
offloaded to a blocking-safe Scheduler.
Resolves#2341
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
When using the RetrievalAugmentationAdvisor with the VectorStoreDocumentRetriever, it’s now possible to provide a filter expression at request-time as an advisor context variable with key VectorStoreDocumentRetriever.FILTER_EXPRESSION.
Fixes gh-1776
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
This commit introduces the `JsoupDocumentReader` and `JsoupDocumentReaderConfig` classes, which provide functionality to read and parse HTML documents using the JSoup library.
The reader supports:
- Extracting text from specific HTML elements using CSS selectors.
- Extracting all text from the body of the document.
- Grouping text by element.
- Extracting metadata, including the document title, meta tags, and link URLs.
- Reading from various resource types (files, URLs, byte arrays).
- Configurable character encoding, selector, separator, and metadata extraction.
This new reader enhances Spring AI's ability to process web content and other HTML-based data sources.
Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
- Make MCP client initialization blocking with .block() call
- Upgrade MCP SDK version from 0.7.0 to 0.8.0-SNAPSHOT
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>