Commit Graph

943 Commits

Author SHA1 Message Date
Mark Pollack
e723c644ae Improve Message object hierarchy
- SystemMessage no longer has Media
- Add MediaContent interface
2024-07-19 12:59:07 -04:00
Veerendra Vellanki
60308eab77 register available modules with the object mapper
add tests
2024-07-19 13:05:20 +02:00
dongfeng
92b06346fd Update enum to include OpenAI's GPT-4o-mini model 2024-07-19 13:05:04 +02:00
Christian Tzolov
5dc9480eea Anthropic: make the beta features header value configurable
- add new spring.ai.anthropic.beta-version property.
  - add ITs.

  Resolves #1068
2024-07-18 20:54:28 +02:00
Soby Chacko
50d34b8a48 BREAKING CHANGE - Change vector store initialize-schema to false
* Change default schema initialization of vector stores from `true` to `false.`
  Users need to explicitly opt-in for schema initialization by setting the
  `initialize-schema` property on the corresponding vector store.
* Update integration tests
* Update docs

Fixes #907
2024-07-18 14:28:00 -04:00
Christian Tzolov
edf943ec97 Adjust tests 2024-07-18 19:39:43 +02:00
Christian Tzolov
018bb2c600 Ensure that ChatClient copies the input chatoptions
- introduce copy() method to the ChatOptions.
 - make sure that the DefaultChatClientRequestSpec takes a copy of the input chat options to prevent multation.
 - add a OpenAiChatClientMultipleFunctionCallsIT to reproduce the problem and verify the solution.

 Resolves #1064
2024-07-18 18:56:28 +02:00
Youngrae Cho
75db25b13d Fix RetryTemplate retry condition
Resolves #846
2024-07-18 15:33:16 +02:00
Michael Simons
41d2cb5827 Upgrade to latest version of Cypher-DSL.
Also use the bom, so if anyone combines it with Spring Data, things settle at some common version.
2024-07-18 15:04:49 +02:00
Christian Tzolov
588082285a OpenAI ChatModel: handle null finish reasons responses 2024-07-18 15:04:21 +02:00
Eddú Meléndez
0a07f65d6a Use RedisAutoConfiguration in RedisVectorStoreAutoConfiguration
Currently, `RedisVectorStoreAutoConfiguration` creates its own
configuration to connect with Redis. This commit reuse
`RedisAutoConfiguration` from spring boot project. It's limited
to Jedis.
2024-07-18 14:24:10 +02:00
Thomas Vitale
40d8671f3e Improve new function calling strategy
- Streamline the Generation constructors

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-07-18 14:18:45 +02:00
Mark Pollack
97f443d615 Update to ResponseMetadata design
* Remove inheritance from HashMap
* No more subclasses per model provider
* Builder class for ChatResponse
* Fix the AbstractResponseMetadata#AI_METADATA_STRING parameter order
* ChatResponseMetadata ignore Null values.
2024-07-18 12:48:28 +02:00
Mark Pollack
17c44237a5 Fix cassandra chat memory entry in autoconfig .imports file 2024-07-17 10:04:56 -04:00
Christian Tzolov
ab474789d4 Minor docs improvements 2024-07-17 13:38:02 +02:00
mck
4aacab020b Implement CassandraChatMemory
- provides a flexible schema, can be combined with a vector store, and supports time-to-live rows.
 - fix initialize-schema docs and so that it actually works.
 - move CommonVectorStoreProperties to .vectorstore. package
 - add CassandraAutoConfiguration to the AutoConfiguration.imports
2024-07-17 11:42:09 +02:00
양예성
cf785e03c2 Added information about models that are no longer supported
We have added information for reference as there are examples of models that are scheduled to end support.
2024-07-17 11:18:22 +02:00
Christian Tzolov
b36ee13e02 Docs: OpenAI Replace GPT_4_VISION_PREVIEW by GPT_4_O 2024-07-17 11:16:31 +02:00
Sinsy
c9a3e66f90 fix: test name error (#1035)
* fix: test name error

* fix: test name error
2024-07-17 11:07:30 +02:00
Fu Cheng
0ebf4abc2c Fix not-null assertion 2024-07-17 11:03:26 +02:00
Eddú Meléndez
0a42bf01f3 Fix assertions 2024-07-17 11:01:37 +02:00
John Blum
f783796934 Correct grammar in RAG and Function Calling sections
Resolves #1060
2024-07-17 11:01:08 +02:00
Christian Tzolov
feb036d2f6 Add high-level function calling support for Azure OpenAI
- follow the timostark advise to replace skip(1) by filter empty choices

 Resolves #613, #1042
2024-07-16 22:22:24 +02:00
Christian Tzolov
39164ad111 Disable function calling docs ZhiPu AI until proven it works 2024-07-16 20:11:28 +02:00
Christian Tzolov
697a04b6d0 Moonshot: No Function Calling support verificaiton
Update the docs and tests to verify that currently Moonshot ChatModel does not
 support Function Calling.

 Related to #1058
2024-07-16 17:55:28 +02:00
Christian Tzolov
18cdeee092 Add high-level function calling support for Mistral AI 2024-07-16 16:18:16 +02:00
Johnny Lim
7c26c7bcdf Polish 2024-07-16 10:05:28 +02:00
Christian Tzolov
87dc3be739 Extend the CreateGeminiRequestTests for tool config tests 2024-07-16 10:00:01 +02:00
Christian Tzolov
df7ac05235 Correct repetitive entries in the documentation catalog 2024-07-16 09:40:57 +02: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