Commit Graph

1453 Commits

Author SHA1 Message Date
Christian Tzolov
0a930d2ab5 fix broken docs and compilation issues 2024-02-03 15:25:18 +01:00
Christian Tzolov
97537e0a10 Improve Ollama Options support
- Rename OllamaChatClient#withOptions(...) method to OllamaChatClient#withDefaultOptions(...)
 - Rename OllamaEmbeddingClient#withOptions(...) method to OllamaEmbeddingClient#withDefaultOptions(...)
 - Remove the  Chat/Embedding Client model field by defaultOptions.mode one.
 - Correct default and runtime OllamaOptions merging implemented.
 - Added support for portable ChatOptions.
 - OllamaOptions a synthetic field ‘model’ not supported by Ollama API but used by the OllamaChatClient
   and OllamaEbeddingClients. The model field is removed before calling the OllamaApi.
 - Update the IT ollama docker image to 0.1.23
 - Set Mistral as the default model.
 - Extend and improve the ITs
 - Add tests for testing the chat and embedding request creation and options merging logic.
 - Minor code-style improvements.
 - Split the ollama.adoc into embeddings/ollama-embeddings.addoc and clients/ollama-chat.adoc.
 - Improve the documentation to explain how to configure and use the Ollama Chat and Embedding clients manually or with the help of the auto-configuraitons.
 - Clarify the docs property sections.
2024-02-03 14:58:03 +01:00
Christian Tzolov
60a60b4610 Fix handling for openai chat portable options
- Now you can use an arbitrary ChatOption instance as Prompt options for the OpenAIChatClinet.
 - Add Unit tests for OpenAiApi and ModelOptionsUtils.
 - Document portable options support.
2024-02-02 15:34:56 +01:00
Christian Tzolov
d71f90fd56 add OpenAiApi tests 2024-02-01 19:13:57 +01:00
Christian Tzolov
b49458b3ee Improve OpenAiImage/Client implementation
- Impove the code style.
 - Merge the OpenAiImageOptions interface impl and builder into one class.
 - Improve the OpenAiImageClient call implementation.

 Resolves #274
2024-02-01 14:54:34 +01:00
Christian Tzolov
9b79359544 Add openai model retry error listener logging 2024-02-01 11:34:33 +01:00
Christian Tzolov
0abf1528dd Fix for Redis NPE when using FilterExpression #265
- Part of #265
2024-01-31 11:17:29 +01:00
Christian Tzolov
6043edacf8 fix docs generation error 2024-01-30 21:46:24 +01:00
Christian Tzolov
6be6b589cb Add a dedicated doc page for openai chat client 2024-01-30 21:32:34 +01:00
Christian Tzolov
86327f4a32 Add a dedicated openai-embedding.adoc page 2024-01-30 17:44:59 +01:00
Christian Tzolov
5b4784fc56 Add OpenAi Chat Options
Add OpenAiChatOptions

 - OpenAiChatOptions implements ChatOptions and exposes all OpenAi request options, except messages and stream.
 - Add OpenAiChatOptions field (as defaultOptions) to OpenAiChatClient. Implement star-up/runtime options merging on chat request creation
 - Add OpenAiChatOptions options field to OpenAiChatProperties. Later is set as OpenAiChatClient#defaultOptions. Use the spring.ai.openai.chat.options.* prefix to set the options.
 - Add tests for properties and options merging.
 - Move the OpenAiChatOptions.java out of the api package

Add OpenAiEmbeddingOptions

 - Add OpenAiEmbeddingOptions class implementing the EmbeddingOptions interface.
 - Add OpenAiEmbeddingClient#defaultOptions
 - Add request merging with default and propmt options.
 - Add OopenAiEmbeddingProperties#options field of type OpenAiEmbeddingOptions

Update OpenAI client docs

