Commit Graph

130 Commits

Author SHA1 Message Date
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
Eddú Meléndez
64308c4230 Cleanup imports 2024-03-18 15:04:54 +01:00
GuangxiaoLong
ea79a4fbba Update OpenAiStreamFunctionCallingHelper.java
preventing the occurrence of null pointers.
2024-03-18 14:32:07 +01:00
ahmed
c036931065 Implemented Bedrock Jurassic 2 ChatClient
- Implemented Bedrock Jurassic ChatClient
 - added documentation reference
 - implement auto-configuration and boot starter

 - Disable the BedrockAi21Jurassic2ChatClientIT.emojiPenaltyWhenTrueByDefaultApplyPenaltyTest() test
   as it  fails when run in combination with the other tests.
2024-03-16 14:03:18 +01:00
Christian Tzolov
9c19dc1665 Improve Antora documentation layout
- tename /api/clients/ into /api/chat
  - move the the image from /api/clients to /api
  - fix the layout inside the chat and embeddings docs. Moving the runtime options and sample controllers at top level.
  - adjust all affected links.
2024-03-16 11:26:19 +01:00
mackey0225
152420fcc4 Fix Typos and Grammatical Errors
* Fix Typo: Duplicate 'for' in documentation text
* Fix Typo: Duplicate 'to' in documentation text
* Fix broken links in documentation
* Correct grammar by deleting unnecessary 'an' in documentation
* Fix typo: Change 'tunning' to 'tuning' in documentation
* Fix typo: Change 'an' to 'can' in documentation
* Fix typo: Change 'generats' to 'generates' in documentation
* Fix grammatical error: Change 'a AI' to 'an AI' in documentation
* Fix grammatical error: Change 'a AI' to 'an AI' in code
* Fix Typo: Duplicate 'for' in code
2024-03-15 12:23:06 +01:00
pradipkhomane
be7e291860 Fixed typo in Bedrock Titan chat option exception 2024-03-15 12:05:18 +01:00
Mark Pollack
9e98962aba Add additional ctor for OpenAiEmbeddingClient 2024-03-14 15:56:45 -04:00
Mark Pollack
4c617e16b4 Prepare next development iteration 2024-03-12 14:33:45 -04:00
Mark Pollack
490f3cd1cb Milestone Release 0.8.1 2024-03-12 14:28:28 -04:00
Mark Pollack
4fd15b11c5 Add documentation for OpenAI Transcription
Fixes #401
2024-03-12 12:23:25 -04:00
Mark Pollack
ed5eef4b0b fix failing test due to property name change of model->deployment-name in azure 2024-03-12 10:45:14 -04:00
Mark Pollack
1e98f82e03 Change Azure embedding and chat options 'model' property to 'deployment-name'
* Azure uses 'deployment-name' when provisioning models and is what needs to
  be passed in to the client, not the model name.
  This is a difference with the OpenAI API that doesn't have a deployment-name
  This change aligns the terminology used with Azure so that there is
  less confusion when setting configuration property values

Fixes #10
2024-03-12 10:26:32 -04:00
Christian Tzolov
4209d5a65d Make consistent sync/stream AssistantMessage properties for OpenAI and Mistral AI 2024-03-12 11:34:56 +01:00
Mark Pollack
7f1570d722 Update javadoc for message package and docs for Gemini Multimodal support 2024-03-11 19:14:53 -04:00
Christian Tzolov
0fdc6aa844 Add streaming Function Calling support of OpenAI and Mistral AI
- Extends the  reactor logic to to allow aggregation of the chunked tool-calls messages and
  leverage the exsiting fnctoin calling infrastructure.
  - Seamples experience for the streaming functionality.
  - Add Message ID and  FinishReason to the returned Generations properties.
2024-03-10 21:01:59 +01:00
Christian Tzolov
7f60e03054 Fix Bedrock Anthropic line separator handling on Windows
Resolves an issue where Bedrock Anthropic failed to handle line separators properly on Windows.

  Resolves #404
