Commit Graph

176 Commits

Author SHA1 Message Date
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
Peter Keeler
aca8ffd400 Support keep-alive and format options in Ollama chat requests
- add support for the advanced parameter 'template'.
 - add docs for the advanced parameters.
2024-04-06 11:44:52 +02:00
PabloSanchi
ae6a019ad1 Add additional properties attribute to watsonx ai option and tests
- fix: remove non-sense underscore checking
- fix: check the model is included in request parameters
- fix: refactor, use constant
- fix: add jsonproperty decorator to additional attribute
- feat: allow additional params merging into the default watsonx option
- fix: remove not needed key
- fix: remove default values in watsonx ai options class
- fix: add default property
2024-04-05 17:02:28 +02:00
Eddú Meléndez
8fa675b145 Update spring boot version to 3.2.4 2024-04-04 13:43:01 +02:00
Christian Tzolov
216e165087 fix formatting 2024-04-04 12:38:37 +02:00
Hyune-c
fefc6f4173 fix: AzureOpenAiChatOptions to handle null values for presencePenalty and frequencyPenalty 2024-04-04 12:36:36 +02:00
Fu Cheng
2129547923 Fix Usage in Ollama ChatResponse
The Usage of Ollama ChatResponse was put into ChatGenerationMetadata as content filter metadata. The correct place should be in ChatResponseMetadata
2024-04-04 12:17:41 +02:00
Christian Tzolov
d42cd60eea Fix: AbstractBedrockApi Streaming reusing of Flux Sink
Resolves: #474
2024-03-25 16:10:37 +01:00
Christian Tzolov
c66ed36073 Allow Retry on choosen status codes
- Add a new autoconfig property spring.ai.retry.on-http-codes that list status codes (scuh as 429)
   for which the retry should be attemptd.
 - Updated the docs.

 Resolves #433
2024-03-24 15:05:31 +01:00
Christian Tzolov
7a55d66d77 Add Ollama multimodality support
- Requires LLaVa or Bakllava models.
  - Extend the Ollama chat client to support the Spring AI Medi type inputs.
  - Add OllamaChatClientMultimodalIT.java
  - Add Multimodal section in Ollama's docs.

 Resolves #421
2024-03-24 15:03:07 +01:00
Christian Tzolov
dbf0f9e9e1 Fix embedding_only related test 2024-03-24 15:01:46 +01:00
Christian Tzolov
472ac52bc9 Fix a compliation issue and docs related to 23db7cccdf 2024-03-24 14:55:41 +01:00
Thomas Vitale
23db7cccdf Ollama: remove invalid embedding_only option
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-03-24 14:43:43 +01:00
youngmon
c757eae8bf Fix TitanChatBedrockApi.java
fix Access modifier

#490
2024-03-22 14:53:50 +01:00
Christian Tzolov
09fb5743d2 Experimental Function Calling tests for AnthropicApi low-level API 2024-03-22 14:34:37 +01:00
Christian Tzolov
834d2d0487 Add Multi-Modality Support for OpenAI
- Implemented a MediaContent abstraction within the OpenAiApi to handle text and image inputs.
 - Response message content remains a plain String, ensuring backward compatibility.
 - Extended the OpenAiChatClient request creation process to seamlessly map Spring AI Messages with
   Media content to the low-level OpenAiApi MediaContent types.
 - Added integration tests for embedded and URL images, covering both synchronous and streaming calls.
 - Updated the OpenAI class diagram to reflect the new media content types provided by the OpenAI API.
 - Incorporated a chapter on multi-modality within the openai-chat.adoc documentation.
 - Improve the openai multimoality doc
2024-03-21 17:23:49 -04:00