Commit Graph

78 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
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
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
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
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
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
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
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
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
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
dfe4107cca Add some ChatClient impl docs to the TOC 2024-01-10 17:29:10 -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
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
mithunsinghtocode
a892ea961f Update redis.adoc (#201)
* Update redis.adoc

- dependency for redis is not correct.
- updated typo
2024-01-02 13:00:50 -05: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
Mark Pollack
0657e1bab5 Set writelimit of default BodyContentHandler to unlimited in TikaDocumentReader 2023-12-20 16:13:00 -05:00
Omkar Shetkar
dd64a50d2f Merge SimplePersistentVectorStore and InMemoryVector store to be SimpleVectorStore
- Doc updates

Fixes  #146
2023-12-20 15:48:34 -05:00
Mark Pollack
1a8fcac206 fix failing tests due to directory structure changes 2023-12-19 12:46:43 -05:00
jtsnr
54f749f650 Fix Prompts documentation typos (#169)
* Fix Roles documentation

* Fix Example Usage typos
2023-12-18 12:35:27 -05:00
jruaux
a232166cf3 Add support for Redis vector store
- Added autoconfiguration for Redis vector store
- Added spring boot starter for Redis vector store
- Supports portable metadata filter expressions

Fixes #11
2023-12-18 11:50:03 -05:00
Johnny Lim
3fc74f95fe Fix broken Asciidoctor syntax in aiclient.adoc 2023-12-13 16:30:04 +01:00
OğuzhanSarisakaloglu
7aad51da7f Fix typo errors in code and readme file. 2023-12-12 18:40:07 -05:00
jtsnr
7f151c562e Fix page links 2023-12-12 15:47:58 -05:00
jtsnr
2c0da77a5c Fix links 2023-12-12 15:47:58 -05:00
Mark Pollack
a58e1fec64 Remove chain package. Fixes #109 2023-12-12 15:43:32 -05:00
Christian Tzolov
6d3c429e95 remove the occurances of 'experimenta' in the git urls and docs 2023-12-12 17:48:11 +01:00
Mark Pollack
8cc941d5ad move to 0.8.0-SNAPSHOT 2023-12-11 11:53:06 -05:00
Mark Pollack
5f7e78bd1b add prompt docs 2023-12-06 16:58:46 -05:00
Mark Pollack
f6dc8f6bd8 Move documentation that was in README.md into Antora.
* Add minimal ETL pipeline docs

Fixes #137
2023-12-05 21:21:06 -05:00
Mark Pollack
27bb72999a remove unused asciidoc plugin and docs 2023-12-04 14:49:16 -05:00
Christian Tzolov
ac9ae589f4 Add NOT operator to VectorStore portable filter expressions
- Add NOT expression type to the portable Filter.Expression model.
 - Add NOT to the Antlr grammar and implement the related parser listener method to generate Filter NOT expressions.
 - Add NOT support to the filter programming DSL.
 - Implement FilterHelper.negation for logically transform any boolean expression with NOT statements into
   semantically equivalent one with NOT applied to the leaf expressions.
 - Add tests for paresers, converters and vectorsores ITs.
 - Move the filter IN/NIN expansion logic to the FilterHelper
 - Factor out the filter IN/NIN boolean expression expansion logic out of Weaviate up to the FilterHelper.
 - add in/nin expantion FilterHelper tests
2023-11-28 18:17:56 -05:00
Harry9656
8e8be5da4a Fix link pointing to arxiv 2023-11-25 12:36:14 +01:00
Christian Tzolov
faee5fef6f Add support for Weaviate Vector Store
- Add Weaviate Vector Store implementation.
 - Implement a converter of portable Filter.Expressions into native, Weaviate GraphQL Were expressions.
 - Support for Weaviater schema auto-registration of filtarable metadata fields.
 - Add auto-configration, spring properties and tests.
 - WeaviateVectorStore ITs.
 - Add README.md

 Resolves #100
2023-11-21 18:16:34 -05:00
John Blum
eadcae7702 Define API for AI provider metadata collected during an AI request.
* Define GenerationMetadata property in AiResponse.
* Add OpenAI implementations of AiMetadata, RateLimit and Usage interfaces.
* Add REST Assured JsonPath dependency to spring-ai-openai module.
* Add OkHttp dependency to spring-ai-openai module.
* Add OkHttp Interceptor to parse OpenAI rate limit metadata from HTTP headers.
* Add OkHttp MockWebServer dependency to spring-ai-openai module, test scope
* Add Jakarta Servlet API dependency to spring-ai-openai module, test scope
* Add Spring Web MVC dependency to spring-ai-open-ai module., test scope
* Define OpenAI API response headers in an Enum.
* Add OpenAI test configuration using mock objects.
* Add integration test to assert successful extraction of OpenAI API response metadata.
* Include Spring Boot auto-configuration for (conditional) OpenAI metadata collection.
* Edit documentation and include information on AI metadata collected by Spring AI.
* Provide AI metadata implementation for Microsoft Azure OpenAI Service.
* Capture optional PromptMetadata in AiResponse.
* Define metadata for an AI generation choice.
* Capture AI choice metadata in Generation.
* Integrate ChoiceMetadata into AiResponse returned by OpenAI.

Fixes #98
2023-11-21 18:16:34 -05:00
KathrynBrusewitz
837c4080aa Make filter expression builder Op public 2023-11-15 19:35:49 +01:00
Christian Tzolov
952ff6c319 Simplify VectorStore interface
- Collapses all VectorStore similiaritySearch methdos into one with SearchRequest builder.
 - Fix all affected code and tests.
 - Bump the project version to 0.7.1.
 - Add tests
 - Add autoconfigurations for milvus, pinecone and pgvecor stores.
 - Improve and unify the VectorStore ITs.
 - Make use of TrasformersEmbeddingClient for auto-configurations ITs.
2023-11-14 15:39:01 -05:00
Mark Pollack
49656a036f Add link to research paper on effective prompts 2023-11-09 15:43:57 -05:00
Jay Bryant
04d9683f49 Editing pass for clarity, grammar, spelling, punctuation, and usage.
Also added several anchors and links.
2023-11-09 15:40:16 -05:00
John Blum
0a236993e3 Fix additional grammatical mistakes and revise wording in vectordbs.adoc.
* Clean up README.md files in Milvus, PGvector, and Pinecone modules.
* Apply consistent treatment of 'model' when used as an AI concept, e.g. AI model or Embedding model.
* Apply consistent treatment of 'vector store' and 'vector database' references.
* Simplify sentence structures.

Closes #79
2023-11-08 12:24:20 -08:00