- Avoid overlapping package names
Changed in spring-ai-commons package from org.sf.ai.model to org.sf.ai.content
Refactor advisor module name to be spring-ai-advisors-vector-store
Moved advisors into org.springframework.ai.chat.client.advisor.vectorstore
- Created top level memory directory
- Create new module spring-ai-model-chat-memory-neo4j and moved neo4j memory classes out of the vectorstore module
Updated neo4j autoconfiguation
- Add missing formats "wav" and "pcm" which OpenAI supports but SpringAI does not have serializers for
Signed-off-by: gabriel duncan <gabrielduncan@Mac.attlocal.net>
- Rename Registration classes to Specification (SyncToolRegistration → SyncToolSpecification)
- Update transport classes to use Provider suffix (WebFluxSseServerTransport → WebFluxSseServerTransportProvider)
- Add exchange parameter to handler methods for better context passing
- Introduce McpBackwardCompatibility class to maintain backward compatibility
- Update MCP Server documentation to reflect new API patterns
- Add tests for backward compatibility
- Update mcp version to 0.8.0
- Add mcp 0.8.0 breaking change note-
The changes align with the MCP specification evolution while maintaining backward compatibility through deprecated APIs.
refactor: Extract MCP tool callback configuration into separate auto-configuration
Extracts the MCP tool callback functionality from McpClientAutoConfiguration into a
new dedicated McpToolCallbackAutoConfiguration that is disabled by default.
- Created new McpToolCallbackAutoConfiguration class that handles tool callback registration
- Made tool callbacks opt-in by requiring explicit configuration with spring.ai.mcp.client.toolcallback.enabled=true
- Removed deprecated tool callback methods from McpClientAutoConfiguration
- Updated ClientMcpTransport references to McpClientTransport to align with MCP library changes
- Added tests for the new auto-configuration and its conditions
refactor: standardize tool names to use underscores instead of hyphens
- Change separator in McpToolUtils.prefixedToolName from hyphen to underscore
- Add conversion of any remaining hyphens to underscores in formatted tool names
- Update affected tests to reflect the new naming convention
- Add comprehensive tests for McpToolUtils.prefixedToolName method
- Add integration test for payment transaction tools with Vertex AI Gemini
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>
- 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>
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>
This commit enhances `AnthropicChatOptions` by:
- 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 `AnthropicChatOptionsTests` to verify `copy()`, builders, setters, and default values.
Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
Add the ability to specify custom HTTP headers for Anthropic API requests through AnthropicChatOptions.
This allows users to override or add headers for authentication, tracking, or other API-specific requirements.
- Add httpHeaders field to AnthropicChatOptions with appropriate getters/setters
- Implement header merging between default and runtime options
- Update AnthropicApi to accept additional HTTP headers in API calls
- Add integration test demonstrating API key override via custom headers
- Update documentation with the new configuration property
Resolves#2335
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Changes the validation logic in MethodToolCallback to check if a ToolContext is required by the method but not provided,
rather than checking if a ToolContext is provided but not supported by the method.
This ensures methods that expect a ToolContext parameter receive one.
Updates tests cases to reflect the new validation logic
Resolves#2337
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Add support for Claude 3.7 Sonnet model and make it the default
- Rename function-related APIs to tool-related APIs for consistency:
- Change functionCallbacks to toolCallbacks
- Change function to toolNames
- Replace FunctionCallingOptions with ToolCallingChatOptions
- Refactor AnthropicChatModel instantiation to use builder pattern
- Update tests to use latest model versions instead of dated versions
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
The proxyToolCalls flag was incorrectly mapped to internalToolExecutionEnabled. This change inverts the boolean value to
properly reflect that proxy tool calls are the opposite of internal tool execution.
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Extends the ToolCallingAutoConfiguration to support both FunctionCallback and ToolCallback types.
- The toolCallbackResolver bean now handles both callback types through ObjectProvider injection.
- Added comprehensive tests to verify the resolution of multiple function and tool callbacks.
- Introduce new StaticToolCallbackProvider implementation
- Update ToolCallbackProvider to return FunctionCallback[]
- Migrate from List to ToolCallbackProvider in configurations
- Update tests to use new provider pattern
- Enhance tool callback providers to support multiple clients
- Refactor AsyncMcpToolCallbackProvider and SyncMcpToolCallbackProvider to handle multiple MCP clients
- Add ToolCallbackProvider support to ChatClient API
- Deprecate direct tool callback list methods in favor of providers
- Fix typos in Closeable class names
- Update MCP documentation with new examples and usage patterns
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Update to use ApiKey when instantiating OpenAI Image/Audio/Moderation APIs
- Add Builders for OpenAI Image/Audio/Moderation APIs and deprecate existing constructors
- Add/update tests
- Replace hasText check with notNull for ApiKey with String value
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
- Update AnthropicChatModel to use the new ToolCallingManager API, while ensuring full API backward compatibility.
- Introduce Builder to instantiate a new AnthropicChatModel since the number of overloaded constructors is growing too big.
- Update documentation about tool calling and Anthropic support for that.
Part of the #2207 epic
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
- Add javadoc for VertexAiGeminiChatModel including features, examples, and cross-references
- Document JsonSchemaConverter and VertexToolCallingManager classes and methods
- Fix formatter annotation placement in VertexAiGeminiChatOptions
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Migrate from function calling to tool calling API
- Add support for Gemini 2.0 models (flash, flash-lite)
- Implement JSON schema to OpenAPI schema conversion
- Add builder pattern for improved configuration
- Deprecate legacy function calling constructors and methods
- Update default model to GEMINI_2_0_FLASH
- Add comprehensive test coverage for tool calling
- Upgrade victools dependency to 4.37.0
- Update the Vertex Tool calling docs
Part of the #2207 epic
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Replace function calling with tool calling in BedrockProxyChatModel
- Deprecate function calling related code and APIs
- Add new tool calling manager and options
- Update builder pattern to remove "with" prefix from methods
- Update tests and documentation for tool calling
Part of the #2207 epic
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Use the new ToolCallingManager API for AzureOpenAI chat model
- Add Builder to construct AzureOpenAI chat model instance
- Deprecate existing constructors
- Update documentation about the change
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
- Update MistralAiChatModel to use the new ToolCallingManager API, while ensuring full API backward compatibility.
- Introduce Builder to instantiate a new MistralAiChatModel since the number of overloaded constructors is growing too big.
- Update documentation about tool calling and Mistral AI support for that.
- Add extra validation to ensure the uniqueness of tool names when aggregated from different sources.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Additiona fixes: API key validation and tool calling backward compatibility
- Fix API key validation in OpenAiApi builder
- Standardize API key validation using Assert.notNull
- Add backward compatibility support for FunctionCallback in tool calling
- Update integration tests to use LegacyToolCallingManager
Co-authored-by:Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Ricken Bazolo <ricken.bazolo@gmail.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Update OpenAiChatModel to use the new ToolCallingManager API, while ensuring full API backward compatibility.
- Introduce Builder to instantiate a new OpenAiChatModel since the number of overloaded constructors is growing too big.
- Update documentation about tool calling and OpenAI support for that.
- Add extra validation to ensure the uniqueness of tool names when aggregated from different sources.
- Ensure consistent merging of options, following Spring Boot strategy.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
When fields in OllamaOptions are marked as ignored in Jackson, they require explicit merge of runtime and default options.
Added tests to validate the different merge combinations for all tool-related options.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>