2024-03-08 18:25:02 +01:00
Christian Tzolov
fef730301c Replace %n by System.lineSeparator() 2024-03-08 15:15:01 +01:00
Christian Tzolov
ba940395b6 Use platform independent line separators 2024-03-08 09:43:15 +01:00
Christian Tzolov
1d6d11c99b Resolve OpenAiApi initialization bug 2024-03-07 19:42:16 +01:00
Christian Tzolov
1e3eaec7b9 Refactor and centralize Retry logic:
- Establish a new "spring-ai-retry" project, implementing a default HTTP error handler,
   RetryTemplate, and handling both Transient and Non-Transient Exceptions.
 - Streamline existing clients (e.g., OpenAI and MistralAI) to utilize "spring-ai-retry."
 - Integrate retry auto-configuration with customizable properties, extending it to OpenAI and MistralAI Auto-Configs.
 - Allow configuration of RetryTemplate and ResponseErrorHandler for various clients, including OpenAIChatClient,
   OpenAiEmbeddingClient, OpenAiAudioTranscriptionCline, OpenAiImageClient, MistralAiChatClient, and MistralAiEmbeddingClient.
 - Add tests for default RestTemplate and ResponseErrorHandler configurations in OpenAI and MistralAI.
 - Introduce new retry auto-config properties: "onClientErrors" and "onHttpCodes".
 - Implement tests for retry auto-config properties.
 - Generate missing license headers.
2024-03-07 11:27:01 -05:00
sblashuk
8ed2af4115 Add Ollama enum with supported models and their ids
- Add missing license header
2024-03-07 15:04:29 +01:00
Mark Pollack
bcb559a82c add license header plugin and update all java files 2024-03-06 17:39:37 -05:00
Jiafu Tang
f6c57f6f60 rename directory spring-ai-stabilityai to stability-ai 2024-03-06 17:21:36 -05:00
youngpar
3938cc83ad Remove setters from options interface
* Add test code
2024-03-06 17:18:14 -05:00
youngpar
7396597678 Update to add latest gpt-3.5 turbo model number 2024-03-06 15:48:20 -05:00
Christian Tzolov
8ae506f3fb Improve the OpenAi Audio code structure
- Move the OpenAiAudioTranscriptionClient and OpenAiAudioTranscriptionOptions under the org.springframework.ai.openai package.
 - Rename the AudioTranscriptionRequest into AudioTranscriptionPrompt.
 - Minor imports cleaning.
2024-03-06 12:08:31 +01:00
Michael Lavelle
7d04167833 Adding support for OpenAI Audio transcriptions
- Make it use the new OpenAiAudioApi.
 - Remove trascription code from spring-ai-core. Too early to generalize.
   Move all related code under the spring-ai-openai project.
 - Fix missing licenses and javadocs.
 - Add 'Audio' prefix for Transcription classes and packages.
 - Add missing auto-configuraiotn and tests.
2024-03-05 13:29:26 +01:00
Christian Tzolov
54930af220 Make the OpenAiAudioApi return ResponseEntity<value> 2024-03-03 10:49:09 +01:00
Christian Tzolov
5e6815863c Make BedrockCohereEmbeddingOptions implement EmbeddingOptions
Resolves #389
2024-03-03 09:14:08 +01:00
Christian Tzolov
6122b2a379 Fix OpenAiAudioApi javadoc 2024-03-03 00:09:17 +01:00
Christian Tzolov
ccd5767ead Stabilize OpenAiAudioApi test fixtures 2024-03-02 23:33:38 +01:00
Christian Tzolov
8703582160 Fix broken tests after updateding the models from DALL-E-2 to DALL-E-3 2024-03-02 22:17:36 +01:00
Christian Tzolov
e819b7c313 Add missing AOT hits for OpenAiAudioApi and OpenAiImageApi 2024-03-02 22:01:08 +01:00
Christian Tzolov
a48518636b Add low-level OpenAI Audio Api Client
- Add OpenAiAudioApi that impelemnts the Speech, Transcription and Translation endpoint.
 - Add ITs
2024-03-02 21:58:02 +01:00
Christian Tzolov
b58ef6d5a3 OpenAI api improvements
- Factor out OpenAiApiClientErrorException and OpenAiApiException out of
  OpenAiApi into standalone common package.
- Move the HTTP error handling and header setup into a shared ApiUtils.
- Add ChatModel and EmbeddingModel enums to OpenAiApi.
- Add ImageModel enum ot OpenAiImageClient.
2024-03-01 22:17:07 +01:00
Christian Tzolov
50547188f7 Rename legacy Vertex AI into Vertx AI PaLM2 classes 2024-03-01 14:51:02 +01:00
Ricken Bazolo
31d6194d9d Add mistralai support documentations
Also
 - fix a MistralAiApi (and OpenAiApi) issue just introduced by Mistral API
 - change the auto-config properties prefix from spring.ai.mistral.* to spring.ai.mistralai.*
 - minor doc references updates.
2024-03-01 11:28:45 +01:00