Commit Graph

27 Commits

Author SHA1 Message Date
Mark Pollack
67a8896422 Next development version 2024-11-20 18:03:30 -05:00
Mark Pollack
33c05c399c Release version 1.0.0-M4 2024-11-20 18:02:47 -05:00
Christian Tzolov
018257a605 fix: Resolve javadoc and maven confiuration issues 2024-11-16 12:43:27 +01:00
Ilayaperumal Gopinathan
72c84fe8b8 Remove deprecated code from 1.0 M2 and before
- Remove deprecated types,methods and references
 - Remove usage of "Generation(String text)" and replace with
  "Generation(AssistantMessage)"
 - Remove MiniMaxApi,MootShotApi,OpenAiApi,ZhiPuAiApi
   ChatCompletionFinishReason's FUNCTION_CALL
 - Remove OllamaApi's deprecated types
 - Remove deprecated constructors from PostgresMlEmbeddingModel
 - Remove deprecated constructor from Media
 - Remove tokenNames usage from antlr4 FiltersLexer and FiltersParser
 - Remove deprecated methods from CassandraVectorStoreProperties
 - Remove deprecated constructor and static config class from QdrantVectorStore
 - Minor cleanups on removing deprecated models and versions
 - Remove old name for mixtral models

Resolves #1599
2024-11-15 14:28:21 -05:00
Mark Pollack
a98af02f62 Minimize time to run main CI build action
- Add maven properties for all vector stores such as
skip.vectorstore.azure-cosmos-db to control IT test execution
- Chroma and PGVector IT tests are enabled by default
- Docker Compose and Testcontainers module ITs are skipped by default
- Add parallel job to run docker-compose and testcontainers ITs
2024-11-11 16:19:08 -05:00
Soby Chacko
66f58d2d70 Change default build setting to disable Checkstyle enforcement
- Disable project-wide Checkstyle checks to unblock development
- Add documentation for enabling Checkstyle locally
- Fix remaining checkstyle violations in current codebase

Fixes #1669
2024-11-05 10:43:38 -05:00
Soby Chacko
e72ab6ba25 Addressing more checkstyle violations
- Enable checkstyle on more modules and adressing violations
review
2024-10-31 01:04:41 -04:00
Sébastien Deleuze
081840eef2 Skip tests requiring OpenAI API key
Adds @EnabledIfEnvironmentVariable annotation to integration tests that
use OpenAI embeddings. Tests will be skipped if OPENAI_API_KEY is not set,
making the build process more reliable for contributors who don't have
access to OpenAI services.
2024-10-29 12:15:44 -04:00
Soby Chacko
8e758dbd00 Introduce checkstyle plugin
- Based on https://github.com/spring-io/spring-javaformat
- In this iteration, checkstyles are only enabled for spring-ai-core
2024-10-24 16:43:59 -04:00
Christian Tzolov
278a61fde4 Fix doc ref links 2024-10-21 10:24:28 +02:00
Mark Pollack
4c83fe8302 Guard against NPE in ZhiPu embedding model
- Update retry test to pass - needs investigation
2024-10-08 23:37:00 +02:00
Mark Pollack
4a892b5269 Release version 1.0.0-M3 2024-10-08 23:18:50 +02:00
Thomas Vitale
012f07c97b Optimize Testcontainers config for VectorStores
* Unify image definition for vector stores in vector-store modules

* Unify image definition for vector stores in spring-ai-testcontainers module

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-10-06 19:18:05 +02:00
Thomas Vitale
50e11e3f46 Improve optional values handling in vector store observations
Vector store observations support several key-value pairs, coming from the Spring AI abstractions. Currently, whenever a value is not available (either because not configured by the user or not supported by the vector store provider), span/metrics attributes are generated anyway with value none.

