2357 Commits

Author SHA1 Message Date
Guan Huo
aada198b46 fix: failed to generate spring.ai.tools.observations metadata (#3539)
Auto-cherry-pick to 1.0.x

Signed-off-by: Jionghui Zheng <9uanhuo@gmail.com>
2025-06-16 16:14:53 +01:00
Hudson Luiz Sales Schumaker
97b91f5e6c Update advisors.adoc (#3552)
Auto-cherry-pick to 1.0.x

Signed-off-by: Hudson Luiz Sales Schumaker <hudson.schumaker@me.com>
2025-06-16 16:10:02 +01:00
Sun Yuhan
384478edbf doc: Documentation improvements in MCP Server Boot Starter selection
- Improved the documentation in the `MCP Server Boot Starter` regarding `Starter` selection, 
   and added descriptions of precautions for `spring-ai-starter-mcp-server-webflux`. 

Fixes: #3511

Auto-cherry-pick to 1.0.x

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
2025-06-13 15:36:38 -04:00
老虎是条大狼狗
ed4fb29a74 Update zhipuai-chat.adoc (#3531)
* Update zhipuai-chat docs example with "produces = MediaType.TEXT_EVENT_STREAM_VALUE"  ( Content-Type =  "text/event-stream" ) in the "@GetMapping" annotation.

Auto-cherry-pick to 1.0.x

Signed-off-by: 老虎是条大狼狗 <494509580@qq.com>
2025-06-13 10:19:34 -04:00
Jemin Huh
e4788044bb docs: fix incorrect usage of tools and defaultTools (#3533)
Auto-cherry-pick to 1.0.x

Signed-off-by: Jemin Huh <hjm1980@gmail.com>
2025-06-13 10:37:31 +01:00
Sun Yuhan
b9a683460d test: Add unit test to verify multiple method toolcallbacks with toolcontext
Auto-cherry-pick to 1.0.x

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
2025-06-13 07:38:34 +01:00
pavan kumar punna
16a7084faa docs(web): fix links to ChatOptions and ChatOptions#builder() (#3447)
use DefaultChatOptionsBuilder for link to ChatOptions#builder()

Auto-cherry-pick to 1.0.x

Signed-off-by: punnapavankumar9 <punnapavankumar9@gmail.com>
2025-06-13 07:16:37 +01:00
Ilayaperumal Gopinathan
d8c728e574 Remove explicit test dependency version for jackson-dataformat-xml
- Use the dependency from Spring Boot BOM

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-06-12 19:53:17 +01:00
Sun Yuhan
76c70189e2 fix: validateToolContextSupport method to use right order in ClassUtils.isAssignable
Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
2025-06-12 18:27:58 +01:00
Ilayaperumal Gopinathan
66324a64d1 Fix OllamaEmbeddingAutoConfigurationTests
- Use OllamaEmbeddingAutoConfiguration for the test

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-06-12 18:12:22 +01:00
Ilayaperumal Gopinathan
3bce15a349 Revert "Fix OpenAiChatClientMethodInvokingFunctionCallbackIT"
This reverts commit 95b3df7a2b.
2025-06-12 17:46:49 +01:00
Ilayaperumal Gopinathan
f0c128cb0c Revert "fix: corrected a logic error in the validateToolContextSupport method caused by incorrect parameter order."
This reverts commit 59d26610ef.
2025-06-12 17:46:39 +01:00
Alexandros Pappas
d9e3037984 feat: equals, hashCode, deep copy, and tests to MiniMaxChatOptions
This commit enhances MiniMaxChatOptions by:
- Updating `equals` and `hashCode` methods for proper object comparison.
- Updating `copy()` method, creating new instances of mutable collections (List, Set, Map, Metadata) to prevent shared state.
- Adding `MiniMaxChatOptionsTests` to verify `copy()`, builders, setters, and default values.
- Add more tests for objects not equal, defensive unmodifiable getters etc.

Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-06-12 12:33:25 -04:00
Alexandros Pappas
cfbefee6a2 feat(ollama): add retry template integration to OllamaChatModel
* Update tests that are supposed to fail to not use retry
* Upgrade ot use Ollama 0.6.7

Signed-off-by: Alexandros Pappas <alexandros.pappas@yiluhub.com>
2025-06-12 11:06:53 -04:00
Alexandros Pappas
6ef15bdd74 feat: Add new Mistral AI chat models (#3523)
Adds MAGISTRAL_MEDIUM, MISTRAL_MEDIUM, MAGISTRAL_SMALL, and DEVSTRAL_SMALL to the available chat models.

Fixes: #3523

Auto-cherry-pick to 1.0.x

Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-06-12 10:57:57 -04:00
Ilayaperumal Gopinathan
f8d0503db8 Fix ElasticsearchVectorStore to parse similarity option correctly
- Check for valid DenseVectorSimilarity by using DenseVectorSimilarity's jsonValue with SimilarityFunction string
 - Update elasticsearch image elasticsearch:8.18.1

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-06-12 11:41:18 +01:00
Ilayaperumal Gopinathan
15775f15c2 Fix version for elevenlabs starter/autoconfiguration artifacts in Spring AI BOM
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-06-12 07:54:44 +01:00
Ahoo Wang
5cb5c90a0c refactor(spring-ai-model): improve parameter name in ChatGenerationMetadata (#3507)
- Changed the parameter name in the finishReason method from 'id' to 'finishReason' for better clarity and accuracy

Signed-off-by: Ahoo Wang <ahoowang@qq.com>
2025-06-11 20:34:37 -04:00
Alexandros Pappas
9398850c2b feat: Add ElevenLabs Text-to-Speech support
This commit introduces a new `spring-ai-elevenlabs` module to integrate ElevenLabs' TTS service into Spring AI.

Key Features:
- **New Module:** `spring-ai-elevenlabs` with a Spring Boot starter for auto-configuration.
- **Core Classes:**
  - `ElevenLabsTextToSpeechModel`: Implements `TextToSpeechModel` and `StreamingTextToSpeechModel`.
  - `ElevenLabsTextToSpeechOptions`: Configurable TTS options (voice, format, speed, etc.).
  - `ElevenLabsApi` and `ElevenLabsVoicesApi`: Low-level REST clients for ElevenLabs APIs.
  - DTOs: `Speech`, `TextToSpeechMessage`, `TextToSpeechPrompt`, `TextToSpeechResponse`.
- **Auto-configuration:**
  - `ElevenLabsAutoConfiguration`, `ElevenLabsConnectionProperties`, and `ElevenLabsSpeechProperties`.
- **Functionality:**
  - Text-to-speech conversion with ElevenLabs voices.
  - Real-time streaming playback support.
  - Flexible runtime configuration via properties and model options.
- **Documentation:** Updated Spring AI reference guide with usage examples.
- **Tests:** Includes unit and integration tests for both success and failure scenarios.

Note:
- Some `tts` package classes will be relocated to the `core` module to support shared TTS abstractions, including upcoming OpenAI Speech API support.

- Added metadata support to `TextToSpeechResponse`.
- Added tests and updated documentation.

Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-06-11 15:26:15 -04:00
Ilayaperumal Gopinathan
2be1e42505 Upgrade Spring Boot to 3.5.0
- Update Spring Boot version to 3.5.0
 - Enforce elasticsearch-java client to use the explicit version 8.18.1
      - This is because of the incompatibility between Spring Boot 3.4.x and 3.5.0 in using the elastic search java client versions 8.15.1 vs 8.18.1

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-06-11 13:34:37 -04:00
Alexandros Pappas
12f19dbfe0 feat(anthropic): Add support for streaming thinking events
Add necessary types and update stream processing to handle Anthropic's 'thinking' content blocks and deltas in streaming responses. This resolves an issue where an IllegalArgumentException was thrown for unhandled thinking event types.
format

Added docs

Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-06-11 13:17:53 -04:00
Gareth Evans
c4e434a5e5 fix: bedrock titan embeddings should return usage
Auto-cherry-pick to 1.0.x

Signed-off-by: Gareth Evans <gareth@bryncynfelin.co.uk>
2025-06-11 11:54:54 +01:00
Ilayaperumal Gopinathan
95b3df7a2b Fix OpenAiChatClientMethodInvokingFunctionCallbackIT
- Update test to check if the exception is thrown when using the method without toolcontext as method argument but with explicit toolcontext values

 - Add test to verify that exception is not thrown when toolcontext is not set even with the callback method with the toolcontext argument

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-06-11 11:04:53 +01:00
Sun Yuhan
59d26610ef fix: corrected a logic error in the validateToolContextSupport method caused by incorrect parameter order.
Fixes #GH-3466

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
2025-06-11 06:42:13 +01:00
jasonparallel
c89d4820dd correct @formatter:onn to @formatter:on (#3477)
Signed-off-by: Jason Smith <jasonparallel@gmail.com>
2025-06-10 17:34:47 -04:00
Sun Yuhan
fe4f0d197c fix: MethodToolCallbackProvider#isFunctionalType logic to check functiontype
- Change LHR <-> RHR in the ClassUtils.isAssignable

Auto-cherry-pick to 1.0.x

Fixes #GH-3355

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
2025-06-10 22:16:57 +01:00
Soby Chacko
6451fef547 Add test for embeddingFieldName config in ES VectorStore
Adding test for commit in main 1f5dc3f739

Auto-cherry-pick to 1.0.x

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-06-10 17:04:18 -04:00
Guan Huo
1f5dc3f739 fix: missing 'embeddingFieldName' when configuring ES VectorStore (#3501)
Fixes: #3500

Auto-cherry-pick to 1.0.x

Signed-off-by: Jionghui Zheng <9uanhuo@gmail.com>
2025-06-10 16:38:47 -04:00
SiBo Ai
e9646c269e docs: Fix the incorrect code in the openai-chat.adoc document (#3493)
Auto-cherry-pick to 1.0.x

Signed-off-by: aisibo1 <aisibo1@jd.com>
2025-06-10 18:04:56 +01:00
Sun Yuhan
b925c50f04 fix: Fixed GH-3492, Fixed the SQL error in the isTableExists method of MariaDBSchemaValidator.
Auto-cherry-pick to 1.0.x

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
2025-06-10 17:51:34 +01:00
Eddú Meléndez Gonzales
825bcf6ab0 Make auto-configuration deps optional in docker compose module (#3502)
Currently, spring-ai-spring-boot-docker-compose module brings
auto-configuration modules plus other dependencies which are unnecessary.

Auto-cherry-pick to 1.0.x

Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
2025-06-10 17:34:37 +01:00
WOONBE
8b45f41139 Refactor QdrantObjectFactory to allow null metadata values
Add test for check toObjectMap method allows null metadata values

Signed-off-by: WOONBE <kepull2918@naver.com>
2025-06-10 11:15:53 +01:00
Eddú Meléndez Gonzales
161c437556 Make auto-configuration deps optional in testcontainers module (#3465)
Currently, spring-ai-spring-boot-testcontainers module brings
auto-configuration modules plus other dependencies which are unnecessary.

Auto-cherry-pick to 1.0.x

Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
2025-06-09 07:26:28 +01:00
chainHo
694bb50be5 fix:Typo cloud bindings (#3436)
* fix:Typo cloud bindings doc

Auto-cherry-pick to 1.0.x

Signed-off-by: chainHo <chainhou@gmail.com>
2025-06-06 11:34:02 +01:00
Solomon Hsu
f0d4cbf037 fix(qdrant): support Long type in payload by converting to String
Qdrant does not support java.lang.Long as a native payload type.
Previously, passing a Long value caused the following exception:

  java.lang.IllegalArgumentException: Unsupported Qdrant value type: class java.lang.Long
    at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.value(QdrantValueFactory.java:85)
    at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.lambda$toValueMap$1(QdrantValueFactory.java:46)
    ...

To resolve this, Long values are now converted to their String representation
in QdrantValueFactory. This preserves precision and avoids serialization issues.

test(qdrant): add test to verify Long metadata values are stored as String

Adds a test to ensure that Long values in document metadata are
safely converted to String before being stored in Qdrant.

The test inserts a document with a Long-type "ref_id", performs
a similarity search, and verifies that:
- the result is not empty,
- the retrieved "ref_id" is a String,
- the value matches the original Long when parsed.

Also ensures cleanup by deleting the inserted document from the store.

Auto-cherry-pick to 1.0.x

Signed-off-by: Solomon Hsu <solnone@gmail.com>
2025-06-06 11:17:37 +01:00
Piotr Kubowicz
cecc046c26 build: Use spring-web instead of spring-webflux in spring-ai-retry
The dependency on spring-webflux was unnecessary, there was no code
inside spring-ai-retry that made use of it.

Also remove 'optional' from slf4j-api dependency (it's not optional,
if you don't have it on classpath, RetryUtils will fail to load).

Add explicit dependency on spring-webflux for modules that directly
import WebClient.

Auto-cherry-pick to 1.0.x

Fixes #3307

Signed-off-by: Piotr Kubowicz <piotr.kubowicz@gmail.com>
2025-06-06 10:59:24 +01:00
Ahoo Wang
e45b1b3f8d perf(logging): optimize debug logging in PromptChatMemoryAdvisor (#3448)
- Enclosed debug logging statements within an isDebugEnabled() check
- Reduced unnecessary method calls and object creations when debug logging is disabled

Auto-cherry-pick to 1.0.x

Signed-off-by: Ahoo Wang <ahoowang@qq.com>
2025-06-06 10:19:45 +01:00
jonghoonpark
925def2725 docs: update huggingface doc (#3445)
Auto-cherry-pick to 1.0.x

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
2025-06-05 14:02:19 +01:00
pavan kumar punna
eb69a60df1 feat(openai): for tts and chat completions update supported voices enums (#3411)
* feat(openai): for tts and chat completions update supported voices enums

Fixes: #3411

Auto-cherry-pick to 1.0.x

Signed-off-by: punnapavankumar9 <punnapavankumar9@gmail.com>
2025-06-04 22:02:11 -04:00
lambochen
4621c812cc fix: OpenAiChatOptions support transfer webSearchOptions
Unit test to veriy OpenAiChatOptions.fromOptions.webSearchOptions

Fixes: 3377

Auto-cherry-pick to 1.0.x

Signed-off-by: lambochen <lambochen@yeah.net>
2025-06-04 13:07:56 -04:00
Gerrit Meier
cb97d9c4e2 Neo4j module: Determine default embedding dimension from model.
In cases where no custom size is set, derive the size by the given
embedding model.

Had to migrate the embeddingDimension Spring Boot property from int to Integer
to introduce the null check for the fluent config. Everything else would
have been just noisy.

Auto-cherry-pick to 1.0.x

Fixes #977

Signed-off-by: Gerrit Meier <meistermeier@gmail.com>
2025-06-04 13:16:57 +01:00
Ilayaperumal Gopinathan
5f23dcade3 Fix CI/CD GH Action to trigger for 1.0.x branch
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-06-04 11:30:29 +01:00
Sun Yuhan
da94833983 fix: Fixed the missing properties in the AutoConfiguration of ChromaVectorStore. (#3435)
Auto-cherry-pick to 1.0.x

Signed-off-by: Sun Yuhan <1085481446@qq.com>
2025-06-04 10:29:38 +01:00
SexyProgrammer
8af1d3958f fix: correct ToolDefinition.builder() usage in docs (#3431)
Auto-cherry-pick to 1.0.x

Signed-off-by: SexyProgrammer <49146257+SexyProgrammer@users.noreply.github.com>
2025-06-04 09:59:51 +01:00
jonghoonpark
b070c67336 Changes related to the response format have been added to the document. (#3434)
Fixes: #3354

Auto-cherry-pick to 1.0.x

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
2025-06-03 20:58:40 -04:00
Soby Chacko
a385ed4bd4 CI build for non main branches
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-06-03 17:28:15 -04:00
Jan-Eric Harnack
ab88fea83e chore: move speech1.mp3 to src/test/resources
Fixes: 3433

Auto-cherry-pick to 1.0.x

Signed-off-by: Jan-Eric Harnack <janericharnack@googlemail.com>
2025-06-03 17:21:45 -04:00
Filip Hrisafov
0a1cf81cfc Add support for ApiKey for Anthropic and use it dynamically for every request
Fixes #3365

 - Set ApiKey as late as possible

Auto-cherry-pick to 1.0.x

Signed-off-by: Filip Hrisafov <filip.hrisafov@gmail.com>
2025-06-03 10:55:55 +01:00
Soby Chacko
094eeab405 GH-3415: Add Spring Framework 7.x compatibility to RetryUtils#ResponseErrorHandler
Fixes: #3415

- Remove @Override annotation from handleError(ClientHttpResponse) method
 to support compilation against both Spring 6.2.x and 7.x
- Add delegation from new handleError(URI, HttpMethod, ClientHttpResponse)
 method to maintain backward compatibility
- Preserve existing error handling logic

This change allows Spring AI to work seamlessly across Spring Framework
versions 6.x and 7.x without requiring reflection or version detection at runtime.

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-06-02 20:07:24 -04:00
YunKui Lu
ea995dfa51 docs:Revise the documents of deepseek and minimax-chat (#3408)
Fixes: #3408

Auto-cherry-pick to 1.0.x

Signed-off-by: YunKui Lu <luyunkui95@gmail.com>
2025-06-02 19:37:12 -04:00