Commit Graph

915 Commits

Author SHA1 Message Date
Mark Pollack
53902e6fe2 initial refactoring 2024-07-15 17:45:08 -04:00
v891
ed815d8b3d Registering JavaTimeModule to ObjectMapper 2024-07-15 19:37:06 +02:00
Chris Turchin
f07e3911dc Fix system messages handling issue
- re-assign the model on withSystemInstruction return.
 - deprecate the gemini-pro-vision model and replace the default model to gemin-pro-1.5
 - update docs.
 - improve system message handling implementation.

 Resolves #1030

Co-authored-by: Christian Tzolov <ctzolov@vmware.com>
2024-07-15 19:26:12 +02:00
Christian Tzolov
ee19ee1db9 Add high-level function calling support for Anthropic
- simplify and unify the AbstractToolCallSupport::executeFuncitons. Fix filed typos
 - remove old classes
2024-07-15 13:57:38 +02:00
Christian Tzolov
7e98fb78b7 Fix incorect VertexAi Embedding model atuo-config condition
Resolves #1028
2024-07-15 12:43:31 +02:00
Christian Tzolov
086117effa High-level API function calling support for VertexAI Gemini
- Refactor VertexAiChatModel's function calling handling to use Spring AI abstractions.
2024-07-15 12:24:42 +02:00
Thomas Vitale
fac38c5db8 Update tests for EmbeddingResponseMetadata (#1039)
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-07-12 12:02:14 -04:00
Thomas Vitale
e601f14364 Add model name and token usage to EmbeddingResponseMetadata
- Moves these from free-text key/value pairs to interface
- Enables programmatic use for evaluation and observability

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-07-12 11:18:49 -04:00
Christian Tzolov
41eab270cb Refactor High-level API function calling support
- Add ToolCall to AssistantMessage.
 - Rename FunctionMessage to ToolResponseMessage and add id and name fields.
 - Refactor OpenAiChatModel's function calling handling.
 - Prompt copy now copies the AssistantMessage and ToolResponseMessage contents.

Other ChatModel implementations to adopt these changes in subsequent commits
2024-07-12 00:02:05 -04:00
Mark Pollack
e570ef57cc Fix ZhiPuAiPropertiesTests 2024-07-11 14:09:46 -04:00
吴博
28c0d24807 Updates to ZhiPuAi model
* Adjust chat api request options and add unit test

Fix options of zhipu ai chat model
2024-07-10 15:53:40 -04:00
Thomas Vitale
7209ee5c4a Fix leaked dependencies in autoconfigure module (#1023)
The spring-ai-spring-boot-autoconfigure module had a few dependencies
that were included in the final JAR instead of being marked as optional.
Also, the PostgreSQL dependency was duplicated.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-07-10 15:38:39 -04:00
Christian Tzolov
c70c20b79d Add VertexAI Embedding Model support
- add new spring-ai-vertex-ai-embedding project.
 - add VertexAiTextEmbeddingModel and VertexAiMultimodalEmbeddingMode with related options configuration classes.
 - add ITs
 - add auto-configuraiton and boot starters.
 - register to BOM.
 - add documentation.
 - add multimodal embedding documentation
 - extend the Embedding metdata so that it can keep references to the source document's data, Id, mediatype

 Resolves #1013
 Related to #1009
2024-07-10 15:36:13 -04:00
David
40df264078 Fix example code in upgrade-notes.adoc 2024-07-09 14:53:51 +02:00
Christian Tzolov
61a56db98b Update Azure OpenAI to 1.0.0-beta.10 2024-07-09 13:08:42 +02:00
Christian Tzolov
dd22342c0c Improve ONNX Tansformer Embedding Model
- Fix model output name handling.
 - Improve documentation.
2024-07-09 11:21:53 +02:00
Christian Tzolov
f61ccdd09d Add Groq inference support via OpenAI client
- add dedicated groq chat page in the documentation.
   Explain how to re-configure the OpenAI client for accessing the Groq chat completion endpoint.
 - Doc: order the Chat and Embedding items in alphabetical order
 - Add Groq ITs.

 Resolves #996
2024-07-05 16:42:46 -04:00
Francisco Javier Torres
867bd173e5 Set embeddings on added Document objects for Milvus and PgVector stores. 2024-07-05 16:37:38 -04:00
jiwoo
6931148377 Fix MilvusVectorStore max allowed dimension size to 32768 2024-07-05 16:32:59 -04:00
Mark Pollack
a1afb0db46 Fix Mongo VectorStore persistance issue
Fixes #698
2024-07-05 16:26:02 -04:00
Ross Lawley
24da2efc86 Fix IndexAlreadyExists exception for spring-ai-mongodb-atlas-store
In testing the docker mongodb/atlas container doesn't throw an exception when
calling `mongoTemplate.executeCommand({"createSearchIndexes": ...});`. However,
when using the Atlas service it does and throws a `IndexAlreadyExists` exception.

Added error handling for error code 68 or error code name `IndexAlreadyExists`.
See: https://www.mongodb.com/docs/manual/reference/error-codes/

Fixes #910
2024-07-05 14:38:38 -04:00
Mark Pollack
455d39e7cd Improve error messages in OpenAI Autoconfiguration 2024-07-05 12:18:39 -04:00
Christian Tzolov
f171b0fa5e Handle OpenAiChatModel NPE for partially compatible OpneAI API such as the NVIDIA API 2024-07-03 16:14:42 +02:00
devholic22
4ff2f1fc06 Add comment in MessageType for readability
- Add comment in MessageType for readability
2024-07-03 15:04:42 +02:00
Christian Tzolov
a749b1bde6 Docs: update Anthropic list of supported models 2024-07-03 11:07:42 +02:00
Christian Tzolov
feb0020d2f Docs: update Anthropic list of supported models 2024-07-03 11:01:38 +02:00
Christian Tzolov
d8be884cb1 Improve Anthropic Claude streaming handling
- add StreamEven API domain model for reliably parsing stream events.
 - add StreamHelper#mergeToolUseEvents to aggregate partial tool use jsons into a list of ContentBlocks.
 - add StreamHelper#eventToChatCompletionResponse to convert Flux<StreamEvents> into Flux<ChatCompletionResponse>.
 - Rename MediaContent -> ContentBlock, RequestMessage -> AnthropicMessage, ChatCompletion -> ChatCompletionResponse.
 - Improve tests and docs.
2024-07-02 23:36:25 +02:00
Mark Pollack
cb6662a61e Various code cleanup
Co-authored-by: Alex Klymenko <alxkm@users.noreply.github.com>
2024-07-02 15:35:01 -04:00
Mark Pollack
da4b26f74c Update TikaDocumentReaderTests to use easier to parse web site as input 2024-07-02 12:37:25 -04:00
devholic22
3411e3e74d Add comments in OpenAiAudioSpeechModel
* Add comments in OpenAiAudioSpeechModel like OpenAiChatModel

* Remove duplicated word in OpenAiAudioSpeechOptions AudioResponseFormat comment
2024-07-02 11:43:52 -04:00
jiwoo
3bec210b80 Add additional tests for Document metadata and TextSplitter 2024-07-02 11:37:10 -04:00
Nicholas Zhan
5417d19d9a Fix prompt template validation if a variable name contains hyphen 2024-07-02 11:13:54 -04:00
TimJ0212
e889fb48ba Update chroma.adoc (#945)
There is a parameter missing. Would avoid confusion
2024-07-02 10:56:55 -04:00
xiehui1956
f5608be65d Add Minimax AutoConfiguration.imports file 2024-07-02 10:42:07 -04:00
Christian Tzolov
13a4e76511 Azure AI: Support OpenAI key and MS Entra auth
- Enable Authentication using OpenAI API key
- Use TokenCredential for authorization if provided by the user
- Add the spring.ai.azure.openai.openai-api-key for auth with OpenAI service
- Update Azure Chat and Embedding docs
- Add integration tests for OpenAI connection

Resolves #260
2024-07-02 10:33:09 -04:00
Lorenzo Caenazzo
237feb3437 ⬆️ bump tika to 3.0.0-BETA to avoid pdfbox version conflicts 2024-07-02 16:17:59 +02:00
Mariusz Bernacki
f5b72242c0 Add Anthropic Claude streaming Function Calling support
Resolves #930
2024-07-02 10:28:31 +02:00
ASHWIN KRISHNA K
a22e62d1fa Changes related to typo mistake in chat client documentation (#980)
Resolves https://github.com/spring-projects/spring-ai/issues/966
2024-07-01 14:53:19 -04:00
DadySu
9e5eff18fb Ref docs cleanup - Function Calling chapter (#985)
Add line break in Function Calling chapter
2024-07-01 14:49:26 -04:00
Craig Walls
b5cc9db88a Accept response as a String instead of ChatResponse in EvaluationRequest
- Update docs
2024-07-01 12:05:01 -04:00
Craig Walls
9956367fc8 Accept String answer in BasicEvaluationTest instead of ChatResponse 2024-07-01 11:52:46 -04:00
Lorenzo Caenazzo
0f07b7bb8a :fix: constructor error messages 2024-06-28 12:30:10 +02:00
devholic22
9f56a91657 Fix OpenAiChatModel NPE
* Fix OpenAiChatModel NPE using getOrDefault
2024-06-28 11:54:31 +02:00
Christian Tzolov
c09286eedf Fix javadoc formatting 2024-06-28 11:31:57 +02:00
dongfeng3692
df52c9fbb5 Minor javadoc improvements 2024-06-28 11:20:07 +02:00
ashni
fe3097ebf0 Update mongodb.adoc
* Adding links + descriptions for MongoDB Atlas and MongoDB Atlas Search.
* One sentence per line.
2024-06-27 18:19:11 -04:00
Yulong Shi
f92068f160 Update Redis vector store docs (#963)
* The dependency should be `spring-ai-redis-store-spring-boot-starter` instead of `spring-ai-transformers-spring-boot-starter` for Redis vector store.
2024-06-27 16:43:11 -04:00
Hyoseop Song
5b4d4c19d1 Fix typo in documentation (#965)
* Fixed typographical errors in key documents
2024-06-27 16:37:31 -04:00
Mark Pollack
a1c4a29073 AzureVectorStore Fix - when not initializing schema, create searchClient from index name 2024-06-26 19:22:53 -04:00
Soby Chacko
b206b37dfd Consistent vector store property prefix for Chroma store
* The Chroma vector store config property prefix uses .store at the end
  which is not consistent with the other vector stores - fixing this.

* Update the upgrade-notes.adoc
2024-06-26 11:17:10 -04:00