Commit Graph

22 Commits

Author SHA1 Message Date
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
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
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
b35c71061e Remove VectorStoreRetriever interface and retriever package 2024-01-11 10:52:28 -05:00
Mark Pollack
a48a6d9611 Change package name for PostgresML and Transformers
Fixes #133
2024-01-11 10:11:53 -05:00
Omkar Shetkar
0b87df07e5 Fix Bedrock chat model enum names consistency
- doc update
 - fix code formatting

 Resolves #231
2024-01-09 12:36:17 +01:00
Christian Tzolov
2f89124350 minor README fix 2024-01-09 10:10:39 +01:00
Mark Pollack
99d391b10e Add more documentation for ChatClient implementations
* OpenAI
* Azure OpenAI
* Bedrock
* Bedrock Anthropic Claude
* Bedrock Meta Llama2
* Ollama
2024-01-07 15:51:29 -05:00
Christian Tzolov
0ccf327806 Refactor Azure OpenAi
- Clean the AzureOpenAiChatClient and add support  for StreamingChatClient.
 - Streamline the AzureOpenAiEmbeddingClient.
 - Move the AzureOpenAiChatClient and AzureOpenAiEmbeddingClient to top org.sf.ai.azure.opoenai package.
 - Add ITs for AzureOpenAiChatClient and AzureOpenAiEmbeddingClient
 - Fix the AzureOpenAiAutoConfiguration
   - Split property file into AzureOpienAiConnectionProperties, AzureOpenAiChatProperties
     and AzureOpenAiEmbeddingProperties.
   - Add ITs for the auto-configuration
 - Add improve package structure
 - Add README docs
 - fix failing test
 - update to use Azure Deployment for CI
2024-01-02 12:18:20 -05:00
Christian Tzolov
c8de949123 update azure-openai do beta6 and resolve the compatibility issues 2023-12-22 11:55:38 +01:00
Christian Tzolov
aebfd719a7 Remove the obsolate okhttp and the related interceptor
The OpenAiApi, returns the HTTP headers that can be intropsect for metadata
 with the help of OpenAiResponseHeaderExtractor.
 No need for http interception nor for joining by ID.
2023-12-22 08:49:20 +01:00
Christian Tzolov
6cec33b4bd update the ollama chat api diagram 2023-12-21 15:41:03 +01:00
Christian Tzolov
98281ad1ef Rename AiClient/AiStreamingClient name prefixes to ChatClient/StreamingClient
- fix all class names with AiClient or AiStreamingClient name prefixes.
  - fix all variables or method name prefixes.
  - fix the javadocs, readmes and refference documentation.
2023-12-21 14:54:14 +01:00
Christian Tzolov
b49e84f5e2 fix javadoc issue 2023-12-21 14:22:48 +01:00
Christian Tzolov
8d112e30d8 Add flexible Ollama Options handling
Add OllamOptions that can be used as a builder (withX) and spring propererites (e.g. getX/setX).
 - prvides strongly typed properties.
 - the 'OllamaOptsion#toMap()' converts the options into Map<String, Object>.
 - Add OllamaEmbeddingAutoConfiguraiton#options property of type OllamaOptions.
 - Add OllamaChatAutoConfiguraiton#options property of type OllamaOptions.
 - Factor out the baseUrl property into a standalone OllamConnectionProperties shared
   between the Chat and Embedding autoconfigurations.
 - Fix affected unit/IT tests.
2023-12-21 13:46:11 +01:00
Omkar Shetkar
dd64a50d2f Merge SimplePersistentVectorStore and InMemoryVector store to be SimpleVectorStore
- Doc updates

Fixes  #146
2023-12-20 15:48:34 -05:00
Christian Tzolov
9ab857a8ab Add full support for Ollama AI models
- Implement a native client (OllamaApi) to leverage chat/streaming and embedding endpoints.
 - Add a OllamaChatClient implementing the ChatClinet and StreamingChatClinet interfaces.
 - Add a OllamaEmbedding clinent that impl. the EmbeddingClinet interface.
 - Add AutoConfiguraitons with properties for the chat and the embedding clients.
 - Add unit and ITs for the OllamaApi, OllamaChatClient, OllamaEmbeddingClient, and related auto-configuraitons.
 - Remove the old ollama impl. classes and tests.
 - minor fixes to the bedrok test methods names.
2023-12-20 14:11:17 -05:00
Mark Pollack
1a8fcac206 fix failing tests due to directory structure changes 2023-12-19 12:46:43 -05:00
Mark Pollack
82fe510b39 Moved Maven modules from top level directory and embedding-clients subdirectory to all be under a single models directory.
Rename artifact ID of

* `transformers-embedding` to `spring-ai-transformers`
2023-12-19 12:22:02 -05:00