Commit Graph

1804 Commits

Author SHA1 Message Date
Soby Chacko
413ab9692d Migrate weaviate store auto-config to its own module
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>

Fixing typo, adding new autoconfig module to starter module

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-02-20 15:37:41 +00:00
jonghoon park
0719f44016 rename files from Mpc to Mcp for consistency
Signed-off-by: jonghoon park <dev@jonghoonpark.com>
2025-02-20 18:25:24 +09:00
jonghoon park
b97531bc25 fix sample code in bedrock-converse.adoc
Signed-off-by: jonghoon park <dev@jonghoonpark.com>
2025-02-19 17:25:36 +00:00
Soby Chacko
8e23422dc0 Vector store classes checkstyle fix
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-02-18 19:40:22 -05:00
Ilayaperumal Gopinathan
83dcf385dd Add boot configuration processor to MCP Autoconfiguration POMs (#2274)
- Adding Spring Boot configuration processor for the tools autocompletion support

Resolves #2273

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-02-18 13:17:58 -05:00
Jonas Muribø
fcc56f4abf Fix issue with CosmosDBVectorStore.Builder where the different Assert.hasText(..., "... must not be empty") evaluates the current value (null) rather than the argument passes to each builder function. Fix issue where partitionKeyPath is required, yet is never configured via CosmosDBVectorStoreAutoConfiguration
Signed-off-by: Jonas Muribø <jmurib@gmail.com>
2025-02-17 17:31:49 +00:00
Christian Tzolov
fd9f388724 fix blroken doc link
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-14 16:47:32 +01:00
Alexandros Pappas
c623264666 refactor: replace wildcard imports with explicit class imports
Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-02-14 14:12:43 +00:00
Christian Tzolov
7bc79f51d1 chore(openai): update default chat model to gpt-4o-mini
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-14 14:46:17 +01:00
Ilayaperumal Gopinathan
e41afd04a9 Update mcp sdk version for spring boot autoconfigure POM 2025-02-14 13:29:26 +00:00
Christian Tzolov
7eabb80f6e Update MCP SDK to 0.7.0 2025-02-14 14:23:14 +01:00
ogirardot
dd9e574092 fix(spring-ai-azure-openai): last chat completions can have null deltas
Signed-off-by: ogirardot <olivier.girardot@arkhn.com>
2025-02-14 07:55:18 +00:00
Christian Tzolov
12729b0900 fix(integration-tests) fix test fixture
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-14 08:49:21 +01:00
Christian Tzolov
e4d8a9c3ef fix(vertex-ai): Invert proxyToolCalls flag to match internal tool execution behavior
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>
2025-02-14 00:20:52 +01:00
Ilayaperumal Gopinathan
5b5abc4a8b Fix for FunctionToolCallbackTests
- Add more deterministic test data for assertion
2025-02-13 22:57:00 +00:00
Christian Tzolov
1fdda61db8 feat(autoconfigure): Support both FunctionCallback and ToolCallback in ToolCallingAutoConfiguration
- 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>
2025-02-13 20:31:20 +01:00
Thomas Vitale
68ad742f4a Update Maven Central reference
Spring AI milestones are now published to Maven Central. This PR updates all the places where we used to reference Spring Milestones repository.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2025-02-13 19:07:44 +01:00
Mark Pollack
33ca0cc9ac Update docs to show artifacts for M6 and later are in Maven Central 2025-02-13 12:28:16 -05:00
Christian Tzolov
48ee1234c8 fix(mcp webmvc server starter) Add missing dependency
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-13 17:58:32 +01:00
Ilayaperumal Gopinathan
a528253ab0 Use ApiKey for OpenAI Image/Audio/Moderation APIs
- 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>
2025-02-13 13:24:48 +01:00
Christian Tzolov
c19287d808 feat(bedrock): Add StopReason check for tool execution
Add StopReason.TOOL_USE validation before executing tools to ensure proper tool execution flow.
Remove unused commented code and improve code formatting.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-13 10:31:02 +01:00
Thomas Vitale
b7dcfc1198 Anthropic - Adopt ToolCallingManager API
- 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>
2025-02-13 09:48:34 +01:00
Christian Tzolov
8463454a87 docs: enhance Vertex AI Gemini documentation and code organization
- 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>
2025-02-13 09:21:49 +01:00
Thomas Vitale
a307a2ba30 Deprecate redundant field in ModelObservationContext
Each ModelObservationContext takes both a request object (e.g. Prompt) and an options object (e.g. ChatOptions). However, the options are already included in the request object. This PR deprecates the additional field, which will be removed in a subsequent release.

The reason why the extra field was there in the first place was due to the model implementations not handling request options correctly, requiring a dedicated setter. We started fixing the model implementations now, so we are deprecating te extra field, and we'll remove it in the next release, once we have completed the implementation of a fix for all model implementations.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2025-02-13 08:54:44 +01:00
Christian Tzolov
3393e98bdb refactor: Use centralized JsonParser utility instead of local ObjectMapper instance
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-13 08:48:35 +01:00
Christian Tzolov
d50174f242 minor vertex doc fix
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-13 08:44:28 +01:00
Christian Tzolov
710bb05f19 feat(vertex-ai): Refactor Gemini for new tool calling API
- 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>
2025-02-12 22:48:24 -05:00
Soby Chacko
4d692a542b Add missing integration tests for delete by ID API in vector store implementations.
Extract common vector store delete tests to base class

This commit extracts shared delete operation tests into a reusable BaseVectorStoreTests class.
This reduces code duplication and provides a consistent test suite for delete operations across
different vector store implementations. The base class includes tests for:

Deleting by ID
Deleting by filter expressions
Deleting by string filter expressions

Most of the vector store implementation now extends this base class and inherits these
common tests while maintaining the ability to add vector store specific tests.

Adding javadoc

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-02-12 20:09:08 +00:00
Christian Tzolov
a8e305d28a refactor(bedrock): Migrate from function calling to tool calling
- 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>
2025-02-12 18:29:48 +00:00
Manuel Andreo Garcia
5ebe485c26 document AzureOpenAIClientBuilderCustomizer (#2224)
Signed-off-by: Manuel Andreo Garcia <manuel@magware.dev>
2025-02-12 12:20:52 -05:00
ddobrin
4d0caa2aff Fixes #1543 Inaccurate warning for VertexAI Gemini Function Calling
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-12 13:57:50 +01:00
Christian Tzolov
fd6db2d5ae feat(test): improve logging in authorsByBooks function tests
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-12 13:49:45 +01:00
Ilayaperumal Gopinathan
7e4b90dc48 AzureOpenAI - Adopt ToolCallingManager API
- 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>
2025-02-12 12:17:25 +00:00
Christian Tzolov
ee9eb0582d Minor doc link fix
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-12 12:46:09 +01:00
Thomas Vitale
6c3a2c39fc Mistral AI - Adopt ToolCallingManager API
- 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>
2025-02-12 11:56:03 +01:00
pbakker
b936a9c429 Possible fix for issue #2218, allowing to disable setting the Authorization header.
Signed-off-by: pbakker <pbakker@netflix.com>
2025-02-12 10:34:06 +00:00
Soby Chacko
0d0eafec6c Update Pinecone vector store docs for the builder pattern 2025-02-12 07:33:47 +00:00
Soby Chacko
86a73f9e87 Add vector store delete API ref docs with examples
- Document delete APIs with ID lists and filter expressions
- Add versioning use case with metadata-based updates

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-02-11 16:51:21 -05:00
Soby Chacko
3f0557b8b3 Vector store impls: code cleanup and checkstyle fixes
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-02-11 16:16:57 -05:00
Manuel Andreo Garcia
bdd0aa118a Add AzureOpenAIClientBuilderCustomizer interface
Introduces a new customization point for Azure OpenAI client configuration
through the AzureOpenAIClientBuilderCustomizer interface. This allows
applications to customize the OpenAIClientBuilder while preserving the default
auto-configuration behavior.

- Add AzureOpenAIClientBuilderCustomizer interface (since 1.0.0-M6)
- Modify all OpenAIClientBuilder bean creation methods to apply customizers
- Add integration test verifying ordered customizer application

Signed-off-by: Manuel Andreo Garcia <manuel@magware.dev>
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-02-11 12:39:28 -05:00
Ricken Bazolo
e92616b10e fix(mistral) Added index of tool call in the list of tool calls
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>
2025-02-11 14:10:51 +01:00
Christian Tzolov
011deb04a6 fix(integration-tests): improve the robustness of the test fixture
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-11 12:35:13 +01:00
Thomas Vitale
52198ed9d7 OpenAI - Adopt ToolCallingManager API
- 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>
2025-02-11 10:54:43 +01:00
Christian Tzolov
9710f780e3 docs: consolidate MCP documentation into Antora structure
- Enhance MCP server boot starter documentation with:
- Improved formatting and organization
- More detailed examples and code snippets
- Better explanations of features and capabilities
- Links to MCP specification
- Example applications section
- Remove standalone documentation files in favor of Antora structure

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-11 10:23:02 +01:00
Christian Tzolov
0f1aca5518 docs: enhance MCP documentation with customization details and examples
- Expand client customization documentation with detailed sections
- Add comprehensive descriptions of MCP components and capabilities
- Improve code examples and explanations
- Add example applications sections for both client and server
- Fix typos and enhance overall documentation structure

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-11 09:56:50 +01:00
Christian Tzolov
fe377ee5e1 Refactor: MCP Autoconfig Modularization
Core Architecture Changes:
- Split MCP into dedicated client/server modules
- Created separate starters: spring-ai-starter-mcp-webmvc and spring-ai-starter-mcp-webflux
- Removed property-based transport configuration in favor of auto-configuration
- Added support for multiple transport types (STDIO, WebMVC, WebFlux)

Client Improvements:
- Added support for both synchronous and asynchronous MCP clients
- Fixed client auto-configuration issues
- Added root change notification property to common properties

Configuration Enhancements:
- Improved configuration properties organization and validation
- Added ConditionalOnMissingBean for WebMvc/WebFlux configurations
- Enhanced lifecycle management and customization support

Testing and Documentation:
- Added comprehensive integration tests for McpClientAutoConfiguration
- Updated McpServerAutoConfigurationIT
- Added extensive JavaDoc documentation
- Improved MCP client/server starter documentation
- Added documentation for common utilities
- Updated navigation for new MCP documentation sections

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-11 00:52:00 -05:00
Jinho Lee
015662a118 fix sample code in perplexity-chat.adoc (#2205)
Signed-off-by: birariro <vps32@naver.com>
2025-02-10 15:09:31 -05:00
Ilayaperumal Gopinathan
4874374507 Mistral chat model enum cleanup
- Remove deprecated models
 - Add suggestions from @apappascs
2025-02-08 08:16:01 +00:00
Ricken Bazolo
99e90e2d91 Mistral API versions added
Signed-off-by: Ricken Bazolo <ricken.bazolo@gmail.com>
2025-02-08 07:52:55 +00:00
Robby Zhao
1b216ab17e Fix code indent for the sample code in deepseek-chat.adoc
Signed-off-by: Robby Zhao <robby.zhaox@gmail.com>
2025-02-08 07:35:37 +00:00