Commit Graph

722 Commits

Author SHA1 Message Date
Soby Chacko
bd82e73193 Rename spring-ai parent from spring-ai to spring-ai-parent
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-03 10:11:03 -04:00
Mark Pollack
676c139efb Update docs based on module refactorings 2025-04-03 10:11:03 -04:00
Yanming Zhou
25c584a783 Fix typo in ETL pipeline document (#2626)
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-04-03 10:35:50 +01:00
jonghoonpark
a50f80b7a6 update mcp-client-boot-starter-docs.adoc (#2624)
Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
2025-04-03 07:37:39 +01:00
Xwh
49df62533d Update vectordbs doc,batching-strategy is remove (#2550)
Signed-off-by: Xwh <981800006@qq.com>
2025-04-01 11:11:45 +01:00
yoobin_mion
77e87ccb39 Fix: Duplicate example in Vector Databases documentation (#2562) (#2563)
Signed-off-by: yoobin_mion <113106136+yybmion@users.noreply.github.com>
2025-04-01 10:55:11 +01:00
yangtuooc
63891544c1 docs: fix BakLLaVA model name spelling in multimodality documentation (#2608)
Signed-off-by: Wenhao Ma <296232679@qq.com>
Co-authored-by: jonghoon park <dev@jonghoonpark.com>
2025-04-01 10:37:04 +01:00
Viacheslav Dobrynin
a75b27f99b fix: correction of a typo (Char -> Chat) (#2606)
Signed-off-by: Viacheslav Dobrynin <49430239+viacheslav-dobrynin@users.noreply.github.com>
2025-03-31 12:12:47 +01:00
JongIn Won
1795d85fb3 fix ChatModel docs (#2605)
Fixed deprecated getContent() to getText() in ChatModel documentation.

Signed-off-by: jongin <jonginwon1203@gmail.com>
2025-03-31 11:38:05 +01:00
JongIn Won
e57b41fdc4 fix Structured Output Converter docs (#2604)
Fixed deprecated getContent() to getText() in Structured Output Converter documentation.

Signed-off-by: jongin <jonginwon1203@gmail.com>
2025-03-31 10:07:57 +01:00
Thomas Vitale
83294023cd ToolContext is now excluded from JSON Schema Generation
When generating the JSON Schema for a tool input from a method, ToolContext is now excluded since it's not something we want the model to provide. The framework takes care of passing a value for it when actually executing the tool call.

Fixes gh-2366

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2025-03-27 20:31:42 +01:00
Ilayaperumal Gopinathan
3c17750a00 Documentation updates for image/audio docs
- Fix to include the correct top level property to enable/disable image/audio models

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-27 12:08:29 +00:00
Wandile
510ae2291d Update mcp-client-boot-starter-docs.adoc (#2577)
wrong spelling check
serverConfiurationName -> serverConfigurationName

Signed-off-by: Wandile <64791173+wandile-gim@users.noreply.github.com>
2025-03-27 11:59:17 +00:00
Enrico Rampazzo
1d4bde80e5 Neo4j chatmemory implementation
- Add chatmemory implementation for Neo4j
  - Add autoconfiguration for Neo4jChatMemory
  - Add tests

Signed-off-by: Enrico Rampazzo <enrico.rampazzo@live.com>
2025-03-26 20:04:08 +00:00
양예성
e8d4957d0e Fix :: Broken URL link to document
VectorStoreDocumentRetriever not linked so fix it

Signed-off-by: 양예성 <127856153+yeseong0412@users.noreply.github.com>
2025-03-26 08:53:43 +09:00
Ilayaperumal Gopinathan
9eacd40aa9 Update/remove autoconfiguration enable/disable configurations
- Since the model autoconfiguration enable/disable flags are no longer used, remove them

   - Currently, the model autoconfigurations can be enabled/disabled via top level Spring AI properties such as spring.ai.model.chat/embedding/image/moderation=<model-provider-name>

   - Update documentation to add note section about this change

- Update note on the autoconfiguration section to point to the configuration changes

- Align the vertex ai text/multimodal keys in line with the other properties

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-25 19:36:30 +01:00
Christian Tzolov
fc955c74eb feat(mcp): Refactor MCP server API to use Specification pattern
- 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>
2025-03-25 14:23:12 -04:00
Mark Pollack
c11cc739b3 update reference docs for upgrade 2025-03-24 23:07:27 -04:00
Soby Chacko
3d494961c2 Migrate Couchbase vector store auto-configuration to dedicated module
- Update dependencies and module names in maven pom.xml files affecting couchbase vector store support
- Rename artifact from spring-ai-couchbase-store-spring-boot-starter to spring-ai-starter-vector-store-couchbase
- Update imports and related cleanup
- Update corresponding documentation references

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:23 -04:00
Ilayaperumal Gopinathan
2d778e8a0c Update vector store docs for Spring AI starters
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-24 15:34:23 -04:00
Ilayaperumal Gopinathan
ce00204914 Update docs references for the Spring AI model starters
- Update the documentation references to replace the artifact ID name change for the model starters

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-24 15:34:23 -04:00
Ilayaperumal Gopinathan
83ff0133cd Update MCP starters
- Update starters for MCP and docs
2025-03-24 15:34:23 -04:00
Ilayaperumal Gopinathan
0453fc55d5 Modularise Spring AI Spring Boot autoconfigurations
- 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>
2025-03-24 15:34:22 -04:00
P.Sri Varshan
d8ef6efa9c Fix: Added missing return statement in Couchbase Cluster bean example (#2557)
Signed-off-by: PSriVarshan <psvvarshan@gmail.com>
2025-03-24 11:43:24 +00:00
Laurent Doguin
d25d37ab12 GH-938: Add Couchbase vector store support
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>
2025-03-20 18:59:56 -04:00
Hu Shihao
4c0813dfb3 Update tools.adoc Corrected incorrect punctuation usage (#2503)
Original:
ChatOptions chatOptions = ToolCallingChatOptions.builder()
    .toolCallbacks(customerTools)
    .toolContext(Map.of("tenantId", "acme"))
    .build():

After Change:
ChatOptions chatOptions = ToolCallingChatOptions.builder()
    .toolCallbacks(customerTools)
    .toolContext(Map.of("tenantId", "acme"))
    .build();

Signed-off-by: Hu Shihao <122598964+Hushihaoooooo@users.noreply.github.com>
2025-03-19 11:52:08 +00:00
cc0824
61c60a6126 Update deepseek-chat.adoc (#2515)
Signed-off-by: cc0824 <45746445+cc0824@users.noreply.github.com>
2025-03-19 11:49:15 +00:00
MagicalConch
cdac6ee42f Update mcp-client-boot-starter-docs.adoc
Signed-off-by: MagicalConch <37917403+git102347501@users.noreply.github.com>
2025-03-17 15:36:46 +00:00
Christian Tzolov
9e390c11a8 docs: Update repository configuration in getting-started guide
- 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>
2025-03-12 14:03:36 -04:00
Manuel Andreo Garcia
e4853d757a fix azure openai chat model doc OpenAIClientBuilderCustomizer usage example
Signed-off-by: Manuel Andreo Garcia <manuel@magware.dev>
2025-03-12 10:30:49 +00:00
Justin Martz
dcc91487b4 Update openai-chat.adoc
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.
2025-03-12 07:28:10 +00:00
Thomas Vitale
5a4e9f5108 Request-time filter expressions for RAG
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>
2025-03-10 11:45:17 +00:00
Alexandros Pappas
82b46d2182 feat: add JSoup HTML document reader
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>
2025-03-10 11:34:25 +00:00
Alexandros Pappas
6512ec4257 Fix property name in Redis documentation
Fixes #2414

resolves: https://github.com/spring-projects/spring-ai/issues/2414

Current implementation of RedisProperties: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java#L49

Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-03-10 07:53:26 +00:00
hungrytech
bed1db352a fix vertordbs opensearch.adoc
Signed-off-by: hungrytech <xorals9448@gmail.com>
2025-03-08 18:52:54 +00:00
jonghoon park
2903b2019d fix typo in rag doc
Signed-off-by: jonghoon park <dev@jonghoonpark.com>
2025-03-07 12:34:53 +00:00
Christian Tzolov
87f45d0dac Improve referenced doc navigation
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-07 10:28:50 +01:00
waileong
e128a39ec3 Updates the SearchRequest class to be non-final and adds a MilvusSearchRequest subclass that includes Milvus-specific fields for native expressions and search parameters.
- Updated `SearchRequest.java` to make the class non-final.
- Added `MilvusSearchRequest` with specific Milvus parameters such as `nativeExpression` and `searchParamsJson`.
- Modified `doSimilaritySearch` method in `MilvusVectorStore` to handle these new fields from `MilvusSearchRequest`.

Add unit tests for MilvusVectorStore and MilvusSearchRequest

Introduce comprehensive unit tests to validate the functionality of MilvusVectorStore and MilvusSearchRequest, including scenarios for native and filter expressions. Refactor MilvusVectorStore to improve filter expression handling by introducing a helper method for converted expressions.

Add detailed documentation for MilvusSearchRequest usage

Introduced sections explaining MilvusSearchRequest's parameters, `nativeExpression`, and `searchParamsJson`, with examples for enhanced clarity. This update provides guidance on leveraging Milvus-specific features for precise filtering and optimal search performance.

Signed-off-by: waileong <wai_leong1015@hotmail.com>
2025-03-05 11:33:07 +00:00
jonghoonpark
747524b815 update anthropic model version in example code
Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
2025-03-05 08:53:19 +00:00
Christian Tzolov
53bb6a5b00 feat(mcp): add support for custom MIME types in tool responses
Add capability to specify MIME types for MCP tool responses, with special handling for image content.

This enhancement allows tools to return different content types, particularly images, by:
- Adding a new toolResponseMimeType map property to configure response MIME types per tool
- Extending tool registration methods to accept and use MIME type information
- Adding special handling for image content in tool responses
- Updating documentation with the new configuration options

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-01 19:55:26 +01:00
Christian Tzolov
041d94f0c9 feat(anthropic): add support for custom HTTP headers in Anthropic API requests (#2343)
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>
2025-02-28 09:57:10 -05:00
Jaeyeon Kim
6cb15e4727 Update azure-openai-chat.adoc
Signed-off-by: jaeyeonling <jaeyeonling@gmail.com>
2025-02-27 11:30:02 +00:00
birariro
1599c2e500 Modify the sample code
- Modify how OpenAiChatOption is used
- Modify how OllamaOptions is used

Signed-off-by: birariro <vps32@naver.com>
2025-02-27 11:02:05 +00:00
xuweidong
2c7283483e correct wrong property name
Signed-off-by: xuweidong <xuweidong253@gmail.com>
2025-02-27 10:57:22 +00:00
Christian Tzolov
3dfea48249 feat(anthropic): update to Claude 3.7 Sonnet and refactor API
- 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>
2025-02-26 22:36:52 -05:00
Ilayaperumal Gopinathan
c91163b6a3 Upgrade Pinecone java client to 4.0.1 (#2328)
- Upgrade the java client from 0.8.0 to 4.0.1
   - Use io.pinecone.clients.Pinecone to setup the client configuration with the API key
     - Remove projectId, environment and other deprecated client configurations
   - Update upsert, delete, search operations with the new client
   - Remove the projectID and Environment configurations from the builder
   - Updated the Pinecone vectorstore autoconfiguration
   - Update tests

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>

Disable autoconfig IT until the auto-configuration is modularised
2025-02-26 18:09:34 -05:00
Christian Tzolov
b29076f9a4 docs: Improve MCP overview with Spring Boot integration details
Reorganize MCP documentation to better explain Spring AI's integration with the MCP Java SDK.
 Add references to client and server boot starters and clarify the distinction between core
 SDK architecture and Spring Boot integration.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-24 18:48:15 +01: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
Christian Tzolov
fd9f388724 fix blroken doc link
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-14 16:47:32 +01:00