Commit Graph

167 Commits

Author SHA1 Message Date
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
Ricken Bazolo
8510f00520 Fix OpenAiApi tool_choice value and refactor MistralAi class 2024-03-21 11:12:19 +01:00
ahmed
766b420f98 Added support for OpenAI Text to Audio (Speech API )
* Added documentation
2024-03-20 13:03:04 -04:00
Christian Tzolov
6ba897ef76 Fix additional git case ignore issues 2024-03-20 15:57:09 +01:00
Christian Tzolov
369d945543 Fix git case ignore issue 2024-03-20 15:43:46 +01:00
Pablo Sanchidrian
52d15f5dc1 Add Watsox.AI Chat Client integration
- feat: setup watsonx ai api
 - feat: add watsonx ai model options
 - feat: setup watsonx chat client
 - feat: add watsonx records/models
 - add watsonx-ai module to pom
 - add watsonx-ai module to bom
 - feat: add connection properties watsonx
 - feat: add  WatsonxAiAutoConfiguration with api client
 - feat: add starter watsonx.ai
 - feat: add generate method in watsonx ai api
 - feat: add watsonx ai api streaming generation method
 - feat: add watsonx message to prompt converter util
 - feat: implement call and stream mehtod
 - feat: add watsonx ai runtime hints
 - fix: filter null fields
 - feat: watsonx options tests
 - feat: add test dependencies
 - feat: add runtime hints tests
 - feat: add watsonx client tests
 - fix: apply linter
 - feat: add tests for message to prompt converter
 - feat: add signature
 - fix: change deprecated IamAuthenticator
 - fix: do not keep baseUrl in a class variable
 - fix: webClient request
 - feat: add default base url to autoconfigure
 - feat: add watsonx ai integration docs
 - fix: model options json
 - feat: add watsonx-ai spring boot starter
 - feat: enable watsonx api on watsonx chat client
 - fix: remove condition
 - feat: add watsonx autoconfigure import
 - feat: add watsonx module resource aot import
 - feat: add pom for watsonx ai module

 Additional pre-merge adjustments:

 - Rename all WatsonxAIXxx classes to WatsonxAiXxx.
 - Rename WatsonxChatClient to WatsonxAiChatClient.
 - Move WatsonxAiChatOptions out of the API.
 - Implement a Builder for WatsonxAiChatOptions (replace the inline withXxx code).
 - Add a WatsonxAiChatOptions field to WatsonxAiChatClient as default options.
   Later, it is also set by the auto-configuration properties.
 - Implement merging logic for default vs runtime options in WatsonxAiChatClient.
 - In Auto-config, add WatsonxAiChatProperties with enabled and options fields.
   Options are passed to the client.
 - Update the adoc to include the .chat.options properties.
 - Add the watsonxai doc to the nav.adoc.
 - Fix license headers and javadocs.
 - Move dependency versioning to the parent POM.
2024-03-20 15:18:48 +01:00
Ben Middleton
e004751842 Add Bedrock Anthropic Claude 3 models support
- Created low-leverl anthropic messages API for Claude 3.
   Use the new message API.
 - Add Chat Client with tests.
 - Add bedrok anthropic 3 docs.
 - Add multibudality support + tests.
 - Add auto-configuraiton & tests.
 - Rename Athropic to Athropic3 in class names to avoid confusion with previous Bedrock Anthropic 2 impl.
2024-03-19 12:29:50 +01:00
YuLuo
08fdf28692 fix: fix comment style error (#462) 2024-03-19 00:47:49 -04:00
Christian Tzolov
ce2bb131e5 Implement Anthropic Claude3 Message API client support (direct)
This commit introduces support for the Anthropic Claude3 Message API
  (https://api.anthropic.com), enabling direct interaction with its services.
  This is not a Bedrock Anthropic Claude3 implemenation.

  Changes include:

  - Implementation of a low-level client, AnthropicApi, to interact with
    the message API endpoints specified in the Anthropic documentation
    (https://docs.anthropic.com/claude/reference/messages_post), including support for streaming.
  - Addition of AnthropicApi tests to ensure functionality and reliability.
  - Support for multimodal requests within AnthropicApi.
  - Adding the spring-ai-anthropic and boot starter into BOM and parent POM modules for streamlined usage.
  - Add Anthropic Auto-configuration and Boot Starter for seamless integration into existing projects.
  - Implementation of AnthropicChatClient with capabilities for synchronous and streaming communication,
    including support for multimodal messages.
  - Inclusion of both unit and integration tests to validate functionality across various scenarios.
  - Add Antora documentation with comprehensive guidance on using AnthropicApi and AnthropicChatClient.
  - Add of Ahead-of-Time (AOT) hints for AnthropicApi.
  - update anthropic diagram
2024-03-19 00:36:29 -04:00
Eddú Meléndez
8503078088 Add ServiceConnection support for
* ChromaDBContainer
 * MilvusContainer
 * QdrantContainer
 * RedisStackContainer
 * WeaviateContainer
 * OllamaContainer

Add docs
2024-03-18 23:29:55 -04:00