Commit Graph

1453 Commits

Author SHA1 Message Date
Christian Tzolov
5add8f0b68 Rename ChatClient#ChatClientBuilder#defaultFunctionWrappers() to defaultFunction()
This change aligns the method name with the ChatClientRequest#function(...) syntax,
  improving code readability and consistency.
2024-05-23 07:19:25 +02: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
Dimitrios Begnis
bce45c2d2f Use <> for inequality operator in Neo4j filter expression implementation 2024-05-21 17:17:32 -04:00
GR
8389913999 Implemented the doChatCompletionStream in ZhiPuAiChatClient 2024-05-21 17:11:35 -04:00
devholic22
a46e014413 Add comments and prevent IndexOutOfBounds in ImageResponse
* Add comments in ImageResponse like ChatResponse
* Prevent IndexOutOfBounds in getResult function
* Update toString for formatting like ChatResponse
2024-05-21 17:07:24 -04:00
Christian Tzolov
ef5a3fa9fa MiniMax model improvements
* Fix javadoc issue. Remove wildcard imports
* In MiniMaxChatClient, remove unused method, unused fromMedia method, dedicated exception and rename inappropriate method.
2024-05-21 09:06:31 -04:00
Christian Tzolov
2abf10dbf9 Fix javadoc issue. Remove wildcard imports 2024-05-21 09:49:57 +02:00
Craig Walls
83c997d18e Add spring-ai-retry dependency to Ollama model pom.xml 2024-05-21 09:05:27 +02:00
GR
99c3857788 Add Support for ZhiPu AI model
* See https://www.zhipuai.cn/
2024-05-20 20:20:29 -04:00
GR
6b674014ed Add support for the MiniMax Model
* See https://minimaxi.com/
2024-05-20 15:08:20 -04:00
Ashif Ismail
6f4ab64f92 Update README.md
fixed typo :)
2024-05-19 11:49:14 +02:00
Pablo Sanchidrian
e8f663d0c8 Fix: watsonx.ai | refresh token issue and implement retry mechanism (#735)
* fix: refresh token only when needed and apply retry policy

* fix: remove unused import
2024-05-19 11:48:09 +02:00
Christian Tzolov
09e122de5e Add Mistral AI tool_call_id to ChatCompletionMessage.
The tool call ID that this message is responding to, applicable for the TOOL role.
2024-05-18 06:07:12 +02:00
Christian Tzolov
275189970d BeanOutputConverter: fix javadoc 2024-05-18 06:05:50 +02:00
Christian Tzolov
517df45cd8 Merge ParametrizedTypeReferenceBeanOutputConverter into BeanOutputConverter
Add ParametrizedTypeReference constructoers along the Clas<T> such.
  Convert the Class into ParametrizedTypeReference internally.
  Update tests and docs.
2024-05-18 04:50:20 +02:00
Christian Tzolov
d026614316 Update README.md
Breaking changes
2024-05-17 17:31:48 +02: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
Christian Tzolov
1985824fa9 clean code imports 2024-05-17 15:32:46 +02:00
Christian Tzolov
3ee04ed8da fix code style and missing dependency renaming 2024-05-17 15:31:58 +02:00
Josh Long
04d854cc49 make project names consistent 2024-05-17 15:31:58 +02:00
Josh Long
c5b7dd9c46 i ran the spring javaformat maven plugin to clean up any source code incompatabilities. 2024-05-17 15:31:57 +02:00
Josh Long
8c758617f3 moving to ApplicationListener<ApplicationReadyEvent> to avoid slowing down the application on startup. 2024-05-17 15:31:53 +02:00
Christian Tzolov
654e22be9d Add TypeReference StructuredOutputConverter
A ParameterizedTypeReference alternative of BeanOutputConverter that can cover list of beans as well.
  Based on suggestion: https://twitter.com/kisco_/status/1788862522998546440
2024-05-17 15:28:20 +02:00
Christian Tzolov
14d620e2ca minor doc fix 2024-05-17 06:47:43 +02:00
Christian Tzolov
7887159e68 Improve Gemini antora documentation and fix broken links 2024-05-17 06:43:47 +02:00
Christian Tzolov
1b1daa7ee7 Add GEMINI_PRO_1_5_PRO and GEMINI_PRO_1_5_FLASH and update geminie maven BOM to 26.39.0
Also fix few Ollama docs and  code formatting issue.
2024-05-16 15:36:14 +02:00
Mark Pollack
549c480489 Refactoring
* Put creation of EvaluationRequest in ChatServiceResponse
* Add string constructor to QuestionContextAugmentor
* change vectorStore accept() usage to write()
2024-05-16 14:01:51 +02:00
Mark Pollack
fd9c98661d API refactoring
* Added more natural method names to DocumentReader, Transformer, Writer
* Changed Content getMedia to return Collection, deprecated use of List
* Change constructor for Media to accept URL and Resource, deprecate Object constructor
* Update ETL documentation and a few tests to avoid now deprecated APIs.
2024-05-16 12:53:13 +02:00
Christian Tzolov
227f0703ec Fix: function calling not able to resolve input types
Resolves #726
2024-05-16 09:41:09 +02:00
Christian Tzolov
82f473f2bc resolve javadoc reference issue 2024-05-15 16:59:18 +02:00
Mark Pollack
867154c082 Changed ChatBot to ChatService with other related name changes
* PromptContext -> ChatServiceContext
* Added PromptChange to ChatServiceContext to capture PromptTransformer changes
* DefaultChatBot -> PromptTransformingChatService
* DefaultStreamingChatBot -> StreamingPromptTransformingChatService
* package name changes, chatbot->service and history->memory
* Added fluent builders to a few PromptTransformer implementations
* Add license headers
2024-05-15 14:01:48 +02:00
Eddú Meléndez
d610dd6f1d Add default collection name to Qdrant
Add a default collection name similar to other vector store
implementations. Currently, when using starters, qdrant requires
a collection name. Otherwise, it fails.
2024-05-15 12:02:05 +02:00
Mark Pollack
368f7bdfba Remove filter on external knowledge.
* Update question so that evaulator passes

fix formatting
2024-05-15 10:13:02 +02:00
Lorenzo Caenazzo
a7eb28ac17 Add real Function Calling Streaming support
- Add Java reflection merge utilities that can access  Azure private constructors and fields.
 - Azure merging, creation of flux windows.
 - Function call grouping for function processing.
 - Do not perform greedy operation on Flux.
 - Use "real" streaming on all client on function response.
 - Gerimi: fix missing method impl.
 - Mistral AI, OpenAI: fix missing stream flag in doCreateToolResponseRequest.
 - Fix code formatting. No wildcard imports.
 - Add Grogdunn to the javadoc authors.
 - Anthropic 3 API does not support streaming funciton calling yet.
2024-05-15 09:43:36 +02:00
Christian Tzolov
b0799babf4 Update Qdrant client version from 1.7.1 to 1.9.1
- Also update the qdrant/qdrant docker image version from v1.7.4 to v1.9.2
2024-05-15 06:19:46 +02:00
Christian Tzolov
db4f0b0aaf Add GPT-4o ITs and documentation updates 2024-05-14 21:12:39 +02:00
Thomas Vitale
b3cfa2b900 OpenAI: Add gpt-4o to chat model enum
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-05-14 20:50:56 +02:00
Eddú Meléndez
d7dad6ef61 Add GH workflow to check source code format on PRs 2024-05-11 16:14:40 +02:00
Eddú Meléndez
cdb80e83e9 Fix ChromaDB basic authentication
Currently, `username` is added as a password in `BasicAuthenticationInterceptor`.
This commit fixes the issue and also make sure the integration test
setup is correct.
2024-05-11 14:51:28 +02:00
Christian Tzolov
93bd5021a1 Improve Azure OpenAI options merging logic 2024-05-11 13:22:35 +03:00
wmz7year
220ec7f631 AWS Bedrock Titan embedding model add amazon.titan-embed-text-v2:0 support. 2024-05-10 14:26:25 +02:00
mck
cae045d52b Add the autoconfigure property for the CassandraVectorStore option to return embeddings in documents from similarity searches
ref: https://github.com/spring-projects/spring-ai/pull/673
2024-05-10 14:24:45 +02:00
Eddú Meléndez
5beef21a4e Expose QdrantClient and WeaviateClient as beans
Currently, `QdrantClient` and `WeaviateClient` are not exposed as
  beans. Having access to those would benefit to perform operations
  with an already configured client.

  - Deprecate  QdrantVectorStoreConfig.
  - Update Qdrant manual config adoc.
  - Improve Qdrant adoc.
  - Update Weaviate docs.
2024-05-10 15:15:14 +03:00
wmz7year
25f91c3297 Add AWS Bedrock Amazon Titan Text Premier model support 2024-05-10 10:54:10 +02:00
wmz7year
3497a1ec7b Fix Bedrock Cohere embedding truncate type types
- fix compilation errors and javadoc
2024-05-10 11:49:20 +03:00
Christian Tzolov
f955fd7277 Fix code style and javadoc
- update spring boot to 3.2.5.
 - fix Content's JavaDoc.
 - remove wildcard java imports.
2024-05-09 15:54:19 +03:00
Christian Tzolov
11450601ad Disable MondoDB IT due to #698 2024-05-09 14:33:17 +03:00
Christian Tzolov
6154fa663f Disable MondoDB IT due to #698 2024-05-09 13:27:57 +03:00
Mark Pollack
b774a9549d Remove assertion that depends on unreliable response from AI Model 2024-05-08 15:46:17 -04:00
Mark Pollack
ad527303ed Rename Agent classes to use ChatBot 2024-05-08 15:43:00 -04:00