Commit Graph

631 Commits

Author SHA1 Message Date
Alexandros Pappas
c33edc7bae Update SpringAI - DeepSeek image (#2135)
Signed-off-by: Alexandros Pappas <alexandros.pappas@yiluhub.com>
2025-01-28 09:18:25 -05:00
Alexandros Pappas
bada403643 Add documentation how to use the OpenAI client to access DeepSeek
Signed-off-by: Alexandros Pappas <alexandros.pappas@yiluhub.com>
2025-01-27 16:45:00 -05:00
Lee Won Jun
8f21c8db2b Update index.adoc 2025-01-27 16:34:53 -05:00
Ilayaperumal Gopinathan
4b64aa0ca6 Refactor Usage handling
- Remove model specific Usage implementations
- Add `Object getNativeUsage()` to Usage interface
  - This will allow the model specific Usage data to be returned
  - At the client side, client needs to cast the return type of `getNativeUsage` into the corresponding Usage returned by the model API
- Rename `generationTokens` to `completionTokens`
  - Since `completion` token name is more common among the models, renaming generation tokens into completion tokens
  - Maintain JSON deserialization compatibility for legacy `generationTokens` field
  - Remove deprecated Long-based constructors to avoid API ambiguity
- Change the prompt, completion and total token return types from Long to Integer
  - This is a breaking change that requires updating all constructor calls
  - Integer is sufficient for token counts and aligns better with most model APIs
- Use DefaultUsage for most of the model specific usage handling
  - When initializing set the native usage to the model specific usage type
  - Ensure immutability by making all fields final and removing setters
  - Add comprehensive test coverage for all functionality including edge cases

Resolves #1407
2025-01-27 16:29:07 -05:00
Eddú Meléndez
840304955e Use TypesenseContainer for Service Connection
Testcontainers 1.20.4 provides a new module for typesense with
TypesenseContainer implementation.

Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
2025-01-27 13:57:22 -05:00
Soby Chacko
f588716b41 Add filter-based deletion and string filter API to VectorStore
Add string-based filter deletion alongside the Filter.Expression-based deletion
for vector stores. This provides a more convenient API for simple filter cases
while maintaining the full flexibility of expression-based filtering.

Key changes:
- Add delete(Filter.Expression) and delete(String) methods to VectorStore
- Add default string filter implementation in VectorStore interface
- Implement filter deletion in Chroma/Elasticsearch/PgVector stores
- Add integration tests for both filter APIs across implementations

This extends vector store deletion capabilities while maintaining consistent
behavior across implementations.
2025-01-24 14:15:46 -05:00
Mark Pollack
7521cab9db Remove deprecated methods/classes from spring-ai-core 2025-01-24 13:37:14 -05:00
Alexandros Pappas
bb6b8cc20f Refactor OpenAIAudio builder methods
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.

Signed-off-by: Alexandros Pappas <alexandros.pappas@yiluhub.com>
2025-01-24 11:47:04 +00:00
Bruno Oliveira
1c41c6a802 Update index.adoc
Signed-off-by: Bruno Oliveira <olivbruno8@gmail.com>
2025-01-20 16:11:04 +00:00
Linar Abzaltdinov
ac8629c5b6 Fix(typo): add missing closing bracket in docs 2025-01-17 16:19:02 +00:00
Alexandros Pappas
7d53ef2056 chore: replace all instances of 'final static' with 'static final' 2025-01-15 15:16:12 +00:00
wellCh4n
cd5684a66e Fix sample code indent 2025-01-15 11:51:23 +00:00
Sébastien Deleuze
34ac31910d Kotlin updates (#2006)
* Update Kotlin documentation

This commit updates the Kotlin documentation to
showcase the new Kotlin reflection capabilities
allowing to identify required properties.

* Update Kotlin integration tests

This commit updates the Kotlin integration tests to
leverage the new Kotlin reflection capabilities
allowing to identify required properties.

It also adds a missing jackson-module-kotlin
dependency and refine test implementation to be
closer to the Java ones and use more idiomatic
Kotlin code.
2024-12-24 11:11:18 -05:00
Mark Pollack
d7fe07b0f1 Next development version 2024-12-23 14:25:21 -05:00
Mark Pollack
ab022fa956 Release version 1.0.0-M5 2024-12-23 14:24:55 -05:00
Mark Pollack
86b155d6ff Update VectorStore docs to use inner builder class
Updated the manual configuration examples in the following docs to show
the correct usage of the inner builder class:

- azure.adoc: Show builder(searchIndexClient, embeddingModel) with all available options
- chroma.adoc: Show builder(chromaApi, embeddingModel) with collection config
- oracle.adoc: Show builder(jdbcTemplate, embeddingModel) with database options

The examples now reflect the current implementation where the builder takes
both the client and embedding model as constructor arguments.
2024-12-21 20:22:59 -05:00
Christian Tzolov
8ad90621c4 docs(mcp) Update the MCP documentation to latewt 0.2.0 release 2024-12-21 19:44:56 +01:00
Soby Chacko
d697e58c05 Update vector store builder examples
Update documentation examples to show correct builder usage across all vector store implementations.
Demonstrate passing required parameters directly in builder() method.
2024-12-21 11:28:39 -05:00
Ilayaperumal Gopinathan
a55d09aa7a Update document for SearchRequest builder changes 2024-12-21 11:18:06 -05:00
Ilayaperumal Gopinathan
2804604933 Refactor SearchRequest builder methods
- Add a new Builder inner class to move all the builder methods and deprecate the existing builder methods
 - Update docs and references
2024-12-20 19:35:17 +00:00
Sylvain Blanc
699a075e1c Update prompt.adoc
Remove `this.` in code example as it's local variables and not fields
2024-12-20 14:33:10 -05:00
Thomas Vitale
c7fd7c729e Refine and document initial Modular RAG
* Introduce CompressionQueryTransformer and RewriteQueryTransformer in the Pre-Retrieval Module.
* Extend Query with conversation history and context.
* Remove QueryRouter sub-module. New design will be considered in the next milestone.
* Update RetrievalAugmentationAdvisor accordingly.
* Add initial documentation for Modular RAG, and establish dedicated page for RAG content.

Fixes gh-1850

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-12-20 13:43:12 -05:00
Thomas Vitale
f2820cd8af Mistral: Support Vision Modality
Introduce multimodality support for Mistral AI, which currently supports text and vision modalities.
Added integration tests and documentation for the new capability.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-12-20 14:41:01 +01:00
Soby Chacko
d4a6e1e619 CosmosDB vector store builder refactoring 2024-12-19 13:40:18 -05:00
Soby Chacko
71584e5238 Add builder pattern to HanaCloudVectorStore and refactor package name 2024-12-19 13:21:29 -05:00
Ilayaperumal Gopinathan
7e4a187f0d Refactor Ollama builder API
The Ollama options builder API has been refactored to follow standard Java
builder pattern conventions. This change deprecates all builder methods
prefixed with 'with' in favor of more concise method names, improving API
consistency and usability.

The deprecated methods are marked for removal in version 1.0.0-M5, giving
users time to migrate to the new builder pattern. This change aligns with
our goal of providing a more intuitive and maintainable API surface.

Breaking Changes:

* builder() method now returns Builder instead of OllamaOptions
* Clients using the old fluent API will need to migrate to the new builder pattern
Refactor Ollama options builder methods
2024-12-18 22:39:42 -05:00
Thomas Vitale
6ab7e20616 Support Ollama JSON Structured Output
Ollama has recently introduced native support for JSON structured output, as described in https://ollama.com/blog/structured-outputs.
This PR introduces support for it, both for directly passing a JSON schema and when using the Spring AI output conversion APIs.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-12-18 11:43:57 +01:00
Alexandros Pappas
eccf33a6ec Refactor WatsonxAiChatOptions builder methods
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update WatsonxAi documentation
2024-12-17 22:00:36 +00:00
Alexandros Pappas
1d38fd11fd Refactor AnthropicChatOptions builder methods
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update AnthropicChatOptions builder documentation
2024-12-17 21:51:10 +00:00
Alexandros Pappas
de29df7c58 Refactor MistralAiChatOptions builder methods
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update MistralAiChatOptions builder documentation
2024-12-17 21:48:10 +00:00
Soby Chacko
48bcbd1555 Add builder pattern to QdrantVectorStore
Introduces a builder pattern for configuring QdrantVectorStore instances to
provide a more flexible and type-safe way to create and configure vector stores.
This change:

- Makes configuration more intuitive through fluent builder methods
- Improves validation by enforcing required parameters at compile time
- Deprecates old constructors in favor of the builder pattern
- Adds comprehensive builder tests to ensure reliability
- Updates reference documentation with builder usage examples
- Maintains backward compatibility while providing a clear migration path

The builder pattern simplifies QdrantVectorStore configuration by providing
clear method names, proper validation, and better IDE support through method
chaining. This makes the API more user-friendly and helps prevent configuration
errors at compile time rather than runtime.
2024-12-17 16:44:08 -05:00
Alexandros Pappas
8c51f7a84c Refactor MoonshotChatOptions builder methods
- Refactor the builder methods to remove `with` as the prefix.
- Introduce new methods with updated naming conventions.
- Deprecate the existing `with*` methods to maintain backward compatibility.
- Update the `copy()` method to use the new builder methods.
- Update MoonshotChatOptions builder documentation
2024-12-17 21:10:24 +00:00
Soby Chacko
8edf1bea47 Add builder pattern to MariaDBVectorStore and refactor package name
Introduces a builder pattern for configuring MariaDBVectorStore instances and
improves the overall implementation. This change:

- Makes configuration more flexible and type-safe through builder methods
- Deprecates old constructors and builder in favor of the new builder pattern
- Adds comprehensive validation of configuration options
- Improves documentation with clear examples and better structure
- Updates all test classes to use the new builder pattern
- Adds comprehensive builder tests
- Updated reference documentation

The builder pattern provides a more maintainable and user-friendly way to
configure vector stores while ensuring configuration validity at compile time.
This aligns with the project's move towards using builder patterns across all
vector store implementations.
2024-12-17 15:56:45 -05:00
Soby Chacko
8877672846 Add builder pattern to TypesenseVectorStore and refactor package name
Introduces a builder pattern for configuring TypesenseVectorStore instances and
moves the implementation to the org.springframework.ai.vectorstore.typesense
package. This change:

- Makes configuration more flexible and type-safe through builder methods
- Improves code organization by moving to a dedicated vector store package
- Deprecates old constructors in favor of the builder pattern
- Adds comprehensive validation of configuration options
- Enhances documentation with clear usage examples
- Adds dedicated builder test class for better test coverage
- Add builder tests
- update reference docs

The builder pattern simplifies TypesenseVectorStore configuration while ensuring
proper validation of all settings. The package move aligns with Spring AI's
architectural patterns and improves maintainability by grouping related classes
together.

review
2024-12-17 15:09:16 -05:00
Ilayaperumal Gopinathan
18bc0cff25 Refactor QianFan model option builder methods
- Deprecate the builder methods with the prefix `with` and add the new methods
 - Update docs and references
2024-12-17 11:51:59 -05:00
Ilayaperumal Gopinathan
071b897951 Refactor Zhipu AI options builder methods
- Deprecate builder methods with the prefix `with`
 - Update docs and references
2024-12-17 11:46:27 -05:00
Ilayaperumal Gopinathan
3e82e3117f Refactor Vertex AI embedding/Gemini options builder methods
- Deprecate the builder methods with the prefix `with`
 - Update references and docs
2024-12-17 11:41:36 -05:00
Ilayaperumal Gopinathan
9748820727 Refactor Stability AI Image options builder methods
- Deprecate builder methods with the prefix `with`
 - Update docs and references
2024-12-17 11:25:01 -05:00
Ilayaperumal Gopinathan
18eb4c3c61 Refactor PostgresML embedding options builder
- Deprecate the builder methods with the prefix `with`
 - Update the docs and references
2024-12-17 11:20:47 -05:00
Ilayaperumal Gopinathan
95c32f05a3 Refactor OCI Gen AI builder methods
- Deprecate the builder methods with the prefix `with`
   - Fix OCI cohere chat model options and OCI Embedding model options
 - Update references and docs
2024-12-17 11:17:24 -05:00
Ilayaperumal Gopinathan
429bd2af35 Refactor Advisor builder methods
- Deprecate the builder methods with the prefix `with`
 - Update references and docs
2024-12-17 11:13:24 -05:00
Ilayaperumal Gopinathan
da45244d99 Refactor Azure model options builder methods
- Deprecate builder methods with the prefix `with` and add them without the prefix
 - Update references and docs
2024-12-17 09:26:24 -05:00
Ilayaperumal Gopinathan
93a7ba4c84 Refactor Minimax model builder methods
- Refactor minimax chat and embedded options builder methods to remove the prefix `with`
 - Update references and docs
2024-12-17 09:18:18 -05:00
Ilayaperumal Gopinathan
65e7a1ddd9 Refactor Spring AI Bedrock options
- Refactor the options builder methods to remove `with` as the suffix
   - Update all the models under spring-ai-bedrock

 - Deprecate the existing methods
 - Update references and docs
2024-12-17 09:11:16 -05:00
Ilayaperumal Gopinathan
58efee6d90 Refactor OpenAI chat options
- Deprecate existing OpenAI chat options
 - Add the options' methods by removing the prefix "with"
   - Update the following options
    - OpenAI chat options
    - OpenAI image options
    - OpenAI moderation options
    - OpenAI embedding options
    - OpenAI audiospeech options
    - OpenAI audio transcription options
 - Update referecens and docs
 - Deprecate 'with' methods in builders
2024-12-17 09:06:06 -05:00
Tyler Russell
c14618fe9a feat(gemini) Support Safety Settings for VertexAiGeminiChatModel
feat(gemini) not null checks on safetySettings

feat(gemini) check safety settings not empty instead of not null

feat(gemini) Add VertexAiGeminiSafetySetting wrapper class

feat(gemini) Update documentation with new property

feat(gemini) Update equals, hashCode, and toString
2024-12-17 13:05:32 +01:00
Soby Chacko
d77c950ea6 Add builder pattern to WeaviateVectorStore and refactor package name
Introduces a builder pattern for configuring WeaviateVectorStore instances and
moves the implementation to the org.springframework.ai.vectorstore.weaviate
package. This change:

- Makes configuration more flexible and type-safe through builder methods
- Improves code organization by moving to a dedicated vector store package
- Deprecates old constructors in favor of the builder pattern
- Adds builder tests
- Enables better IDE support through method chaining
2024-12-16 16:26:59 -05:00
Soby Chacko
25123a5364 Add builder pattern to CassandraVectorStore and refactor package name
Introduces a builder pattern for configuring CassandraVectorStore instances and
moves the implementation to the org.springframework.ai.vectorstore.cassandra
package. This change:

- Makes configuration more flexible and type-safe through builder methods
- Improves code organization by moving to a dedicated vector store package
- Deprecates old constructors in favor of the builder pattern
- Adds comprehensive validation of configuration options
- Enables better IDE support through method chaining
- The builder pattern provides a more maintainable and user-friendly way to
  configure vector stores while ensuring configuration validity at compile time.
2024-12-16 15:38:20 -05:00
Soby Chacko
d3d34c9215 Add builder pattern to OpenSearchVectorStore and refactor package name
Add builder pattern to OpenSearchVectorStore

Introduces a builder pattern for OpenSearchVectorStore configuration and
refactors the package structure to org.springframework.ai.vectorstore.opensearch
for better organization and consistency with other vector stores.

The builder pattern improves usability by:

* Providing a fluent API for configuring store instances
* Making configuration options more discoverable through method names
* Enabling better validation of configuration parameters
* Supporting optional parameters with sensible defaults
* The package refactoring aligns with the project's standard package naming
conventions and improves code organization. All constructors are deprecated
in favor of the new builder pattern to guide users toward the preferred
configuration approach.
2024-12-15 13:09:15 -05:00
Soby Chacko
f69d879ec9 Add builder pattern to RedisVectorStore and refactor package name
Refactors RedisVectorStore to use the builder pattern for improved
configuration and usability. The changes include:

* Move classes to org.springframework.ai.vectorstore.redis package
* Add RedisBuilder with comprehensive configuration options
* Deprecate RedisVectorStoreConfig in favor of builder pattern
* Enhance documentation with detailed usage examples
* Improve error handling and parameter validation

This change makes RedisVectorStore configuration more intuitive and
consistent with other vector stores in the project.
2024-12-14 18:40:41 -05:00