That causes several issues, including an unneeded increase in time series, challenges in alerting/monitoring (especially for integer/double attributes that suddenly are populated with a string), and non-compliance with the OpenTelemetry Semantic Conventions (according to which, attributes should be excluded altogether if there's no value).

This pull request changes the conventions for vector store observations to exclude the generation of span/metrics attributes for optional values which don't have any value.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-10-06 15:36:18 +02:00
Soby Chacko
15fdd05fac Add batching for more vector stores
Apply batching when adding Documents to the following vector stores:

- Chroma
- ElasticSearch
- Neo4j
- Qdrant
- Redis
- Typesense
- Weaviate

This improves efficiency by processing multiple Documents at once instead of individually, reducing the overhead for each operation.

Related to #1261
2024-09-09 15:28:22 -04:00
Mark Pollack
e1884d1d92 Next development version 2024-08-23 18:47:37 -04:00
Mark Pollack
43ad2bdb97 Release version 1.0.0-M2 2024-08-23 18:46:58 -04:00
Thomas Vitale
036093a42b Enhance vector store observability support
* Consolidate usage of “db.collection.name” attribute to track table name, collection name, index name, document name, or whatever concept a vector database uses to store data. Removed “db.index” that was use sometimes instead of “db.collection.name”. This usage is in line with the OpenTelemetry Semantic Conventions.
* Configure query response content to be included as a “span event” instead of a “span attribute” if the backend system supports that, similar to how we do for the model observations.
* Structure vector store observation attributes in dedicated enums, including one for the Spring AI Kinds to avoid hard-coding the same value in a lot of places. This follows the OpenTelemetry Semantic Conventions as much as possible. Also, adopt Spring usual non-null-by-default strategy as much as possible.
* Align vector store conventions to the chat model ones, and follow alphabetical order for values. This is particularly useful for the convention classes, for which the Micrometer performance of exporting telemetry data improves when key values are added already sorted to the context.
* Fix flaky test in Mistral AI.
* Improve Qdrant integration tests.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-08-22 09:38:59 +02:00
Christian Tzolov
93fa2bf45a Add observability support to existing vector stores
Add observability support to:
 - Cassandra
 - Chroma
 - Elasticsearch
 - Milvus
 - Neo4j
 - OpenSearch
 - Qdrant
 - Redis
 - Typesense
 - Weaviate
 - Pinecone
 - Oracle
 - Gemifire
 - MongoDB
 - HanaDB

 Add autoconfiguration obsrvability for the above vector stores.
 Add integration tests for all vector stores.
2024-08-20 01:37:45 -04:00
Christian Tzolov
d538e00643 Replace the Embedding format from List<Double> to float[]
- Adjust all affected classes including the Document.
 - Update docs.

Related to #405
2024-08-13 11:53:08 -04:00
Eddú Meléndez
5844f9bf39 Polish Qdrant tests
Use helper methods provided by Testcontainers.
2024-06-20 07:16:03 +02:00
Mark Pollack
ac91302eed Next development version 2024-05-28 13:53:04 -04:00
Mark Pollack
0670575f3e Release version 1.0.0-M1 2024-05-28 13:49:11 -04:00
Josh Long
2d43e40024 Add property to initialize schema for vector stores
* Default is fale
* Update docs
2024-05-26 00:31:19 -04:00
skewgod
593e5fd747 docs(qdrant): added additional info to setup api key for qdrant (#736) 2024-05-24 11:36:26 -04:00
Josh Long
fbfc87e814 Refactoring of ChatClient to add fluent API and introduce Model as dependent object
* Rename the ModelClient class hierarchy into Model:
  - Rename ModelClient into Model. Update all code and doc references.
  - Rename ChatClient to ChatModel. Update all ChatClient suffixes and chatClient fields and variables in code and doc.
  - Rename EmbeddingClient into EmbeddingModel. Update the XxxEmbeddingClient class and variable suffixes and embeddingClient variables and fields in code and docs.
  - Rename ImageClient into ImageModel.
  - Rename SpeechClient into SpeechModel.
  - Rename TranscriptionClient into TranscriptionModel.
  - Update all javadocs and antora pages. Update the related diagrams.

* Create fluent API in ChatClient interface that now includes streaming support
* Add OpenAI FunctionCallbackWrapper2IT auto-config tests.
* Add ChatClientTest mockito testing.
* Add ChatModel#getDefaultOptions(), and remove @FunctionalInterface

* ChatModel enums extend the new ModelDescription interface.
* Implement fromOptions copy method in every ChatOptions implementation.
* Extend ChatClient to use the model default options if not provided explicitly.

* Update readme to provide guidance on how to adapt to breaking changes.

Co-authored-by: Christian Tzolov <ctzolov@vmware.com>
Co-authored-by: Mark Pollack <mpollack@vmware.com>
2024-05-22 16:07:12 -04:00
Christian Tzolov
3475f17e98 Unify the vector store module and pom names
spring-ai-qdrant -> spring-ai-qdrant-store
 spring-ai-cassandra -> spring-ai-cassandra-store
 spring-ai-pinecone -> spring-ai-pinecone-store
 spring-ai-redis -> spring-ai-redis-store
 spring-ai-qdrant -> spring-ai-qdrant-store
 spring-ai-gemfire -> spring-ai-gemfire-store
 spring-ai-azure-vector-store-spring-boot-starter -> spring-ai-azure-store-spring-boot-starter
 spring-ai-redis-spring-boot-starter -> spring-ai-redis-store-spring-boot-starter
2024-05-17 17:05:09 +02:00