Part of the larger 'epic' issue #228
2024-01-29 13:48:12 -05:00
Christian Tzolov
7c7392e657 Change EmbeddingOptions from class into interface 2024-01-28 19:10:17 +01:00
Christian Tzolov
da12b56dc7 Update openai.adoc
fix the streaming snippet method signature
2024-01-28 16:56:22 +01:00
EnggAdda
9381ab609f Update openai.adoc
i don't see any generate(message) method in ChatClient interface in  package org.springframework.ai.chat;
2024-01-28 14:25:01 +01:00
Christian Tzolov
4ec78f8d34 Imptove redis VD docs 2024-01-26 18:47:34 +01:00
Christian Tzolov
8f9a1475c1 Re-align the grpc dependecies and exclusions so that Milvus and Pinecone autoconfigurations ITs work 2024-01-26 18:32:55 +01:00
Christian Tzolov
08fea315a4 Update the production depedencies 2024-01-26 17:31:29 +01:00
Christian Tzolov
836c4fd88f fix bean parser and tests 2024-01-26 16:45:03 +01:00
Christian Tzolov
944c4ebbaa Fix Ollama client options NPE and lack for SYS message handling
- Fix the Ollama options merging to pervent NPE.
 - Fix the Ollama handling for SYS messages.
 - Fix the BeanOutputParser to support JSON Schema reponses.
 - All Ollama Parsers tests pass now.

 Resolves: #258 ,  #273
2024-01-26 15:29:09 +01:00
Christian Tzolov
aa8c3856ed Fix Chroma API 0.4.22+ compatiblity issues
- Makes upsert a void metod.
 - Fix affected test.
 - Replac getEmebedding with complex filters test by query Embedding.

 Resolves #224
