Commit Graph

191 Commits

Author SHA1 Message Date
Josh Long
55aab168a1 modelcall and chatclient rework 2024-05-18 21:30:51 +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
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
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
Josh Long
04d854cc49 make project names consistent 2024-05-17 15:31:58 +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
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
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
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
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
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
Mark Pollack
ad527303ed Rename Agent classes to use ChatBot 2024-05-08 15:43:00 -04:00
Mark Pollack
dfb8bf6a44 Add a new abstraction to simplify implementation of common ChatBot use cases
* Add ChatBot and basic DefaultChatBot
* Add streaming ChatBot support.
* Add Evaluator interface and RelevancyEvaluator implementation
* Add Content data type abstraction for Document and Message
* Renaming and package refactoring
* update .gitignore to allow node package name
* Add List<Media> to node and move ai.transformer package to ai.prompt.transformer
* Add Short/Long term memory support.
* Add mixing transformers support

Docs TBD
2024-05-08 15:14:50 -04:00
Christian Tzolov
a49a2d213f Replace the OutputParser by a StructuredOutputConverter API
- Old OutputParser, BeanOutputParser, ListOutputParser and MapOutputParser classes are depredated
   in favour of the new StructuredOutputConverter, BeanOutputConverter, ListOutputConverter and
   MapOutputConverter implementations.
   Later are drop-in replacements for the former ones, and provide the same functionality.
 - Keep the existing parser package and classes for backward compatibility.
 - Adjust the PromptTemplate for backward compatibility
 - Update all existing tests to use the new Structured Output API.
 - Improve the documentation for structured outputs.
2024-05-08 12:02:24 -04:00
Thomas Vitale
1c93ae50a8 OpenAI: Fix model property being overwritten by default value
Fixes gh-671

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-05-05 17:22:07 +02:00
Thomas Vitale
f91ccf0047 Ollama: Update APIs, Testcontainers, Documentation
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-05-05 17:25:51 +03:00
Christian Tzolov
670bf8e259 Adhere to Spring Framework code sytle
- Wildcard imports such as import java.util.* or import static org.assertj.core.api.Assertions.* are forbidden, even in test code.
   https://github.com/spring-projects/spring-framework/wiki/Code-Style#import-statements
2024-05-04 20:32:37 +03:00
Christian Tzolov
7252ba19f9 Udate azure open ai client ot 1.0.0-beta8.
- In ITs rename property spring.ai.azure.openai.chat.options.model to spring.ai.azure.openai.chat.options.deployment-name.
   - Resolve compilation issues after the client library update.
2024-04-30 15:44:16 +03:00
Christian Tzolov
9f32a3ca9c Add doc waring about gemini pro model function calling function calling degradation 2024-04-30 14:34:53 +03:00
Christian Tzolov
9cd01c59f6 temp 2024-04-30 11:46:40 +03:00
Lorenzo Caenazzo
b4194bda9d 🐛 Vertex API admit only one tool per request, but tools can have multiple function inside 2024-04-30 11:22:12 +03:00
Christian Tzolov
20ea731cf6 Add OpenAI transcription merge tests.
Fix missing granualaritytype option handling.
2024-04-30 00:17:57 +03:00
wmz7year
a50969ec8b Bedrock Titan embedding client adds BedrockTitanEmbeddingOptions to support dynamic embedding request types. 2024-04-28 14:57:29 +08:00
Ricken Bazolo
5f9ecdd899 Fixing Log probability information 2024-04-26 21:05:28 +02:00
Christian Tzolov
7e03a15cf5 Mistral AI streaming function API change fix 2024-04-26 21:04:48 +02:00
wmz7year
9e865f0b0f Add Bedrock Meta LLama3 AI model support.
- re-enable llama structured output tests
2024-04-25 16:22:47 +02:00
wmz7year
563f9b48af Bedrock client autoconfiguration support external AwsCredentialsProvider and AwsRegionProvider 2024-04-21 18:10:53 +08:00
wmz7year
8c04b05631 Add support for AWS bedrock claude3 opus model support 2024-04-20 07:47:26 +02:00
Christian Tzolov
df92dff36a Fix OpenAI audio options merging order
Resolves #601
2024-04-19 18:43:47 +02:00
Christian Tzolov
abd9e327aa Add s.ai.openai.embedding.options.dimensions documentation 2024-04-11 14:42:40 +02:00
Christian Tzolov
ae9d3f4168 Updgrade Vertex AI Gemini to 26.37.0
- Adjust to the new, breaking, API changes.
   - Update the docs adding the transport endpoint and scopes to the connection properties.
2024-04-10 09:09:58 +02:00
Christian Tzolov
55b8b2a858 Update models README links
Resolves #528
2024-04-09 20:38:06 +02:00
sinsy
5c3ed1152a Add support of Bedrock API timeout
Configure the amount of time to allow the client to complete the execution of an API call.
 This timeout covers the entire client execution except for marshalling. This includes request handler execution,
 all HTTP requests including retries, unmarshalling, etc. This value should always be positive, if present.

  - Add timeout filed to the AbstractBedrockApi, used to initialize the BedrockRuntimeClient and the
    BedrockStreamingRuntimeClient. Update all classes that extend the AbstractBedrockApi.
  - Keep the previous constructors for backward compatibility using timeout value of 5 min.
  - Add a common AWS connection timeout auto-config property and update the documentation.
    Defaults to 5 min.

 Additional changes:
  - Fix Anthropic 3 straming response - add bedrock metrics field.
  - Increate the default timeout to 5 min. Update the docs.
  - Increase the ITs.
2024-04-09 10:28:17 +02:00
Christian Tzolov
f249e64651 Add Function Calling Support for Anthropic Features
- expanded the AnthropicApi to include Tool, facilitating request and response abstractions.
 - extended AnthropicChatClient to inherit AbstractFunctionCallSupport, with
   implementation of all necessary methods and function registration protocols.
 - implemented FunctionCallingOptions interface in AnthropicChatOptions.
 - added tools integration tests for AnthropoicApi and AnthropicChatClient.
 - extended the auto-configuration with functional calling functionality.
 - added ITs for tools auto-config.
 - updated documentation on anthropic function calling and relevant pages for comprehensive coverage.
2024-04-07 22:10:35 -04:00
Christian Tzolov
e268975a80 Fix Geminie GenerativeModel handling between calls
Resolves #560
2024-04-07 21:57:14 +02:00
Thomas Vitale
ea849d9075 Ollama: Remove unused option in chat completion
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-04-07 15:17:56 +02:00
Christian Tzolov
1196ef2f71 Fix OpenAI API Tool Choice configuraiton options
- Related to the  https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice
 - It seems that when a cuntion type is set explicitely: {"type": "function", "function": {"name": "my_function"}}
 the parallel calling is not working anymore!

 Resolves #551
2024-04-07 00:01:38 +02:00
Thomas Vitale
4e473aaff1 Ollama: Added missing fields in API
Fixes gh-553

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-04-06 17:12:09 +02:00
Thomas Vitale
11d05784b3 OpenAI: Added missing fields to API
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-04-06 17:04:54 +02:00
Christian Tzolov
1610729d93 Add missing ChatRequest#template parameter 2024-04-06 12:34:05 +02:00
Christian Tzolov
15628a34b2 Fix a compliation error caused with pervious merge 2024-04-06 12:23:48 +02:00