Commit Graph

1453 Commits

Author SHA1 Message Date
Thomas Vitale
4b123a7516 Use Double instead of Float for portable ChatOptions
This change updates the type of portable chat options from Float to
Double. Affected options include:
- frequencyPenalty
- presencePenalty
- temperature
- topP

The motivation for this change is to simplify coding. In Java, Float
values require an "f" suffix (e.g., 0.5f), while Double values don't
need any suffix. This makes Double easier to type and reduces
potential errors from forgetting the "f" suffix.

APIs, tests, and documentation have been updated to reflect this
change.

Fixes gh-712

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-09-16 15:35:51 -04:00
Christian Tzolov
40714c984d Make JsonReader thread-safe
Resolves #1365
2024-09-16 13:34:39 +02:00
Laura Trotta
5a3521330f adding version to header, fix 2024-09-12 18:47:56 +02:00
Christian Tzolov
df17f08f5b Udate onnx-runtime to 1.19.2 and djl to 0.29.0 2024-09-11 18:07:12 +02:00
Christian Tzolov
0041afac99 Set default advise stream response mode to on-finish 2024-09-11 12:09:42 +02:00
Laura Trotta
67c55cbcbe Added Elasticsearch Vector Store Unit Test (#1339)
* add and delete unit test
* format
2024-09-10 11:39:46 -04:00
Laura Trotta
c658c7b52e GH-1341: Fixing bug in TokenCountBatchingStrategy
Fixes: https://github.com/spring-projects/spring-ai/issues/1341

* Instead of clearing the current batch, create a new instance each time it needs to be reset
* added author
2024-09-10 11:35:24 -04:00
Eddú Meléndez
9f33e326b1 Add spring-ai-spring-boot-docker-compose to BOM
Fixes #1314
2024-09-10 14:01:24 +02:00
Eddú Meléndez
667ef76037 Fix cassandra starter 2024-09-10 13:59:33 +02:00
Christian Tzolov
b22a577ebc Add message history ITs for few chat models 2024-09-10 12:08:57 +02:00
Christian Tzolov
b5c7975fac Add test for #1317
add integration test for https://github.com/spring-projects/spring-ai/pull/1317
2024-09-10 11:23:17 +02:00
Peter Dolukhanov
26c5674acb Fix where previous Assistant Messages were not being added to the parts list.
Results in: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Unable to submit request because it must include at least one parts field, which describes the prompt input. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini
2024-09-10 11:18:36 +02:00
Craig Walls
2a62235f73 Add Markdown document reader to Spring AI BOM 2024-09-09 18:10:33 -04:00
GR
b38cbe6386 Enhance MiniMax chat model compatibility and add tests
- Add web search mode response in choice.message for enhanced
compatibility
- Implement web search mode for stream mode
- Add comprehensive unit tests for new features

Related to #1292

feat: enhance the compatibility of the minimax model and tests, related issue #1292
2024-09-09 17:56:04 -04:00
inpink
897a4114f5 Fix Javadoc comments in OpenAiAudioApi and OpenAiApi
- Correct OpenAiAudioApi Javadoc: remove chat completion reference
- Add missing @param for webClientBuilder in OpenAiApi constructor
2024-09-09 17:48:05 -04:00
Mark Pollack
3c9ae4e1d6 fix javadoc build in CI 2024-09-09 16:51:40 -04:00
Soby Chacko
15fdd05fac Add batching for more vector stores
Apply batching when adding Documents to the following vector stores:

- Chroma
- ElasticSearch
- Neo4j
- Qdrant
- Redis
- Typesense
- Weaviate

This improves efficiency by processing multiple Documents at once instead of individually, reducing the overhead for each operation.

Related to #1261
2024-09-09 15:28:22 -04:00
Laura Trotta
4f62ac1cee GH-1316: Elasticsearch vector store - Wrong error reported fix
Fixes: https://github.com/spring-projects/spring-ai/issues/1316

* Handling missing index case
* Docs update
* User header for observability
* Same exception management for delete
2024-09-09 11:58:29 -04:00
Christian Tzolov
5b6a60db9a Disable javadock lint 2024-09-07 12:26:48 +02:00
Christian Tzolov
da5ad96d57 fix javadoc erros 2024-09-05 21:58:09 +02:00
Christian Tzolov
28276d14a4 Refactor Advisor Interfaces and add AroundAdvisor support
Refactoring and enhancements to the advisor functionality.

 New Advisor interfaces in the org.springframework.ai.chat.client.advisor.api package:
 - Advisor: Base interface for all advisor types.
 - RequestAdvisor: For advising on request data before execution.
 - ResponseAdvisor: For advising on response data after execution, with enhanced streaming modes.
 - CallAroundAdvisor and StreamAroundAdvisor: For around advice on synchronous and streaming requests respectively.
 - AroundAdvisorChain and DefaultAroundAdvisorChain: To manage chaining of around advisors.

 Advisor Chain and Prompt Generation:
 - Added the DefaultAroundAdvisorChain class to manage the sequence of advisors applied around chat model methods.
 - Adjusted the prompt generation (toPrompt) to integrate with the refactored AdvisedRequest object.

 Refactoring and Updates:
 - Replaced the deprecated RequestResponseAdvisor interface with RequestAdvisor and ResponseAdvisor across the spring-ai-core and test modules.
 - Updated the DefaultChatClient and related classes to use the new Advisor interface, improving modularity and consistency.
 - Refactored DefaultAdvisorSpec and DefaultChatClientRequestSpec to handle the new Advisor type, and revised advisor lists and methods accordingly.
 - Enhanced the handling of streaming responses, introducing StreamResponseMode for better control during streaming scenarios.
2024-09-05 12:35:34 -04:00
Soby Chacko
53721c642b Fix PgVectorStoreWithChatMemoryAdvisorIT from batching changes 2024-09-05 11:26:38 -04:00
fk
2c1f36c725 Fix problem with VectorStoreChatMemoryAdvisor using pgvector
- add integration test
2024-09-05 15:37:59 +02:00
Soby Chacko
087de16cfc Add batching strategy for embedding documents in PgVectorStore
- Precompute all embeddings using a BatchingStrategy before inserting into the vector store

This optimization improves efficiency when adding multiple documents

Related to #1261
2024-09-04 17:23:39 -04:00
Soby Chacko
73d0b301d6 Enhance TokenCountBatchingStrategy with reserve percentage
- Precompute document token counts before batching into List<List<Document>>
- Introduce configurable reserve percentage for max input token count

Resolves #1260
2024-09-04 17:01:04 -04:00
Craig Walls
3cab5bd009 Autowire WebClient.Builder into OllamaApi 2024-09-04 14:11:21 -04:00
Christian Tzolov
bf8dabfb11 Improve stream advisor processing
* Fixes an issue with advisor name resolution
* Streamlines repeating code
* Add a new advisor strategy for ON_FINISH_REASON streaming responses, which is used by the Q&A advisor
* Improve observable instrumentation by passing the parent observation to the advisor observation
2024-09-03 21:41:36 -04:00
Thomas Vitale
37c34507cf Improve docs for foundational topics (#1279)
* Improve syntax and grammar
* Fix examples using latest APIs
* Add missing info about newer features

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2024-08-27 16:47:22 -04:00
Mark Pollack
e1884d1d92 Next development version 2024-08-23 18:47:37 -04:00
Mark Pollack
43ad2bdb97 Release version 1.0.0-M2 2024-08-23 18:46:58 -04:00
Mark Pollack
2f46f04983 disable javadoc linting 2024-08-23 12:55:47 -04:00
Mark Pollack
449790f73a Update to Boot 3.3.3
Add to docs that spring ai supports 3.2.x and 3.3.x
2024-08-23 12:37:01 -04:00
Mark Pollack
a89b938def Make PDF Reader classes more customizable for assigning custom metadata 2024-08-23 12:23:18 -04:00
GR
4fac212b0d Add web search capability to MiniMax model
Implement web search functionality for the MiniMax model.
Includes unit tests
This enhancement expands the model's ability to access and utilize current information from the internet.

Resolves #1245
2024-08-23 12:17:45 -04:00
GR
0927bd197d Fix MiniMax model function call implementation
Implement function call capability for MiniMax model and add unit tests based on new tool classes.
Address most scenarios, but note limitations in complex English contexts
with multiple function calls. Weather query example: may stop
prematurely when querying multiple locations due to single-location
parameter limit. This behavior stems from model performance constraints.

Streaming function calling is not passing tests, will be address seperately.

Resolves #1077

Implement function call capability for the Moonshot model. Include unit
tests to verify the new functionality. This feature addresses the
requirements outlined in issue #1058.
fix: MiniMax function call

review
2024-08-23 12:03:33 -04:00
GR
611c9493e3 Add function call support for Moonshot model
Implement function call capability for the Moonshot model. Include unit
tests to verify the new functionality.

Resolves #1058
2024-08-23 11:43:07 -04:00
GR
935e1a38ed Add ZhiPu model support for AbstractToolCallSupport
Implement ZhiPu function call to work with AbstractToolCallSupport
framework. Add unit tests for function call functionality.

Resolves #1078.
2024-08-23 11:12:21 -04:00
Szymon Ochnio
197fe8105c Fix Azure chat client image handling for byte arrays
Resolve issue with AzureOpenAiChatModel processing non-public images as
byte arrays. Implement handling for both URL strings and byte arrays,
converting latter to base64 encoded data URLs. Add test case for
resource-based media data. Update documentation with sample for
classpath resources.
2024-08-23 10:50:24 -04:00
Fu Cheng
8469d7dc27 Upgrade to Apache Tika 3.0.0-BETA2 2024-08-23 10:03:17 -04:00
Christian Tzolov
99a4fec214 Remove the reactive advisor observability support
-  Add Anthropic WebClient.Builder autoconfiguration to activate the OOTB WebClient obsercabilty support.
2024-08-23 09:57:49 -04:00
Josh Long
9dbb39ac4a pincecone vector aot hints 2024-08-23 00:26:50 -07:00
Mark Pollack
793052c2e9 Add googleSearchRetrieval as an option for VertexAIGeminiChatOptions
- Add test
2024-08-22 19:26:36 -04:00
KimMinjeong
bc55bc7196 Add responseMimeType option in VertexAiGeminiChatOptions
- Add test
2024-08-22 18:48:59 -04:00
Mohammed, Ahmed yousri salama (Canada)
189468127c Implement OpenAI Moderation model
This commit introduces the OpenAiModerationModel and related classes:

- Add OpenAiModerationModel for content moderation
- Create OpenAiModerationOptions for configuration
- Implement OpenAiModerationProperties for Spring Boot setup
- Add integration tests in OpenAiModerationModelIT
- Add documentation

Co-authored-by: hemeda3 <hemeda3@users.noreply.github.com>
2024-08-22 17:39:16 -04:00
Piotr Olaszewski
56e678c487 Add Markdown document reader with enhanced features
This commit introduces a new Markdown document reader with several
key features and improvements:

* Add support for text with various formatting elements
* Implement handling for horizontal rules and hard line breaks
* Add functionality for inline and block code sections
* Incorporate blockquote handling
* Support ordered and unordered lists
* Introduce additional metadata capabilities
* Include JavaDocs

Update ETL documentation to reflect these new features and usage.

Fixes #105
2024-08-22 13:35:44 -04:00
Soby Chacko
a0ee10fa91 Docs for Tanzu genai cloud bindings 2024-08-22 13:25:30 -04:00
Soby Chacko
55a5033b63 Adding copyright to cloud bindings classes 2024-08-22 13:17:56 -04:00
Stuart Charlton
86cfe6158a Introduce support for GenAI for Tanzu Platform bindings.
Currently this is a PreProvisionedService with a secret derived from the TPCF service key.

Signed-off-by: Stuart Charlton <stuart.charlton@broadcom.com>
2024-08-22 13:14:38 -04:00
Soby Chacko
72011baf50 Adding ref docs for cloud bindings 2024-08-22 13:09:45 -04:00
Soby Chacko
d752b3d8d7 Gemfire vector store cleanup
- Based on the pattern established in other vector store support implementations,
  added a builder class as an inner class of the GemfireVectorStoreConfig class which
  is also moved as an inner class to GemfireVectorStore.

Based on the original PR: https://github.com/spring-projects/spring-ai/pull/1168
2024-08-22 11:34:54 -04:00