2024-01-26 12:05:25 +01:00
Christian Tzolov
eb42912efd Move OpenAiImageOptionsXXX classes outside the 'api' packages as those are client not api related 2024-01-26 10:48:36 +01:00
FormatToday
c1d3034569 add AssistantPromptTemplate override method createMessage()
Signed-off-by: ZhangQin <dev@zhangqin56.cn>
2024-01-25 17:10:19 -05:00
rai-sandeep
a786784982 Fix typo in Azure OpenAI documentation (#237)
Closes https://github.com/spring-projects/spring-ai/issues/236
2024-01-25 16:55:03 -05:00
utkarsh
5718f9683d Added PostgresMlAutoConfiguration (#242)
Fixes issue #242
2024-01-25 16:52:42 -05:00
Christian Tzolov
5e38536b6c Rename streamingCall into stream 2024-01-25 16:36:29 -05:00
Christian Tzolov
4217a54c31 Make the StreamingChatClient a StreamingModelClient 2024-01-25 16:35:58 -05:00
Christian Tzolov
5d55b68380 Align the Embedding api with the new meta-model
- Craete new EmbeddingOptions -> ModelOptions, EmbeddigRequest -> ModelRequest, EmbeddingResponseMetadata -> ResponseMetadata and EmbeddignResultMetadata -> ResultMetadata.
 - Make the EmbeddigClient interface extend from ModelClient<EmbeddingRequest, EmbeddingResponse>, EmbeddingResponse implements ModelResponise and Embedding implements ModelResult.
 - Fix affected tests.
 - Steramline the EmbeddingClient interface with default method implementations based on call.
 - Merge EmbeddingUtil into AbstractEmbeddingClient
2024-01-25 16:33:37 -05:00
Thomas Vitale
85ed261c08 Include metadata for nested config props in Ollama (#247)
Fixes gh-246

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-01-25 09:17:50 -05:00
Ikko Eltociear Ashimine
2c2cb9d2d8 Update output-parser.adoc (#250)
ouput -> output
2024-01-25 09:14:13 -05:00
Choi ByungHyeon
39bd735eda Fix a typo in openai.adoc (#252) 2024-01-25 09:13:36 -05:00
Toshiaki Maki
0cf0ed9e00 Use ObjectMapper with FAIL_ON_UNKNOWN_PROPERTIES false during error handling (#253) 2024-01-25 09:02:39 -05:00
jingzhou
08f52301b1 Update concepts.adoc: add Google Gemini (#254) 2024-01-25 09:00:29 -05:00
Yao Yuan
21889ccfc0 Rename AiReponse to ChatResponse in Documents (#255) 2024-01-25 08:59:00 -05:00
Mark Pollack
c745a6518f update readme with recent breaking changes 2024-01-24 16:06:56 -05:00
Mark Pollack
593d7f23df Fix TextToImage integration tests
* Create StyleEnum for StabilityAI prompt options.
* Add copyright header and javadoc to StabilityAI classes
2024-01-24 15:55:46 -05:00
Christian Tzolov
c5bca45007 Fix failing IT test 2024-01-24 21:33:55 +01:00
Mark Pollack
243cef976c Abstract API for AI model clients
* An abstract API for AI model clients
 * Providing portable client request options while still allowing vendor specific options when required.  Implemented only for StabilityAI/OpenAI ImageClient
 * Support for text->image for openai and stabilityai.

  Partial fix for #27 :  Text To Image and Fixes #266 and Fixes #261
2024-01-24 19:53:33 +01:00
Christian Tzolov
08fa0e393c Prevent OpenAi retry on http client errors such as rate-limit or wrong authentication 2024-01-14 23:04:17 +01:00
Christian Tzolov
abbd911f69 fix test 2024-01-14 20:46:50 +01:00
Christian Tzolov
7262afb14d Capitalize the enumeration names
Resolves #208
2024-01-14 20:36:14 +01:00
Christian Tzolov
025d6af033 Clarification about the OpenAI chat model versioning 2024-01-14 11:57:45 +01:00
Mark Heckler
c517fc059a Documentation fixes, clean and polish 2024-01-14 11:27:20 +01:00
Christian Tzolov
8fa0af553c Clarify the OpenAi properties
Add dedicated property classes for the Chat and the Embedding models and use a common connection properties for both:
  - OpenAiConnectionProperties (baseUrl, apiKey) with prefix spring.ai.openai.*.
  - OpenAiChatProperties (model, temperature) with prefix spring.ai.openai.chat.
  - OpenAiEmbeddingProperties (model) with prefix spring.ai.openai.embedding.*
 Additionally the OpenAiChatProperties and OpenAiEmbeddingProperties can optionally override the OpenAiConnectionProperties
 so that we can use the Chat model from one Provider and the Embedding model from another.

 Resolves #229
2024-01-13 22:41:24 +01:00
Christian Tzolov
7b38cc3a88 Improve pdf paragraph constrains
The ParagraphPdfDocumentReader relies on a PDF object called 'outline' (e.g. TOC) to be present in the document.
If the pdf was not generated with TOC, the other options in Spring AI are PagePdfDocumentReader and TikaDocumentReader.

 Resolves #59
2024-01-13 12:16:14 +01:00
Mark Pollack
408d75e0d4 Ollama and Titan Embedding Client makes individual calls to embed Document collection
Fixes #218
2024-01-11 12:15:52 -05:00
Mark Pollack
85e3e0015e Remove client and embedding from package name for ChatClient and EmbeddingClient implementations
Moved up one package level the following classes
* org.springframework.ai.huggingface.client.HuggingfaceChatClient
* org.springframework.ai.openai.client.OpenAiChatClient and org.springframework.ai.openai.embedding.OpenAiEmbeddingClient
* org.springframework.ai.vertex.generation.VertexAiChatClient and org.springframework.ai.vertex.embedding.VertexAiEmbeddingClient

Fixes #211
2024-01-11 12:00:36 -05:00
Mark Pollack
1b76cf6da0 Renaming of Autoconfiguration classes
- The HuggingfaceAutoConfiguration renamed HuggingfaceChatAutoConfiguration
- Merge OllamaChatAutoConfiguration and OllamaEmbeddingAutoConfiguration into OllamaAutoConfiguration

Fixes #210
2024-01-11 11:52:22 -05:00
Mark Pollack
b35c71061e Remove VectorStoreRetriever interface and retriever package 2024-01-11 10:52:28 -05:00
Mark Pollack
4dc92f0cb7 Move FormatProvider from the package prompt to parser
Fixes #147
2024-01-11 10:19:38 -05:00
Mark Pollack
a48a6d9611 Change package name for PostgresML and Transformers
Fixes #133
2024-01-11 10:11:53 -05:00