Commit Graph

838 Commits

Author SHA1 Message Date
Eric Deandrea 762a0ca79e
Backport auditing capabilities from Quarkus LangChain4j (#3679)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #3627

## Change
<!-- Please describe the changes you made. -->
Backport [auditing
capabilities](https://docs.quarkiverse.io/quarkus-langchain4j/dev/observability.html#_auditing)
from Quarkus LangChain4j.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-26 10:55:48 +02:00
JungAh Kwak 030e437db1
docs: add custom-parameters option for OpenAI (#3749)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #3629

## Change
<!-- Please describe the changes you made. -->
Add support for user-defined custom-parameters in OpenAI chat and
streaming chat models

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes (API, behaviour)
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

Co-authored-by: JungAh <70677614+Jungahgo@users.noreply.github.com>
2025-09-25 09:52:18 +02:00
Xin Wang 63f4e02c53
Introduce markdown document parser (#3732)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->
Introduce markdown document parser.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-09-24 16:44:43 +02:00
Xin Wang 4350c8e2d6
Fix typo in 'Anthropic' reference (#3731)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->
Fix typo in 'Anthropic' reference

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-09-23 16:29:30 +02:00
Mario Fusco 98a11c70d2
Introduce agents listeners (#3718)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

https://github.com/langchain4j/langchain4j/issues/3620

## Change
<!-- Please describe the changes you made. -->

This pull request introduces 2 agents listener:

1. `onAgentInvocation` invoked immediately before an agent is invoked
2. `onAgentCompletion` invoked immediatly after an agent invocation
returns

This is still a draft and in particular the documentation is still
missing because I would prefer to gather some feedback before writing
it.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-09-23 10:12:28 +02:00
Mario Fusco 7ca25005e1
Improve agentic loop exit condition (#3713)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->

This pull request improves the exit condition of the agentic workflow
loop in 2 ways, optionally allowing to:

1. Also have the loop counter in the exit predicate
2. Testing the exit condition only at the end of the loop, instead of
after each agent invocation as it does by default

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-09-23 09:04:50 +02:00
Dmytro Liubarskyi 6035007b22
AI Service: option to pass extra parameters into and between Tool/ToolProvider/RAG components (#3569)
## Issue
Closes #1122
Closes #3545

## Change
- Introduced `InvocationContext` class. It represents the context of a
single AI Service invocation. A new instance is created each time an AI
Service method is invoked, and it exists until the end of the AI Service
invocation, potentially spanning multiple calls to the `ChatModel`.
- Introduced `InvocationParameters` class. It represents arbitrary
parameters available during a single AI Service invocation.
`InvocationParameters` can be specified when invoking the AI Service, as
well as used to pass data between AI Service components (e.g., between
tools, RAG components, etc.) in scope of a single AI Service invocation.
- Extended `ToolExecutor` API to be able to accept `InvocationContext`
with `InvocationParameters` as well as return extra data in addition to
the textual tool execution result.

See the updated documentation for more info:
[1](https://github.com/langchain4j/langchain4j/pull/3569/files#diff-9ca302b5805896cdeaec9345077d7d34ca9d203a9a62e017eb70c6445e869ae0),
[2](https://github.com/langchain4j/langchain4j/pull/3569/files#diff-9024e7c5e272c39c17a09b8f6240dee04df878e956ce1589d3fb651c510d451d)

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-09-19 16:11:59 +02:00
Dmytro Liubarskyi ea1f90927f docu: updated versions to 1.5.0 and 1.5.0-beta11 2025-09-16 13:35:42 +02:00
Dmytro Liubarskyi 69cd7f5bfe Anthropic: added the ability to turn off parallel tool calls and improved the toolChoice implementation (#3401) 2025-09-15 18:52:21 +02:00
Claudio Silva Junior 9d666c0cb4
Anthropic: added the ability to turn off parallel tool calls and improved the toolChoice implementation (#3401)
## Change
Issue https://github.com/langchain4j/langchain4j/issues/3290

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-15 18:26:43 +02:00
Jan Martiska 2ed7049a0a
Initial MCP registry client implementation (#3684)
Just the raw implementation + basic docs + basic tests that run against
the official registry (when/if we have our own MCP registry SDK, we
might want to switch to using that)

The next step will probably be some tooling to attempt to automatically
transform MCP server metadata into usable instances of `McpTransport`
(for building an actual MCP client that talks to the server) in cases
when it's possible...

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-15 15:27:35 +02:00
Vali 1347f6ae69
Add native support for AWS Bedrock prompt caching (#3664)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/3658

## Summary
- Added native support for AWS Bedrock's prompt caching functionality
- Reduces latency by up to 85% and costs by up to 90% for cached prompts

## Changes
- Added `promptCaching(BedrockCachePointPlacement)` method to
enable/disable prompt caching and specify cache point placement
- Added `BedrockCachePointPlacement` enum with options: AFTER_SYSTEM,
AFTER_USER_MESSAGE, AFTER_TOOLS
- Added comprehensive unit tests for all new functionality

## Usage Example
```java
BedrockChatRequestParameters params = BedrockChatRequestParameters.builder()
    .promptCaching(BedrockCachePointPlacement.AFTER_SYSTEM)
    .build();
```

## Testing
- All unit tests pass
- Maintains backward compatibility with existing code
- No breaking changes

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-15 15:13:04 +02:00
minguncle c01308406a
feat(gemini): add support for image generation output from Gemini models (#3641)
## Issue
Closes  #3635

## Change
Added support for receiving generated images from Gemini's image
generation models (e.g., gemini-2.5-flash-image-preview).

**Changes made:**
- Modified `PartsAndContentsMapper.fromGPartsToAiMessage()` to process
`inlineData` containing generated image data
- Added `GeneratedImageHelper` utility class for easy access to
generated images from `AiMessage.attributes()`
- Generated images are stored in `AiMessage.attributes()` under key
"generated_images"
- Solution works for both streaming and non-streaming responses
- Maintains full backward compatibility with existing code

**Technical details:**
- Processes Gemini response parts with `inlineData` and image mime types
- Converts base64 image data to `Image` objects
- Uses existing `attributes` mechanism to avoid breaking changes
- Includes comprehensive test coverage

This enables full Gemini image generation support while preserving the
existing architecture.

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-15 11:52:39 +02:00
Julien Dubois 4874664e96
Clarify the documentation by using static imports (#3677)
This fixes a clash in import statements, for example between `import
dev.langchain4j.model.chat.ChatModel;` and `import
com.openai.models.ChatModel;`
2025-09-15 11:24:08 +02:00
Max Lepikhin a925831239
feat(anthropic): propagate user id in Anthropic models (#3670)
## Issue
Closes #3648

## Change
Added user id to Anthropic chat models, passed it in request as
`metadata.user_id` per [Anthropic
docs](https://docs.anthropic.com/en/api/messages#body-metadata).


## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

Signed-off-by: Max Lepikhin <mlepikhin@gmail.com>
2025-09-11 10:24:19 +02:00
Michal Broz 9e271f8ffa
Document support A2A response types (#3640)
## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
Clarify that only A2A Tasks are currently supported by the A2A
integration (not A2A Messages)


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-09-09 16:14:56 +02:00
Andrea Di Maio 6d652ba01b
Update the watsonx.ai SDK to the latest version (#3644)
## Change
Update  the watsonx.ai SDK to the latest version


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-09-09 16:12:52 +02:00
Mario Fusco 5f172a9d68
Introduce asynchronous agents (#3643)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->

I started working on this change with the idea of making the
`HumanInTheLoop` non-blocking, meaning that the invocation is made on
another thread and the agentic system execution blocks only when the
result provided by the `HumanInTheLoop` is really necessary because it
is read as an input for another agent. Then I figured out that this
non-blocking feature was quite useful, so I decided to extend it to all
agents. In this way, for instance, it is possible to achieve a parallel
execution without using the parallel workflow, but simply putting the
non-blocking agents in sequence.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-09 15:27:49 +02:00
Dmytro Liubarskyi 3f8dc121dc Fix #3372 2025-09-08 16:40:15 +02:00
Dmytro Liubarskyi 8358ccf735 #3647: Introduce a raw JSON-schema element (#3374) 2025-09-08 15:18:04 +02:00
Harikrishna e900f3f718
Add missing StyleEditor implementation in Agents tutorial (#3611)
### Summary
The Agents tutorial references a `StyleEditor` agent but does not
include its implementation.
This PR adds the missing `StyleEditor` interface, making the tutorial
complete and runnable.

### Details
The implementation was adapted from the example in  

[`Agents.java`](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-agentic-a2a/src/test/java/dev/langchain4j/agentic/a2a/Agents.java).

### Why
- Completes the tutorial so it is self-contained.  
- Reduces confusion for new users.  
- Maintains consistency with other agent interfaces such as
`AudienceEditor`.

Co-authored-by: Harikrishna <harikrishna.gurram@walmart.com>
2025-08-29 11:22:54 +02:00
Dmytro Liubarskyi 0d2fdaa65b docu: updated versions to 1.4.0 and 1.4.0-beta10 2025-08-28 16:43:13 +02:00
Andrea Di Maio 72926b846e
Update watsonx.ai SDK and implement tokenization methods (#3605)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Update the watsonx.ai SDK and implement the tokenization methods

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-08-28 08:10:44 +02:00
Sandra Ahlgrimm 5146f5a0bf
Add azure openai audio (#2110)
Hi! I have started with the audio transcription and would like to get
feedback to ensure I'm heading in the right direction, as this is my
first PR for this project.

## Issue
Closes #255

## Change
Add Azure OpenAI

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Mohamed <mohamed.aitabderrahman@gmail.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-08-27 21:47:38 +02:00
Giuseppe Villani 884bf29d84
added neo4j follow-up query docs (#3583)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes https://github.com/langchain4j/langchain4j-community/issues/269

## Change
<!-- Please describe the changes you made. -->

Added documentation about how to execute a Neo4j follow-up query after
an embedding search.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-27 17:43:18 +02:00
Dmytro Liubarskyi 8ef22bcd59 Add support for counting tokens in Anthropic API (#3381) 2025-08-27 17:31:25 +02:00
Mario Fusco 4839794d98
Implement return behavior for tools (#3069)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/124

## Change
This is a rework from scratch of what has been done in
https://github.com/langchain4j/langchain4j/pull/2291 and
https://github.com/langchain4j/langchain4j/pull/2772 also based on the
comments made during the review of those pull requests.

As I described in the Javadocs, here I added a `ReturnBehavior` enum
(names are very questionable and I'm open to change them if you have
better proposals) implementing 3 different behaviors for tools:

```
    /**
     * Return behavior of the tool.
     * - If {@link ReturnBehavior#TO_LLM} is used (default), the value returned by the tool is sent back to the LLM for further processing.
     *   The LLM invocation will directly return the value returned by the last invoked tool, instead of the one further manipulated by the LLM,
     *   if and only if all the tools invoked by the LLM to fulfill the request are marked with {@link ReturnBehavior#DIRECT}.
     * - If {@link ReturnBehavior#IMMEDIATE} is used, returns immediately to the caller the value returned by the tool without
     *   allowing the LLM to further processing it.
     *
     * @return return behavior of the tool.
     */
    ReturnBehavior returnBehavior() default ReturnBehavior.TO_LLM;
```

The tests that I added should also help to clarify how this works.

Regarding the actual need for this feature, what has been discussed in
[this
article](https://quarkus.io/blog/agentic-ai-with-quarkus-p3/#comparing-the-workflow-and-agentic-approaches)
provides another example of a situation where this could be useful.

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-08-27 16:32:32 +02:00
Dmytro Liubarskyi 195cff4be2 AiSerivce support dev.langchain4j.data.messag.Content (#3420) 2025-08-27 15:15:52 +02:00
Andrea Di Maio a42c5ef24a
Integrate watsonx.ai module (#3423)
Closes #2050
Closes #2124

## Change
This is my first contribution to this repository, so there might be
something I've missed. Let me know! 😄


## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (**I have to
create a new PR**)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
- [x] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`
2025-08-27 13:37:45 +02:00
Robikz 05e3ec78ef
Allow to evict or completely disable the tool list cache in DefaultMcpClient (#3578)
## Issue
Closes #3573 

## Change

- Add `DefaultMcpClient.evictToolListCache()`
- Add `DefaultMcpClient.Builder.cacheToolList()`
- Add tests for all of that, plus tests for
`DefaultMcpClient.listTools()`

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
2025-08-27 10:35:57 +02:00
Silwings df4c31cf47
Docs: fix typo in pom type configuration tag (#3597)
## Issue

Fixes #3596

## Change

Fix typo in pom type configuration tag

Corrects a typo in the documentation where the XML tag for pom type was
incorrectly written as `<typ>pom</typ>` instead of the proper
`<type>pom</type>`.

This change:
- Fixes invalid XML syntax in the configuration example
- Ensures consistency with standard Maven configuration conventions
- Prevents potential implementation issues when developers copy-paste
the snippet

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-27 10:06:43 +02:00
Mario Fusco 8a19b7c3a4
Allows to programmatically define the name and description of an agent (#3594)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

https://github.com/langchain4j/langchain4j/issues/3532

## Change
<!-- Please describe the changes you made. -->

Allows to programmatically define the name and description of an agent

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-26 16:43:24 +02:00
Mario Fusco d1eea51db2
Add missing features to agentic declarative API (#3587)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

https://github.com/langchain4j/langchain4j/discussions/3509

## Change
<!-- Please describe the changes you made. -->

This pull request adds missing features the declarative API of the
agentic module.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-26 11:34:14 +02:00
Dmytro Liubarskyi 64c4197e36
AI Service: introduce tool arguments and tool execution error handlers (#3536)
## Issue
Closes #3363

## Change
Introduced `ToolArgumentsErrorHandler` and `ToolExecutionErrorHandler`
that can be configured on the AI Service to handle errors related to
tools:
- when tool arguments cannot be parsed/prepared in order to execute a
tool
- when something wrong happens during tool execution

Currently, there are two ways to handle errors:
1. Throw an exception: this will stop the AI service flow.
2. Return a text message (e.g., an error description) that will be sent
back to the LLM,
allowing it to respond appropriately (for example, by correcting the
error and retrying).

## Example

```java
Assistant assistant = AiServices.builder(Assistant.class)
    .chatModel(chatModel)
    .tools(tools)
    .toolArgumentsErrorHandler((error, context) -> ToolErrorHandlerResult.text("Can't parse tool arguments: " + error.getMessage()))
    .toolExecutionErrorHandler((error, context) -> ToolErrorHandlerResult.text("Can't execute tool: " + error.getMessage()))
    .build();
```

## Breaking Changes
This PR requires breaking changes in
`DefaultMcpClient.executeTool(ToolExecutionRequest)`: instead of
returning strings with error messages, `ToolArgumentsException`,
`ToolExecutionException` or `RuntimeException` will be thrown in case of
errors.

## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-08-25 17:24:11 +02:00
Mario Fusco cf33ae3761
Use a pool of virtual threads as internal default executor (#3541)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change

The vast majority of long running operations, eventually running in
parallel, are I/O tasks and for this reason it is very beneficial to
execute them on virtual threads.

This pull request introduces a default executor, that should be used by
all parallel operations performed by langchain4j. When possible, i.e.
when running on Java 21+, this executor is a pool of virtual threads,
otherwise normal cached platform threads are used.

This pull request also contains a minor change in the agentic parallel
workflow, making it to use a more generic `Executor` instead of a more
restrictive `ExecutorService`.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-25 11:49:26 +02:00
Hoang Nam 91b0b18355
Inject business/domain context into the planning phase (#3527)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Open #3526 

## Change
- Add `businessContext` variable to help planning process more powerful
when handling real business
- Updated document
- Updated test


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: Mario Fusco <mario.fusco@gmail.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-08-20 10:33:56 +02:00
Don Bourne 7171cb38d6
minor wording fixes (#3518)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
This is a PR to fix some minor wording problems. There is no
corresponding issue.

## Change
<!-- Please describe the changes you made. -->
Fixes minor wording problems in new agents.md file in the tutorial.

## General checklist

Not applicable. No code changes included in this PR (changes are all in
a .md file).

<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-13 18:10:35 +02:00
Jan Martiska 46dcc007de
Streamable HTTP transport for MCP (#3534) 2025-08-13 18:09:39 +02:00
Dmytro Liubarskyi b301c77ac5 Introduce a raw JSON-schema element ♻️(#3374) 2025-08-12 18:05:27 +02:00
Reguel b010f0c156
Introduce a raw JSON-schema element ♻️ (#3374)
## Issue
Closes #

## Change
Added `JsonRawSchema` so that any existing raw schema (specified as a
`String`) can be used without reproducing it manually using the
`JsonSchemaElement`s builder.

Background is that we already have huge and well defined schemas in
resource-files, such as this
[process](https://json-schema.axonivy.com/process/12.0.0/process.json)
example.
Manually reproducing them is a show stopper. 

Currently supported providers:
- [X] Azure OpenAI
- [X] Mistral
- [X] Ollama
- [X] OpenAI
- [X] OpenAI Official

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-08-12 18:01:25 +02:00
Loïc Mathieu fbcb01ccb1
Allow using the MCP ToolExecutor outside of the McpToolProvider (#3494)
## Change
The `McpToolProvider` has an implementation of a `ToolExecutor` used
internally.
This PR extracts it to a `McpToolExecutor` so it can be used outside the
`McpToolProvider`.

**Why doing this?**
To register tools for an AI service, there are a lot of different ways:
- using `AiService.tools(Object...)`
- using `AiService.toolProvider(ToolProvider)`
- using `AiSerice.tools(Map<ToolSpecification, ToolExecutor>)`

We use the latter in our code as we handle dynamically multiple types of
tools (WebSearch, MCP Client, custom tools, etc.). To be able to use it,
we have our own copy of the currently private MCP ToolExecutor.

With the change of this PR, we would be able to use the newly extracted
`McpToolExecutor` to register tools using
`AiSerice.tools(Map<ToolSpecification, ToolExecutor>)` instead of
copying its code to a custom class.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-11 14:29:06 +02:00
Dmytro Liubarskyi 9dc0a67a69
AI Service: option to execute tools concurrently (#3512)
## Issue
Closes #3290

## Change
Added an option to execute tools concurrently:

```java
    /**
     * By default, when the LLM calls multiple tools, the AI Service executes them sequentially.
     * If you enable this option, tools will be executed concurrently (with one exception - see below),
     * using the default {@link Executor}.
     * You can also specify your own {@link Executor}, see {@link #executeToolsConcurrently(Executor)}.
     * <ul>
     *     <li>When using {@link ChatModel}:</li>
     *     <ul>
     *         <li>When the LLM calls multiple tools, they are executed concurrently in separate threads
     *             using the {@link Executor}.</li>
     *         <li>When the LLM calls a single tool, it is executed in the same (caller) thread,
     *             the {@link Executor} is not used to avoid wasting resources.</li>
     *     </ul>
     *     <li>When using {@link StreamingChatModel}:</li>
     *     <ul>
     *         <li>When the LLM calls multiple tools, they are executed concurrently in separate threads
     *             using the {@link Executor}.
     *             Each tool is executed as soon as {@link StreamingChatResponseHandler#onCompleteToolCall(CompleteToolCall)}
     *             is called, without waiting for other tools or for the response streaming to complete.</li>
     *         <li>When the LLM calls a single tool, it is executed in a separate thread using the {@link Executor}.
     *             We cannot execute it in the same thread because, at that point,
     *             we do not yet know how many tools the LLM will call.</li>
     *     </ul>
     * </ul>
     *
     * @return builder
     * @see #executeToolsConcurrently(Executor)
     * @since 1.4.0
     */
    public AiServices<T> executeToolsConcurrently() {
        context.toolService.executeToolsConcurrently();
        return this;
    }

    /**
     * See {@link #executeToolsConcurrently()}'s Javadoc for more info.
     * <p>
     * If {@code null} is specified, the default {@link Executor} will be used.
     *
     * @param executor The {@link Executor} to be used to execute tools.
     * @return builder
     * @see #executeToolsConcurrently()
     * @since 1.4.0
     */
    public AiServices<T> executeToolsConcurrently(Executor executor) {
        context.toolService.executeToolsConcurrently(executor);
        return this;
    }
```

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-08-11 11:47:04 +02:00
Mario Fusco a2dd99a6dd
Remove unwanted links from images in tutorials (#3517)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-08 17:56:33 +02:00
Mario Fusco 730d00ece7
minor fix to agents tutorial (#3504)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-08-07 15:10:49 +02:00
Dmytro Liubarskyi b2d626e898 docu: updated versions to 1.3.0 and 1.3.0-beta9 2025-08-07 14:12:31 +02:00
Dmytro Liubarskyi fa39ba77d0 docu: updated versions to 1.3.0 and 1.3.0-beta9 2025-08-07 13:42:06 +02:00
Dmytro Liubarskyi f6cd1050e4 docu: updated versions to 1.3.0 and 1.3.0-beta9 2025-08-07 13:32:42 +02:00
Dmytro Liubarskyi 01a93eb34f docu: updated versions to 1.3.0 and 1.3.0-beta9 2025-08-07 13:27:43 +02:00
Mario Fusco bbf9262325
Introduce new langchain4j-agentic module (#3458)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
This pull request introduces the new experimental `langchain4j-agentic`
module. The new module is built on top of the existing code and doesn't
affect it in any way.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-08-07 11:13:02 +02:00
zhao 617280c24f
Add doc for beforeToolExecution for Token Stream (#3476) 2025-08-05 11:21:13 +03:00
Katia Aresti ee73d13d07
Docs for Infinispan Embedded Store (#3450)
Doc change for Infinispan Embedded Store
2025-07-30 10:24:00 +02:00
Dmytro Liubarskyi a087215726 docu: fixes 2025-07-29 17:39:47 +02:00
Dmytro Liubarskyi 29afb576e3 docu: updated to 1.2.0 version 2025-07-29 17:23:38 +02:00
Mehdi Riahi 8eb1f66310
Google Vertex AI: add custom credentials (#3393)
## Issue
Closes #3379

## Change
Add support for custom credentials in `VertexAiEmbeddingModel`,
`VertexAiChatModel`, and `VertexAiGeminiChatModel`.

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-07-29 10:11:24 +02:00
Eric Deandrea f695c35285
Introduce SPI for building instances of the InputGuardrailExecutorBuilder/OutputGuardrailExecutorBuilder instances (#3434)
Introduce SPI for building instances of the
InputGuardrailExecutorBuilder/OutputGuardrailExecutorBuilder instances

This is needed for the Quarkus integration (see
quarkiverse/quarkus-langchain4j#1284)
2025-07-28 22:05:29 +02:00
Giuseppe Villani 196187482a
Add graph transformer section (#3110)
Update documentation by adding a [GraphTransformer
interface](https://github.com/langchain4j/langchain4j-community/blob/main/langchain4j-community-core/src/main/java/dev/langchain4j/community/data/document/transformer/graph/GraphTransformer.java)
section to the RAG page.
2025-07-28 13:03:41 +02:00
camilojc 59510c5c20
document JSON Codec SPI (#3305)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #2863

## Change
<!-- Please describe the changes you made. -->
The issue reported in #2863 can be resolved by providing a custom JSON
Codec. The idea with this PR is to document the approach library users
can take to provide their codec.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-07-25 16:04:46 +02:00
dependabot[bot] 6196bfb740
Bump on-headers and compression in /docs (#3376)
Bumps [on-headers](https://github.com/jshttp/on-headers) and
[compression](https://github.com/expressjs/compression). These
dependencies needed to be updated together.
Updates `on-headers` from 1.0.2 to 1.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/jshttp/on-headers/releases">on-headers's
releases</a>.</em></p>
<blockquote>
<h2>1.1.0</h2>
<h2>Important</h2>
<ul>
<li>Fix <a
href="https://www.cve.org/CVERecord?id=CVE-2025-7339">CVE-2025-7339</a>
(<a
href="https://github.com/jshttp/on-headers/security/advisories/GHSA-76c9-3jph-rj3q">GHSA-76c9-3jph-rj3q</a>)</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>Migrate CI pipeline to GitHub actions by <a
href="https://github.com/carpasse"><code>@​carpasse</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/12">jshttp/on-headers#12</a></li>
<li>fix README.md badges by <a
href="https://github.com/carpasse"><code>@​carpasse</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/13">jshttp/on-headers#13</a></li>
<li>add OSSF scorecard action by <a
href="https://github.com/carpasse"><code>@​carpasse</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/14">jshttp/on-headers#14</a></li>
<li>fix: use <code>ubuntu-latest</code> as ci runner by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/jshttp/on-headers/pull/19">jshttp/on-headers#19</a></li>
<li>ci: apply OSSF Scorecard security best practices by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/jshttp/on-headers/pull/20">jshttp/on-headers#20</a></li>
<li>👷 add upstream change detection by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/31">jshttp/on-headers#31</a></li>
<li> add script to update known hashes by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/32">jshttp/on-headers#32</a></li>
<li>💚 update CI - add newer node versions by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/33">jshttp/on-headers#33</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/carpasse"><code>@​carpasse</code></a>
made their first contribution in <a
href="https://redirect.github.com/jshttp/on-headers/pull/12">jshttp/on-headers#12</a></li>
<li><a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
made their first contribution in <a
href="https://redirect.github.com/jshttp/on-headers/pull/19">jshttp/on-headers#19</a></li>
<li><a href="https://github.com/ctcpip"><code>@​ctcpip</code></a> made
their first contribution in <a
href="https://redirect.github.com/jshttp/on-headers/pull/31">jshttp/on-headers#31</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0">https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/jshttp/on-headers/blob/master/HISTORY.md">on-headers's
changelog</a>.</em></p>
<blockquote>
<h1>1.1.0 / 2025-07-17</h1>
<ul>
<li>Fix <a
href="https://www.cve.org/CVERecord?id=CVE-2025-7339">CVE-2025-7339</a>
(<a
href="https://github.com/jshttp/on-headers/security/advisories/GHSA-76c9-3jph-rj3q">GHSA-76c9-3jph-rj3q</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4b017af88f"><code>4b017af</code></a>
1.1.0</li>
<li><a
href="b636f2d08e"><code>b636f2d</code></a>
♻️ refactor header array code</li>
<li><a
href="3e2c2d46c3"><code>3e2c2d4</code></a>
 ignore falsy header keys, matching node behavior</li>
<li><a
href="172eb41b99"><code>172eb41</code></a>
 support duplicate headers</li>
<li><a
href="c6e384908c"><code>c6e3849</code></a>
🔒️ fix array handling</li>
<li><a
href="6893518341"><code>6893518</code></a>
💚 update CI - add newer node versions</li>
<li><a
href="56a345d82b"><code>56a345d</code></a>
 add script to update known hashes</li>
<li><a
href="175ab21715"><code>175ab21</code></a>
👷 add upstream change detection (<a
href="https://redirect.github.com/jshttp/on-headers/issues/31">#31</a>)</li>
<li><a
href="ce0b2c8fcd"><code>ce0b2c8</code></a>
ci: apply OSSF Scorecard security best practices (<a
href="https://redirect.github.com/jshttp/on-headers/issues/20">#20</a>)</li>
<li><a
href="1a38c543e7"><code>1a38c54</code></a>
fix: use <code>ubuntu-latest</code> as ci runner (<a
href="https://redirect.github.com/jshttp/on-headers/issues/19">#19</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~ulisesgascon">ulisesgascon</a>, a new
releaser for on-headers since your current version.</p>
</details>
<br />

Updates `compression` from 1.7.5 to 1.8.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/compression/releases">compression's
releases</a>.</em></p>
<blockquote>
<h2>v1.8.1</h2>
<h2>What's Changed</h2>
<ul>
<li>fix(docs): update multiple links from http to https by <a
href="https://github.com/Phillip9587"><code>@​Phillip9587</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/222">expressjs/compression#222</a></li>
<li>ci: add dependabot for github actions by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/207">expressjs/compression#207</a></li>
<li>build(deps): bump github/codeql-action from 2.23.2 to 3.28.15 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/228">expressjs/compression#228</a></li>
<li>build(deps): bump ossf/scorecard-action from 2.3.1 to 2.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/229">expressjs/compression#229</a></li>
<li>build(deps-dev): bump eslint-plugin-import from 2.26.0 to 2.31.0 by
<a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/230">expressjs/compression#230</a></li>
<li>build(deps-dev): bump supertest from 6.2.3 to 6.3.4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/231">expressjs/compression#231</a></li>
<li>[StepSecurity] ci: Harden GitHub Actions by <a
href="https://github.com/step-security-bot"><code>@​step-security-bot</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/235">expressjs/compression#235</a></li>
<li>build(deps): bump github/codeql-action from 3.28.15 to 3.29.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/243">expressjs/compression#243</a></li>
<li>build(deps): bump actions/upload-artifact from 4.3.1 to 4.6.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/239">expressjs/compression#239</a></li>
<li>build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/240">expressjs/compression#240</a></li>
<li>build(deps): bump actions/checkout from 4.1.1 to 4.2.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/241">expressjs/compression#241</a></li>
<li>build(deps-dev): bump eslint-plugin-import from 2.31.0 to 2.32.0 by
<a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/244">expressjs/compression#244</a></li>
<li>deps: on-headers@1.1.0 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/246">expressjs/compression#246</a></li>
<li>Release: 1.8.1 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/247">expressjs/compression#247</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
made their first contribution in <a
href="https://redirect.github.com/expressjs/compression/pull/228">expressjs/compression#228</a></li>
<li><a
href="https://github.com/step-security-bot"><code>@​step-security-bot</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/compression/pull/235">expressjs/compression#235</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/compression/compare/1.8.0...v1.8.1">https://github.com/expressjs/compression/compare/1.8.0...v1.8.1</a></p>
<h2>v1.8.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Refactor chunkLength function for improved readability and
consistency by <a
href="https://github.com/Ayoub-Mabrouk"><code>@​Ayoub-Mabrouk</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/203">expressjs/compression#203</a></li>
<li>Refactor toBuffer function to simplify buffer check logic by <a
href="https://github.com/Ayoub-Mabrouk"><code>@​Ayoub-Mabrouk</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/201">expressjs/compression#201</a></li>
<li>ci: add CodeQL (SAST) by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/204">expressjs/compression#204</a></li>
<li>Use headersSent instead of _header by <a
href="https://github.com/maritz"><code>@​maritz</code></a> in <a
href="https://redirect.github.com/expressjs/compression/pull/129">expressjs/compression#129</a></li>
<li>Bugfix/use write head instead of implicit header by <a
href="https://github.com/Icehunter"><code>@​Icehunter</code></a> in <a
href="https://redirect.github.com/expressjs/compression/pull/170">expressjs/compression#170</a></li>
<li>feat: add default option by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/191">expressjs/compression#191</a></li>
<li>ci: update ci workflow by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/206">expressjs/compression#206</a></li>
<li>feat: support for brotli by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/194">expressjs/compression#194</a></li>
<li>docs: improve readme by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/209">expressjs/compression#209</a></li>
<li>docs: keywords field by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/210">expressjs/compression#210</a></li>
<li>refactor: simplify encoding negotiation logic by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/213">expressjs/compression#213</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/Ayoub-Mabrouk"><code>@​Ayoub-Mabrouk</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/compression/pull/203">expressjs/compression#203</a></li>
<li><a href="https://github.com/maritz"><code>@​maritz</code></a> made
their first contribution in <a
href="https://redirect.github.com/expressjs/compression/pull/129">expressjs/compression#129</a></li>
<li><a href="https://github.com/Icehunter"><code>@​Icehunter</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/compression/pull/170">expressjs/compression#170</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/compression/compare/1.7.5...v1.8.0">https://github.com/expressjs/compression/compare/1.7.5...v1.8.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/compression/blob/master/HISTORY.md">compression's
changelog</a>.</em></p>
<blockquote>
<h1>1.8.1 / 2025-07-17</h1>
<ul>
<li>deps: on-headers@~1.1.0
<ul>
<li>Fix <a
href="https://www.cve.org/CVERecord?id=CVE-2025-7339">CVE-2025-7339</a>
(<a
href="https://github.com/expressjs/on-headers/security/advisories/GHSA-76c9-3jph-rj3q">GHSA-76c9-3jph-rj3q</a>)</li>
</ul>
</li>
</ul>
<h1>1.8.0 / 2025-02-10</h1>
<ul>
<li>Use <code>res.headersSent</code> when available</li>
<li>Replace <code>_implicitHeader</code> with <code>writeHead</code>
property</li>
<li>add brotli support for versions of node that support it</li>
<li>Add the enforceEncoding option for requests without
<code>Accept-Encoding</code> header</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="83a0c45fe1"><code>83a0c45</code></a>
1.8.1</li>
<li><a
href="ce62713129"><code>ce62713</code></a>
deps: on-headers@1.1.0 (<a
href="https://redirect.github.com/expressjs/compression/issues/246">#246</a>)</li>
<li><a
href="f4acb23985"><code>f4acb23</code></a>
build(deps-dev): bump eslint-plugin-import from 2.31.0 to 2.32.0 (<a
href="https://redirect.github.com/expressjs/compression/issues/244">#244</a>)</li>
<li><a
href="6eaebe63f2"><code>6eaebe6</code></a>
build(deps): bump actions/checkout from 4.1.1 to 4.2.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/241">#241</a>)</li>
<li><a
href="37e062312f"><code>37e0623</code></a>
build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/240">#240</a>)</li>
<li><a
href="bc436b2628"><code>bc436b2</code></a>
build(deps): bump actions/upload-artifact from 4.3.1 to 4.6.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/239">#239</a>)</li>
<li><a
href="2f9f572675"><code>2f9f572</code></a>
build(deps): bump github/codeql-action from 3.28.15 to 3.29.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/243">#243</a>)</li>
<li><a
href="5f13b148d2"><code>5f13b14</code></a>
[StepSecurity] ci: Harden GitHub Actions (<a
href="https://redirect.github.com/expressjs/compression/issues/235">#235</a>)</li>
<li><a
href="76e0945481"><code>76e0945</code></a>
build(deps-dev): bump supertest from 6.2.3 to 6.3.4 (<a
href="https://redirect.github.com/expressjs/compression/issues/231">#231</a>)</li>
<li><a
href="ae6ee809dc"><code>ae6ee80</code></a>
build(deps-dev): bump eslint-plugin-import from 2.26.0 to 2.31.0 (<a
href="https://redirect.github.com/expressjs/compression/issues/230">#230</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/expressjs/compression/compare/1.7.5...v1.8.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-25 14:50:13 +02:00
Eric Deandrea 72608da310
Introduce SPI for building instances of the GuardrailService (#3388)
An SPI for building `GuardrailService` instances.
2025-07-25 14:47:40 +02:00
Dmytro Liubarskyi 5d03cac134
AI Services: expose intermediate chat responses (#3349)
## Issue
Partially addresses #2982
([comment](https://github.com/langchain4j/langchain4j/issues/2982#issuecomment-2957510047))

## Change
AI Services: expose intermediate `ChatResponse`s in `Result<T>` and
`TokenStream` APIs.

### API changes:
- `TokenStream`: added `onIntermediateResponse(Consumer<ChatResponse>)`
callback
- `Result`: added `intermediateResponses()` and `finalResponse()`
accessors

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-07-25 14:28:03 +02:00
Dmytro Liubarskyi c194bf1d2c Support thinking/reasoning (#3380) 2025-07-24 18:14:54 +02:00
Dmytro Liubarskyi 03930ba850
Support thinking/reasoning (#3380)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/3013
Closes https://github.com/langchain4j/langchain4j/issues/2605
Closes https://github.com/langchain4j/langchain4j/issues/2472
Closes https://github.com/langchain4j/langchain4j/issues/3361
Closes https://github.com/langchain4j/langchain4j/issues/1224

## Change
Support thinking/reasoning feature in `ChatModel`/`StreamingChatModel`
API for:
- [X] [Amazon
Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-reasoning.html)
- [X]
[Anthropic](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
- [X] [DeepSeek](https://api-docs.deepseek.com/guides/reasoning_model)
(via OpenAI module)
- [X] [Gemini](https://ai.google.dev/gemini-api/docs/thinking)
- [X] [Ollama](https://ollama.com/blog/thinking)

### API changes:
- `AiMessage`: added `thinking()` field to keep thinking/reasoning text
- `AiMessage`: added generic `attributes()` field to keep
thinking/reasoning signatures (for Bedrock, Anthropic, Gemini)
- `StreamingChatResponseHandler`: added
`onPartialThinking(PartialThinking)` callback
- `TokenStream`: added `onPartialThinking(Consumer<PartialThinking>)`
callback
- `BedrockChatModel` and `BedrockStreamingChatModel`: added
`returnThinking` and `sendThinking` parameters to the builder
- `AnthropicChatModel` and `AnthropicStreamingChatModel`: added
`returnThinking` and `sendThinking` parameters to the builder
- `GoogleAiGeminiChatModel` and `GoogleAiGeminiStreamingChatModel`:
added `returnThinking` and `sendThinking` parameters to the builder
- `OllamaChatModel` and `OllamaStreamingChatModel`: added `think` and
`returnThinking` parameters to the builder
- `OpenAiChatModel` and `OpenAiStreamingChatModel`: added
`returnThinking` parameter to the builder

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [X] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring):
https://github.com/langchain4j/langchain4j-spring/pull/133
2025-07-24 16:19:46 +02:00
Dmytro Liubarskyi 85de62210d
Streaming partial tool calls (#3303)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/2790

## Change

Implemented support for streaming partial and complete tool calls in
`StreamingChatResponseHandler` by adding
2 new callbacks:

```java
/**
 * This callback is invoked each time the model generates a partial tool call,
 * which contains a single token of the tool's arguments.
 * It is typically invoked multiple times for a single tool call
 * until {@link #onCompleteToolCall(CompleteToolCall)} is eventually invoked,
 * indicating that the streaming for that tool call is finished.
 * <p>
 * Here's an example of what streaming a single tool call might look like:
 * <pre>
 * 1. onPartialToolCall(index = 0, id = "call_abc", name = "get_weather", partialArguments = "{\"")
 * 2. onPartialToolCall(index = 0, id = "call_abc", name = "get_weather", partialArguments = "city")
 * 3. onPartialToolCall(index = 0, id = "call_abc", name = "get_weather", partialArguments = ""\":\"")
 * 4. onPartialToolCall(index = 0, id = "call_abc", name = "get_weather", partialArguments = "Mun")
 * 5. onPartialToolCall(index = 0, id = "call_abc", name = "get_weather", partialArguments = "ich")
 * 6. onPartialToolCall(index = 0, id = "call_abc", name = "get_weather", partialArguments = "\"}")
 * 7. onCompleteToolCall(index = 0, id = "call_abc", name = "get_weather", arguments = "{\"city\":\"Munich\"}")
 * </pre>
 * <p>
 * If the model decides to call multiple tools, the index will increment, allowing you to correlate.
 * <p>
 * Please note that not all LLM providers stream tool calls token by token.
 * Some providers (e.g., Bedrock, Google, Mistral, Ollama) return only complete tool calls.
 * In those cases, this callback won't be invoked - only {@link #onCompleteToolCall(CompleteToolCall)}
 * will be called.
 *
 * @param partialToolCall A partial tool call that contains
 *                        the index, tool ID, tool name and partial arguments.
 * @since 1.2.0
 */
@Experimental
default void onPartialToolCall(PartialToolCall partialToolCall) {
}

/**
 * Invoked when the model has finished streaming a single tool call.
 *
 * @param completeToolCall A complete tool call that contains
 *                         the index, tool ID, tool name, and fully assembled arguments.
 * @since 1.2.0
 */
@Experimental
default void onCompleteToolCall(CompleteToolCall completeToolCall) {
}
```

Implemented support for streaming partial and complete tool calls for
the following providers:
- [x] Anthropic
- [x] Azure OpenAI
- [x] Bedrock (only complete tool calls)
- [x] Google AI Gemini (only complete tool calls)
- [x] Mistral (only complete tool calls)
- [x] Ollama (only complete tool calls)
- [x] OpenAI
- [x] OpenAI Official
- [x] Vertex AI Gemini (only complete tool calls)

Providers without this support:
- [ ] GitHub Models
- [ ] Jlama
- [ ] LocalAI


## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-07-21 15:28:46 +02:00
Mario Fusco b271b1be83
Add possibility to transform a ChatRequest before it is sent to the LLM (#3378)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
Add possibility to transform a `ChatRequest` before it is sent to the
LLM.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-07-18 12:06:20 +02:00
Dmytro Liubarskyi 5afbc92dba Add Thinking Config support for Gemini 2.5 models (#3180) 2025-07-15 12:17:08 +02:00
Dmytro Liubarskyi feb435be99 Fix anthropic cache to add cache only last item in systemMessage/Tool list (#3337) 2025-07-15 10:53:41 +02:00
0x-fang 75146d57f3
support api key authentication for Bedrock API (#3332)
## Issue
Feature #3331 

## Change
AWS Bedrock has introduced API key support on 7/7, simplifying
authentication for the Amazon Bedrock API. To enable this new feature in
langchain4j, this update bumps the required aws sdk version to
"2.31.74". It has been tested and worked as expected with new
`AWS_BEARER_TOKEN_BEDROCK` environment variable.
2025-07-14 15:24:19 +02:00
Sun Yuhan 27e7c6a225
Fixed some typo in the documentation (#3342)
Fixed two spelling errors in the document.

---------

Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
Co-authored-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
2025-07-11 19:47:41 +03:00
Jan Martiska 16daf378cd
Exposing MCP resources automatically over synthetic tools (#3302)
Fixes https://github.com/langchain4j/langchain4j/issues/2767

Wanted to get some early feedback before I proceed to creating more
tests and documentation (and probably extend it to prompts too).

The idea is that the user can now, when creating a `McpToolProvider`,
enable the `exposeResourcesAsTools` option. If this is enabled, then the
tool provider will expose two extra 'synthetic' tools:

- `list_resources` to obtain a list of all resources available for all
MCP clients that are wrapped into this tool provider
- `get_resource` to render a specific resource - it takes two arguments:
- resource URI (I chose URI instead of the name to be able to retrieve
[resource
templates](https://modelcontextprotocol.io/specification/2025-06-18/server/resources#resource-templates)
too in the same way)
  - name (`key`) of the MCP client that this resource belongs to

The result of `list_resources` is JSON and looks something like this:

```
[ {
  "mcpServer" : "alice",
  "uri" : "file:///info",
  "uriTemplate" : null,
  "name" : "basicInfo",
  "description" : "Basic information about Alice",
  "mimeType" : "text/plain"
}, {
  "mcpServer" : "bob",
  "uri" : "file:///info",
  "uriTemplate" : null,
  "name" : "basicInfo",
  "description" : "Basic information about Bob",
  "mimeType" : "text/plain"
} ]
```

I tested this with `gpt-4o-mini` and it understood how to find and
retrieve a relevant resource (see
`McpResourcesAsToolsTestBase#integrationTestWithAiService` for
demonstration)

So a resource is identified by uri AND the name of the mcp connection,
because it may happen that two servers will have resources on the same
URI.
When it's a resource, then `uri` is specified here, if it's a template,
then `uriTemplate` is specified instead.

Note: another way would be to expose a separate synthetic tool for each
resource instead of having `get_resource` over all of them. That would
render it unnecessary to invent a new JSON schema for the
`list_resources`, but I'm afraid that there will, in the real world, be
too many resources, and exposing a tool for each separately would
explode the context size.
2025-07-10 17:48:51 +02:00
Harikrishna 09992ec806
[Doc] Fix extra parenthesis in logging section of documentation (#3339) 2025-07-10 16:51:59 +03:00
Konstantin Pavlov fb2b69a79b
Refactor moderation handling and improve exception details (#3024)
# Refactor moderation handling and improve exception details

## Issue #3025 

The ModerationException does not contain structured information about
the issues flagged. The first step is to include the Moderation object
in the exception.
Next, potential improvement should be promoting ModerationResult from
the openai module to the core module and enhancing or replacing the
Moderation class.

## Change

- Update `Moderation` as a serializable class with nullable support for
flagged text.
- Enhanced `ModerationException` to include moderation details for
better debugging and testing.
- Updates include corresponding tests and minor formatting improvements
across related files.
- Updated documentation

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-07-10 11:06:08 +02:00
Lize Raes ea0e54d371
add http1.1 for LMStudio in docs (#3324)
## Issue
Fixes #3309

## Change
Updated documentation for OpenAI-compatible providers: added enforcement
of HTTP1.1 to the LMStudio example

## General checklist
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-07-09 15:25:09 +02:00
Dmytro Liubarskyi fdab2b2a99
OpenAI: allow setting custom chat request parameters and access raw HTTP responses and SSE events (#2694)
## Issue
Closes #2954

## Change

### Setting custom chat request parameters

When using `OpenAiChatModel` and `OpenAiStreamingChatModel`, one can now
set custom chat request parameters (in the JSON body of the HTTP
request). Here is an example of how to enable web search:
```java
record ApproximateLocation(String city) {}
record UserLocation(String type, ApproximateLocation approximate) {}
record WebSearchOptions(UserLocation user_location) {}
WebSearchOptions webSearchOptions = new WebSearchOptions(new UserLocation("approximate", new ApproximateLocation("London")));
Map<String, Object> customParameters = Map.of("web_search_options", webSearchOptions);

// Alternatively, custom parameters can also be specified as a structure of nested maps
Map<String, Object> customParameters = Map.of(
        "web_search_options", Map.of(
                "user_location", Map.of(
                        "type", "approximate",
                        "approximate", Map.of("city", "London")
                )
        )
);

ChatRequest chatRequest = ChatRequest.builder()
        .messages(UserMessage.from("Where can I buy good coffee?"))
        .parameters(OpenAiChatRequestParameters.builder()
                .modelName("gpt-4o-mini-search-preview")
                .customParameters(customParameters)
                .build())
        .build();

ChatModel model = OpenAiChatModel.builder()
        .apiKey(System.getenv("OPENAI_API_KEY"))
        .logRequests(true)
        .logResponses(true)
        .build();

ChatResponse chatResponse = model.chat(chatRequest);
```

This will produce an HTTP request with the following body:
```json
{
  "model" : "gpt-4o-mini-search-preview",
  "messages" : [ {
    "role" : "user",
    "content" : "Where can I buy good coffee?"
  } ],
  "web_search_options" : {
    "user_location" : {
      "type" : "approximate",
      "approximate" : {
        "city" : "London"
      }
    }
  }
}
```

### Accessing raw HTTP responses and Server-Sent Events (SSE)

One can now access the raw HTTP response (for `OpenAiChatModel`) and raw
Server-Sent Events (for `OpenAiStreamingChatModel`):
```java
// For OpenAiChatModel:
SuccessfulHttpResponse rawHttpResponse = ((OpenAiChatResponseMetadata) chatResponse.metadata()).rawHttpResponse();
System.out.println(rawHttpResponse.body());
System.out.println(rawHttpResponse.headers());
System.out.println(rawHttpResponse.statusCode());

// For OpenAiStreamingChatModel:
List<ServerSentEvent> rawServerSentEvents = ((OpenAiChatResponseMetadata) chatResponse.metadata()).rawServerSentEvents();
System.out.println(rawServerSentEvents.get(0).data());
System.out.println(rawServerSentEvents.get(0).event());
```

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-07-08 11:44:33 +02:00
Xin Wang 82b533e2f4
feat: Playwright Support (#3282)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes https://github.com/langchain4j/langchain4j/issues/3281

## Change
<!-- Please describe the changes you made. -->
Playwright Support

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-07-07 14:57:46 +02:00
Lize Raes 7a0feecb1d
Feat/OpenAI compatible docs (#3309) 2025-07-06 13:36:46 +03:00
NeatGuyCoding 1b80ed9e76
minor fix wrong example code in neo4j.md (#3292)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" -->
Closes none

## Change
<!-- Please describe the changes you made. -->
This PR fixes minor issues in the example code provided in the
`docs/docs/integrations/embedding-stores` file. Specifically:
- Corrected the annotation `@Spring BootApplication` to
`@SpringBootApplication`.
- Fixed a typo in the method call `SpringApplication.run(Spring
BootExample.class, args)` to
`SpringApplication.run(SpringBootExample.class, args)`.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and [main](https://github.com/langchain4j/langchain4j) modules, and they
are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [x] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-07-03 12:47:15 +02:00
Harikrishna 4221488fe7
Fix broken MCP doc link by updating to archived repository URL (#3243)
### Summary

The existing documentation link to the Model Context Protocol server
examples was outdated:

- **Old URL**:
https://github.com/modelcontextprotocol/servers/tree/main/src/github
- **New URL**:
https://github.com/modelcontextprotocol/servers-archived/tree/main/src/github

This PR updates the documentation to point to the correct (archived)
repository.

---------

Co-authored-by: Harikrishna <harikrishna.gurram@walmart.com>
Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
2025-06-30 14:14:04 +03:00
Jan Martiska 5f11809f04
Add some docs about using MCP without AI services (#3263)
Follow-up to the discussion in
https://github.com/langchain4j/langchain4j/issues/3262
2025-06-26 16:12:58 +02:00
Giuseppe Villani 4da12d46ed
Update documentation with Neo4j features: entity retrievers, conversation memory and graph construction feature examples (#3250)
## Change
<!-- Please describe the changes you made. -->

Update documentation with Neo4j features:
- Conversation memory:
https://github.com/langchain4j/langchain4j-community/pull/149
- Graph construction features:
https://github.com/langchain4j/langchain4j-community/pull/168
- Entity retrievers
https://github.com/langchain4j/langchain4j-community/pull/210
- cleanup: moved spring boot section below `EmbeddingStore` one, and
rearranged sections


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-06-26 16:11:48 +02:00
Mai Leonard 01da36aa5e
Fix typo in community BOM dependency declaration (#3257)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
This PR fixes a small typo in the BOM dependency declaration in the
community POM document.
2025-06-26 16:10:56 +02:00
Dmytro Liubarskyi 078e4caaa7 docu: updated versions to 1.1.0 2025-06-18 18:51:48 +02:00
Dmytro Liubarskyi abf12b6909 docu: guardrails: added note on experimental 2025-06-18 11:09:25 +02:00
Dmytro Liubarskyi c0c5fae6cd
Mistral: prepare for 1.0 (#3229)
## Change
- Removed deprecated APIs
- Deprecated constructors accepting many parameters in favour of ctors
accepting single builder
- Decreased default connect timeout from 60 to 15 seconds
- Added support for model listeners
- Implemented propagation of user exceptions from
`StreamingChatResponseHandler`'s `onPartialResponse` and
`onCompleteResponse` methods into `onError`
- Streaming models: implemented exception mapping, see
`DefaultExceptionMapper` for more info
- Slight refactoring and cleanup

## General checklist
- [ ] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-06-17 18:24:21 +02:00
Harikrishna 7aa2db311c
Clarify description of EmbeddingStore.removeAll in tutorial documenta… (#3182)
Updated the tutorial documentation to clarify the description of
`EmbeddingStore.removeAll(Collection<String> ids)`.

**Before:**
> EmbeddingStore.removeAll(Collection<String> ids) removes multiple
Embeddings from the store by ID

**After:**
> EmbeddingStore.removeAll(Collection<String> ids) removes all
embeddings from the store whose IDs are present in the given collection.

This improves clarity and aligns better with the actual method behavior.

---------

Co-authored-by: Harikrishna <harikrishna.gurram@walmart.com>
2025-06-17 15:46:19 +02:00
Harikrishna 329104aa08
Add Javadoc link to DefaultContentAggregator documentation (#3198)
### Summary

This PR adds a direct Javadoc link to the `DefaultContentAggregator`
class in the documentation, which improves the developer experience by
providing quick access to detailed API information.

### Changes

- Added Javadoc reference link:  
[DefaultContentAggregator
Javadoc](https://javadoc.io/doc/dev.langchain4j/langchain4j-core/latest/dev/langchain4j/rag/content/aggregator/DefaultContentAggregator.html)

### Impact

- Documentation only
- No code logic changes

---------

Co-authored-by: Harikrishna <harikrishna.gurram@walmart.com>
2025-06-17 15:44:55 +02:00
Arjav Desai 9f54e1604e
Update Documentation for Helidon Integration (#3207)
## Issue
Closes # 2825

## Change
Had missed updating this portion, when other docs were updated as part
of https://github.com/langchain4j/langchain4j/pull/2859


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-06-17 15:41:02 +02:00
Luis Eufrasio Teixeira Neto 203ebd6d74
[FISH-11337] : Page for payara micro integration (#3224)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
Creating a page for documenting Payara Micro integration example

## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [X] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-06-17 14:43:44 +02:00
Daniel Kec a469ad5ab0
[DOC] Oracle OCI GenAi Chat Models (#3228)
## Issue
Partially fixes #3122 

## Change
Documentation for
* langchain4j/langchain4j-community/pull/226
* langchain4j/langchain4j-community/pull/241

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`
2025-06-17 14:26:14 +02:00
Eric Deandrea 023a65c044
Input and output guardrails (#2571)
Guardrails support.

I also introduced a new `langchain4j-test` module which can be a future
place to put in some testing utilities. For now I have several
assertj-based assertion classes that can be used for asserting
guardrails. (see
https://docs.quarkiverse.io/quarkus-langchain4j/dev/guardrails.html#_unit_testing
for current details).

Additionally, I've introduced a new `integration-tests` where we can
build various sets of test suites (think things that use/need
`ServiceLoader`s). This way we can test various implementations of
things for frameworks that may extend LangChain4j (Quarkus, Spring,
etc).

I've tried to include as much "genericism" as I can into this so that
downstream frameworks can re-use this without having to re-implement.

I'll have @geoand / @cescoffier review this too before merging.

## To-do list
- [x] Initial scaffolding for being able to define guardrails
- [x] Guardrail testing utilities
- [x] Wire guardrails into `AiService`s via annotations
- [x] Wire guardrails into `AiService`s using the builder
- [x] Handle output guardrails on streaming responses
- [x] Lots of tests
- [x] Documentation

Fixes #2549

---------

Co-authored-by: Lize Raes <49833622+LizeRaes@users.noreply.github.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-06-17 11:49:54 +02:00
dependabot[bot] 226eadf41a
Bump brace-expansion from 1.1.11 to 1.1.12 in /docs (#3204)
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion)
from 1.1.11 to 1.1.12.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/juliangruber/brace-expansion/releases">brace-expansion's
releases</a>.</em></p>
<blockquote>
<h2>v1.1.12</h2>
<ul>
<li>pkg: publish on tag 1.x  c460dbd</li>
<li>fmt  ccb8ac6</li>
<li>Fix potential ReDoS Vulnerability or Inefficient Regular Expression
(<a
href="https://redirect.github.com/juliangruber/brace-expansion/issues/65">#65</a>)
c3c73c8</li>
</ul>
<hr />
<p><a
href="https://github.com/juliangruber/brace-expansion/compare/v1.1.11...v1.1.12">https://github.com/juliangruber/brace-expansion/compare/v1.1.11...v1.1.12</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c85b8ad3f5"><code>c85b8ad</code></a>
4.0.1</li>
<li><a
href="5a5cc176c0"><code>5a5cc17</code></a>
fmt</li>
<li><a
href="0b6a9781e1"><code>0b6a978</code></a>
Fix potential ReDoS Vulnerability or Inefficient Regular Expression (<a
href="https://redirect.github.com/juliangruber/brace-expansion/issues/65">#65</a>)</li>
<li><a
href="6a39bdddcf"><code>6a39bdd</code></a>
4.0.0</li>
<li><a
href="dd72a59047"><code>dd72a59</code></a>
fmt</li>
<li><a
href="278132b187"><code>278132b</code></a>
feat: use string replaces instead of splits (<a
href="https://redirect.github.com/juliangruber/brace-expansion/issues/64">#64</a>)</li>
<li><a
href="70e4c1baf9"><code>70e4c1b</code></a>
add <code>tea.yaml</code></li>
<li><a
href="b01a637b05"><code>b01a637</code></a>
3.0.0</li>
<li><a
href="9e781e913f"><code>9e781e9</code></a>
node 16 is EOL</li>
<li><a
href="6dad2093f8"><code>6dad209</code></a>
docs</li>
<li>Additional commits viewable in <a
href="https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=brace-expansion&package-manager=npm_and_yarn&previous-version=1.1.11&new-version=1.1.12)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexey Titov <33568148+Heezer@users.noreply.github.com>
2025-06-16 15:10:01 +02:00
Dmytro Liubarskyi e41cd9c64e
Anthropic: use HttpClient (#3220)
## Issue
Closes #2469

## Change
- Use customizable `HttpClient` in Anthropic module
- Replaced `AnthropicHttpException` with generic
`dev.langchain4j.exception.HttpException` and its subclasses. See more
info in `DefaultExceptionMapper`

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-06-16 14:54:37 +02:00
Dmytro Liubarskyi 2d30d5ebf6
Amazon Bedrock: prepare for 1.0 (#3217)
## Change
- Removed deprecated `Bedrock*ChatModel` model classes using invoke API
(please use `BedrockChatModel` and `BedrockStreamingChatModel` instead)
- Mapped Bedrock-specific exceptions to LC4j generic ones (see
`BedrockExceptionMapper` for more details)
- `BedrockTitanEmbeddingModel`: removed outdated default value for
`model` (please specify it explicitly)
- `BedrockStreamingChatModel`: removed `maxRetries` parameter as it has
no effect (retries are currently not supported by streaming model)
- Updated `bedrockruntime` to version `2.31.62`

## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-06-16 13:10:26 +02:00
Alexander W. 3d3aed128e
Feature: Gemini seed parameter (#2997)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
Closes #2996

## Change
- Added seed parameter to GeminiGenerationConfig
- Added parameter to GoogleAiGeminiChatModel and
GoogleAiGeminiStreamingChatModel
- Wrote some unit tests which check if the parameter is correctly set
and if the default value is also okay


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-06-13 17:54:37 +02:00
Giuseppe Villani cdc365a554
Update documentation of Neo4j's various features (#3001)
Update documentation of Neo4j's various features

- hybrid search
- Spring Boot starter

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-06-13 10:45:08 +02:00
Dmytro Liubarskyi 60044a16be
Google AI Gemini: prepare for 1.0 (#3205)
## Change
Final polish before releasing Google AI Gemini as 1.0 RC1

## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-06-12 14:34:19 +02:00
Dmytro Liubarskyi e559acaac0
Google AI Gemini: use HttpClient abstraction (#3202)
## Change

Migrated `langchain4j-google-ai-gemini` from using JDK's `HttpClient` to
using `dev.langchain4j.http.client.HttpClient`.
This simplifies the implementation of the module and allows using other
HTTP clients and better integrate into frameworks.
This PR also fixes the issue with streaming. Now streaming response is
handled in a separate thread (previously streaming was handled in the
same thread which led to issues like frozen UI).

Exceptions are now also mapped using default exception mapper.

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-06-12 10:08:02 +02:00
Dmytro Liubarskyi 1bc313c9ec
Azure OpenAI: prepare for 1.0 (#3155)
## Issue
Closes #3070

## Change
- Implemented full support of chat API for Azure OpenAI module
- Implemented exception mapping for Azure OpenAI module
- Refactorings, cleanup of deprecated APIs, etc

## Breaking Changes
- Replaced multiple constructors having lots of arguments with a single
constructor accepting a builder
- Removed default values for `deploymentName` parameter (please specify
it explicitly)
- Mapped Azure-specific exceptions to LC4j generic ones (see
`InternalAzureOpenAiExceptionMapper` for more details)
- Removed deprecated `responseFormat(ChatCompletionsResponseFormat)`
methods from builders (please use `responseFormat(ResponseFormat)`
instead)
- Removed deprecated `AzureOpenAiModelName` class (please use
`AzureOpenAiChatModelName`, `AzureOpenAiEmbeddingModelName`,
`AzureOpenAiImageModelName` and `AzureOpenAiLanguageModelName` instead)
- `AzureOpenAiStreamingChatModel` and
`AzureOpenAiStreamingLanguageModel`: `TokenUsage` will not be calculated
if `TokenCountEstimator` is not set explicitly when creating the model
- `AzureOpenAiStreamingChatModel.Builder`: removed deprecated
`useAsyncClient` and `openAIClient` methods (please use
`openAIAsyncClient` instead)
- `AzureOpenAiTokenCountEstimator`: removed deprecated no-arg
constructor (please specify model name explicitly)
- Fix: when LLM decides to execute tools, `FinishReason` is now
`TOOL_EXECUTION` (instead of `STOP` previously)


## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [X] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples):
https://github.com/langchain4j/langchain4j-examples/pull/160
- [X] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring):
https://github.com/langchain4j/langchain4j-spring/pull/132
2025-06-11 17:00:24 +02:00
Dmytro Liubarskyi cd6929ae6b Mistral: use HttpClient (#2991) 2025-06-10 15:50:15 +02:00
jrsperry ec5a04cab9
added pdf handling to openai. (#3177)
## Issue
Addresses an enhancement in
[3175](https://github.com/langchain4j/langchain4j/issues/3175)

## Change
Adds pdf file handling to the openai module. 

Looking for some feedback as the openai files handling requires filename
to be passed along with the request, which is currently not a field on
the PdfFileContent.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Joshua Sperry <jrsperry@halosight.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-06-10 13:09:08 +02:00
Rabin Neupane f93a6f57f5
Add Thinking Config support for Gemini 2.5 models (#3180)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-06-09 17:28:09 +02:00
Harikrishna 5617f54120
Update Metadata Documentation to Include UUID Support (#3162)
### Summary

This PR updates the documentation for the `Metadata` key-value map to
include `UUID` as one of the supported value types.

### Details

The current documentation lists the supported value types as:
- String
- Integer
- Long
- Float
- Double

However, `UUID` is already supported in the implementation but missing
from the docs.

This update adds `UUID` to the list of supported types in the
documentation to improve clarity and accuracy.

This PR does not change any code logic, only updates the documentation.

Co-authored-by: Harikrishna <harikrishna.gurram@walmart.com>
2025-06-06 09:37:14 +02:00
Dmytro Liubarskyi b470e3842b #3029: Add support to structured output to Vertex AI gemini (#3030) 2025-06-05 12:35:11 +02:00
Mario Fusco ae331b6b6d
Allow to use AI services as tools for another AI service (#3095)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
At the moment it is not possible to use an AI service as tool for
another AI service because the proxy method doesn't carry the annotation
of the interface method.

## Change
<!-- Please describe the changes you made. -->
Improve discovery of the `@Tool` annotation also looking for it on the
interfaces implemented by the proxy class.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-06-05 10:29:49 +02:00
Harikrishna 1d31f4c3c8
Fix broken anchor link to 'Customizable RAG' section in RAG tutorial (#3156)
Fix broken anchor link in RAG tutorial documentation

What’s changed: Updated the anchor link in the RAG tutorial from
/tutorials/rag#rag-apis to /tutorials/rag#core-rag-apis to correctly
point to the "Customizable RAG" section.

Co-authored-by: Harikrishna <harikrishna.gurram@walmart.com>
2025-06-04 15:12:27 +02:00
Harikrishna 1673d34969
Fix incorrect @P annotation usage in tool method example (#3124)
This PR corrects an incomplete usage of the @P annotation in the
documentation.

## Issue
In the example:
```
@Tool
void getTemperature(String location, @P(required = false) Unit unit) {
    ...
}
```
The @P annotation omits the required value() element, which leads to a
compilation error because value() is a mandatory parameter in the @P
annotation definition.

## Fix
Updated the annotation usage to:

```
@Tool
void getTemperature(
    String location,
    @P(value = "Unit of temperature (e.g., Celsius or Fahrenheit)", required = false) Unit unit
) {
    ...
}
```

---------

Co-authored-by: Harikrishna <harikrishna.gurram@walmart.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-06-03 10:27:38 +02:00
Dmytro Liubarskyi b440640f35 Revert "Google Vertex AI: deprecated VertexAiChatModel and VertexAiLanguageModel"
This reverts commit ef492ba67d.
2025-06-02 15:59:56 +02:00
Guillaume Laforge 5d1641d9b8
[DOC] Add links to Micronaut's LangChain4j integration (#3106)
Add Micronaut LangChain4j integration links in the documentation
2025-06-02 15:11:25 +02:00
Dmytro Liubarskyi 73e9957e19
Google Vertex AI Gemini: fix split package (#3084)
## Change

Fixed split package issue between `langchain4j-vertex-ai` and
`langchain4j-vertex-ai-gemini` modules.
Both modules have root package with the same name:
`dev.langchain4j.model.vertexai`.
Root package for `langchain4j-vertex-ai-gemini` was changed to
`dev.langchain4j.model.vertexai.gemini` to fix the issue.

## OpenRewrite Recipe

```yml
type: specs.openrewrite.org/v1beta/recipe
name: dev.langchain4j.VertexAiGeminiChangePackageName
recipeList:
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.VertexAiGeminiChatModel
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.VertexAiGeminiChatModel
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.VertexAiGeminiStreamingChatModel
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.VertexAiGeminiStreamingChatModel
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.HarmCategory
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.HarmCategory
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.SafetyThreshold
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.SafetyThreshold
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.SchemaHelper
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.SchemaHelper
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.ToolCallingMode
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.ToolCallingMode
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.spi.VertexAiGeminiChatModelBuilderFactory
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.spi.VertexAiGeminiChatModelBuilderFactory
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.vertexai.spi.VertexAiGeminiStreamingChatModelBuilderFactory
      newFullyQualifiedTypeName: dev.langchain4j.model.vertexai.gemini.spi.VertexAiGeminiStreamingChatModelBuilderFactory
```

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring):
51f1bec1b1
2025-05-22 14:18:40 +02:00
Dmytro Liubarskyi 40756a4c5f updated versions in documentation 2025-05-20 16:31:15 +02:00
Dmytro Liubarskyi 3fb258b009 - Updated to the next dev version
- Release to Maven central portal instead of s01
2025-05-20 15:55:12 +02:00
Dmytro Liubarskyi 76c53e2497 Mistral AI: Support fill-in-the-middle API for code completion models (#1569) 2025-05-19 17:53:17 +02:00
Carlos Zela Bueno ac9397be2a
Mistral AI: Support fill-in-the-middle API for code completion models (#1569)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
[#1523](https://github.com/langchain4j/langchain4j/issues/1523)

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: LangChain4j <langchain4j@gmail.com>
Co-authored-by: Lize Raes <49833622+LizeRaes@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-05-19 17:14:43 +02:00
Mario Fusco 9174bf72f4
Dynamic registration and deregistration of MCP clients (#3060)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes https://github.com/langchain4j/langchain4j/issues/2983

## Change
<!-- Please describe the changes you made. -->
Allows MCP clients and filter to be dynamically changed on a
`McpToolProvider` in a thread-safe way.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-05-19 16:03:21 +02:00
Dmytro Liubarskyi 04ef681053 docs: updated to 1.0.0 and 1.0.0-beta5 2025-05-14 10:38:40 +02:00
Mario Fusco fd6179acd3
Add a key property to the McpClient (#3011)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-05-13 17:52:52 +02:00
Dmytro Liubarskyi 9d1087b62e
Ollama: make ctors accept builders, deprecate "format" for removal, map exceptions, cleanup (#2984)
## Changes
- make Ollama model ctors accept builders, deprecate existing ones for
removal
- deprecate `format` parameter for removal
- map exceptions for `OllamaStreamingChatModel` and
`OllamaStreamingLanguageModel`
- cleanup

## General checklist
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-05-13 15:51:13 +02:00
Mario Fusco 2a28504c83
Add possibility to filter tools provided by MCP servers (#3000)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue

https://github.com/langchain4j/langchain4j/issues/2978

## Change

Allow to filter tools provided by MCP servers

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-05-13 09:38:57 +02:00
Giuseppe Villani e63cc18e1d
Update neo4j docs after community migration with more examples and configurations (#2972)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->


## Change
<!-- Please describe the changes you made. -->

Update neo4j docs after community migration with more examples and
configurations

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-05-12 14:47:53 +02:00
Dmytro Liubarskyi 75cbb1cd5a docu: fixed link 2025-05-02 16:51:13 +02:00
Dmytro Liubarskyi b691253ee9 docu: updated versions to 1.0.0-rc1 and 1.0.0-beta4 2025-05-02 16:42:27 +02:00
Konstantin Pavlov 8d38b1ce52
Move Kotlin extensions to separate module (#2943)
## Issue
Move Kotlin extensions to a separate module

## Change
- Introduce `langchain4j-kotlin` module
- 🔥 **Breaking change: move kotlin extensions under
`dev.langchain4j.kotlin.*`**
- Update documentation


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-30 15:50:58 +02:00
Dmytro Liubarskyi 025ed48bd3 cosmetics 2025-04-30 14:10:50 +02:00
xiaomgod 59f9a7d5e4
Update dashscope.md (#2913)
修改错误的标签

<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-30 11:37:37 +02:00
NFE_W ae07171d61
docs: Update DashScope documentation (#2923)
Fixed the configuration properties of the
langchain4j-community-dashscope-spring-boot-starter dependency.

For reference, the correct property configurations can be found in:
1. Properties class definition:
[Properties.java#L12](7c65d0e6b1/spring-boot-starters/langchain4j-community-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/community/dashscope/spring/Properties.java (L12))
2. AutoConfig usage:
[AutoConfig.java#L122](382167bcdb/spring-boot-starters/langchain4j-community-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/community/dashscope/spring/AutoConfig.java (L122))
3. Test case example:
[AutoConfigIT.java#L42](7c65d0e6b1/spring-boot-starters/langchain4j-community-dashscope-spring-boot-starter/src/test/java/dev/langchain4j/community/dashscope/spring/AutoConfigIT.java (L42))


<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-30 11:36:38 +02:00
Dmytro Liubarskyi 861d9ccaa7 docu: added a note on LLMs and tool capabilities 2025-04-28 15:42:02 +02:00
Dmytro Liubarskyi ef492ba67d Google Vertex AI: deprecated VertexAiChatModel and VertexAiLanguageModel 2025-04-25 17:32:06 +02:00
Dmytro Liubarskyi e19aceaf96
Fix #2918 (#2919)
## Issue
Fixes https://github.com/langchain4j/langchain4j/issues/2918

## Change
- Changed `maxRetry` parameter semantics from "max attempts" to "max
retries".
- Changed default value of the `maxRetry` parameter from 3 to 2, but it
does not change the default behaviour. When `maxRetries` parameter is
not specified explicitly, it will attempt to execute up to 3 times (as
it was before).

## Breaking Change

If you do **_not_** specify `maxRetries` parameter explicitly, there is
no breaking change and you do not need to do any changes to your code.

If you specify `maxRetries` parameter explicitly, you will need to
reduce it by 1, example:
```java
// before
OpenAiChatModel.builder()
            .apiKey(System.getenv("OPENAI_API_KEY"))
            .modelName(GPT_4_O_MINI)
            .maxRetries(1)
            .build();

// after
OpenAiChatModel.builder()
            .apiKey(System.getenv("OPENAI_API_KEY"))
            .modelName(GPT_4_O_MINI)
            .maxRetries(0)
            .build();
```

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-04-24 16:48:38 +02:00
Dmytro Liubarskyi 1c1aa2fee8
Removed redundant TextFile and TextFileContent (#2908)
## Change
Removed redundant `TextFile` and `TextFileContent` classes

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-04-23 11:25:03 +02:00
Abirami Sukumaran 65d007f9c1
Update google-vertex-ai.md (#2493)
Removed multimodalembedding from the list of supported embedding models
because Vertex AI's multimodalembedding is not supported in this method
and it results in the error:
com.google.api.gax.rpc.InvalidArgumentException:
io.grpc.StatusRuntimeException: INVALID_ARGUMENT: computeTokens is
infeasible

Preview of modification in the doc after removal of the mention of
multimodal embeddings:
![Unit Test - Preview of modification in the doc after removal of the
mention of multimodal
embeddings](https://github.com/user-attachments/assets/2600443b-dddc-4068-af85-95fc281592bd)


## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #2465 

## Change
<!-- Please describe the changes you made. -->
Only documentation change. Removed "multimodalembedding" from the list
of supported embedding models. No code change. This doc change is needed
because Vertex AI's multimodalembedding is not supported in this method
and it results in the error:
"com.google.api.gax.rpc.InvalidArgumentException:
io.grpc.StatusRuntimeException: INVALID_ARGUMENT: computeTokens is
infeasible"

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

Co-authored-by: Guillaume Laforge <glaforge@gmail.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-04-23 10:53:02 +02:00
Arjav Desai 8e3a4f5341
Add Documentation for Helidon Integration (#2859)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
Closes # 2825

## Change
Added a documentation under tutorial and integrations section and linked
in from intro/getting-started pages.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-23 10:36:26 +02:00
Dmytro Liubarskyi 34927950b1 docu: added a note on JDK 17 requirement 2025-04-23 10:26:50 +02:00
Dmytro Liubarskyi fd91d71b51 Revisited @Experimental APIs 2025-04-16 13:15:09 +02:00
Dmytro Liubarskyi 857c3c25a6
Rename Tokenizer into TokenCountEstimator (#2874)
## Change

Renamed:
- `Tokenizer` -> `TokenCountEstimator`
- `AzureOpenAiTokenizer` -> `AzureOpenAiTokenCountEstimator`
- `GoogleAiGeminiTokenizer` -> `GoogleAiGeminiTokenCountEstimator`
- `HuggingFaceTokenizer` -> `HuggingFaceTokenCountEstimator`
- `OpenAiTokenizer` -> `OpenAiTokenCountEstimator`
- `*.tokenizer(..)` -> `*.tokenCountEstimator(..)`

### OpenRewrite recipe:
```yml
---
type: specs.openrewrite.org/v1beta/recipe
name: dev.langchain4j.RenameTokenizer
recipeList:
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.Tokenizer
      newFullyQualifiedTypeName: dev.langchain4j.model.TokenCountEstimator
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.azure.AzureOpenAiTokenizer
      newFullyQualifiedTypeName: dev.langchain4j.model.azure.AzureOpenAiTokenCountEstimator
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.googleai.GoogleAiGeminiTokenizer
      newFullyQualifiedTypeName: dev.langchain4j.model.googleai.GoogleAiGeminiTokenCountEstimator
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.embedding.onnx.HuggingFaceTokenizer
      newFullyQualifiedTypeName: dev.langchain4j.model.embedding.onnx.HuggingFaceTokenCountEstimator
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.openai.OpenAiTokenizer
      newFullyQualifiedTypeName: dev.langchain4j.model.openai.OpenAiTokenCountEstimator
  - org.openrewrite.java.ChangeMethodName:
      methodPattern: dev.langchain4j..* tokenizer(..)
      newMethodName: tokenCountEstimator
```

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-04-15 16:40:06 +02:00
Dmytro Liubarskyi 13ad410fe8
Rename ChatLanguageModel into ChatModel and StreamingChatLanguageModel into StreamingChatModel (#2866)
## Change
Renamed `ChatLanguageModel` into `ChatModel` and
`StreamingChatLanguageModel` into `StreamingChatModel`.
All `chatLanguageModel(...)` methods were renamed into `chatModel(...)`,
all `streamingChatLanguageModel(...)` methods were renamed into
`streamingChatModel(...)`.

`DisabledChatLanguageModel` was renamed into `DisabledChatModel`,
`DisabledStreamingChatLanguageModel` into `DisabledStreamingChatModel`.

### OpenRewrite recipe:
```yml
---
type: specs.openrewrite.org/v1beta/recipe
name: dev.langchain4j.RenameChatModels
recipeList:
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.chat.ChatLanguageModel
      newFullyQualifiedTypeName: dev.langchain4j.model.chat.ChatModel
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.chat.StreamingChatLanguageModel
      newFullyQualifiedTypeName: dev.langchain4j.model.chat.StreamingChatModel
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.chat.DisabledChatLanguageModel
      newFullyQualifiedTypeName: dev.langchain4j.model.chat.DisabledChatModel
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel
      newFullyQualifiedTypeName: dev.langchain4j.model.chat.DisabledStreamingChatModel
  - org.openrewrite.java.ChangeMethodName:
      methodPattern: dev.langchain4j..* chatLanguageModel(..)
      newMethodName: chatModel
  - org.openrewrite.java.ChangeMethodName:
      methodPattern: dev.langchain4j..* streamingChatLanguageModel(..)
      newMethodName: streamingChatModel
```


## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-04-15 10:38:49 +02:00
SylvestrePinget 8c58d88567
Fixes after #2620 (#2851)
## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes
https://github.com/langchain4j/langchain4j/pull/2620#discussion_r2039177048

## Change
fix empty parameters tool call with bedrockStreaming + IT
remove unecessary maven dependency in amazon-bedrock.md



## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-14 11:55:54 +02:00
Dmytro Liubarskyi 3df5346d5c docu: fix 2025-04-11 15:39:43 +02:00
Dmytro Liubarskyi 6ed38d4362
Release 1.0.0-beta3 (#2853) 2025-04-11 15:32:05 +02:00
Dmytro Liubarskyi f820cb0ffd Removed Neo4j, as it was migrated to https://github.com/langchain4j/langchain4j-community 2025-04-11 13:20:01 +02:00
SylvestrePinget 1ce5ce9176
Fix review PR 2620 (#2846)
## Issue
Follow review on #2620 

## Change
- override doChat instead of Chat
- add BedrockChatModelListenerWithConverseIT
- Update amazon-bedrock.md


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-11 10:43:30 +02:00
Rea Rustagi 22c3307812
[DOCS] Improve MongoDB Atlas documentation (#2775)
## Issue
No associated Issue

## Change
Improves MongoDB atlas embedding store documentation to align with
official tutorial

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [n/a] There are no breaking changes
- [n/a] I have added unit and/or integration tests for my change
- [n/a] The tests cover both positive and negative cases
- [n/a] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [n/a] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-10 19:11:37 +02:00
Averi Kitsch 0467528827
docs(google-alloydb): add documentation (#2759)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
Companion docs to
https://github.com/langchain4j/langchain4j-community/pull/102


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-10 19:10:58 +02:00
吴生安 407b51297a
Update dashscope.md (#2744)
加入了阿里万象文生图的文档描述和代码示例

<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-10 19:10:04 +02:00
Dmytro Liubarskyi 73f5a08766 Add ConverseStream support for Amazon Bedrock integrations (#2620) 2025-04-10 18:46:13 +02:00
Julien Dubois fbaf1bb4c7
Add support for passwordless authentication with Azure OpenAI (#2719)
This improves security, when using Azure OpenAI.
2025-04-10 17:33:14 +02:00
Mario Fusco f342d86657
Add documentation for tools hallucination strategy (#2840)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-10 17:08:19 +02:00
Dmytro Liubarskyi fcbef0ce79 Mistral: add support for structured output (#2633) (#2706) 2025-04-10 14:29:26 +02:00
Alex Rovner f2ac5233c9
Mistral: add support for structured output (#2633) (#2706)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #2633 

## Change
I added the glue-code needed to pass a JSON schema from a `ChatRequest`
to the Mistral API. I tried to follow established patterns for setting
this up, e.g.:

```java
MistralAiChatModel.builder()
                .apiKey(System.getenv("MISTRAL_AI_API_KEY"))
                .modelName(MISTRAL_SMALL_LATEST)
                .temperature(0.1)
                .logRequests(true)
                .logResponses(true)
                .supportedCapabilities(Capability.RESPONSE_FORMAT_JSON_SCHEMA) // this enables structured output
                .build()
```

When no schema is given in the `ChatRequest`, the old behavior of
following the format given in model's `responseFormat` is executed.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-04-10 14:10:25 +02:00
Mario Fusco 1056a05df7
Allow to mix static and dynamic tools (#2819) 2025-04-10 12:11:41 +02:00
kuraleta 249a5c979e
Structured Outputs with JSON schema to support more types (#1938)
## Issue
Closes #1882
Partially addresses #916

## Change

So far Structured Outputs with JSON schema supported only a (single)
POJO as a return type.
This PR adds support for the following types:
- `List<POJO>`, `Set<POJO>`
- `Enum`, `List<Enum>`, `Set<Enum>`
- `List<String>`, `Set<String>`
- `boolean`, `Boolean`
- `int`, `Integer`
- `long`, `Long`
- `float`, `Float`
- `double`, `Double`

This PR also refactors `ServiceOutputParser`, `OutputParserFactory` and
`OutputParser`s.

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: LangChain4j <langchain4j@gmail.com>
Co-authored-by: LangChain4j <info@langchain4j.dev>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-04-10 10:29:20 +02:00
Dmytro Liubarskyi e0150c9eb7
Make fields optional by default for structured outputs (#2806)
## Changes
- Made POJO fields optional by default for structured outputs. For
"strict mode", optionality is emulated via union of the type and `null`
(e.g., `"type":["string", "null"]` for optional `String` field). Note:
nothing changes for tools, all POJO fields stay required by default.
- Added support for `@JsonProperty(required = true/false)` for
structured outputs and tools
- `LocalTime`/`LocalDateTime`: `second`/`nano` now have default value of
`0` if not present in generated JSON
- OpenAI: internal JSON schema hierarchy in the client was removed in
favour of a common mapping (as a `Map<String, Object>`) to simplify and
reduce duplication

## General checklist
- [ ] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-04-04 15:09:34 +02:00
Konstantin Pavlov 618735dbf4
Add support for Jackson Kotlin module and improve JSON handling (#2730)
## Issue
Closes #2727

## Change

- Enhanced JSON handling by integrating `jackson-module-kotlin` for
Kotlin data classes and ensuring proper module registration for
serialization/deserialization.
- Refactored `JacksonJsonCodec` to enable dependency injection and added
tests for better coverage and validation.
- Updated documentation and build configuration to reflect these
changes.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-04-04 13:16:27 +02:00
Averi Kitsch 5928abd0ec
docs(google-cloud-sql): add documentation (#2802)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
Corresponding docs for
https://github.com/langchain4j/langchain4j-community/pull/124
Mirror of LangChain Python implementation for Google CloudSQL
(https://github.com/googleapis/langchain-google-cloud-sql-pg-python).
Includes EmbeddingStore and Loader integrations.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-04-04 13:05:46 +02:00
Dmytro Liubarskyi 143a5dc288 docu: added a note on @Description for enum values 2025-04-04 09:48:38 +02:00
Mario Fusco bf2c59eafe
Fix memory leak due to ChatMemory caching (#2692)
Closes https://github.com/langchain4j/langchain4j/issues/1889

This fixes the memory leak reported
[here](https://github.com/langchain4j/langchain4j/issues/1889) in a much
better, less invasive way than the [other
fix](https://github.com/langchain4j/langchain4j/pull/2435) that I
implemented. Also it has the advantage of not breaking backward
compatibility in any way.
2025-04-01 18:03:16 +02:00
Dmytro Liubarskyi f8e0dc3562
OpenAI: remove deprecated APIs (#2792)
## Change

Removed deprecated APIs in the `langchain4j-open-ai` module.

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-04-01 09:49:45 +02:00
Dmytro Liubarskyi fad1e49e7d
Remove deprecated EmbeddingStore.findRelevant API (#2750)
## Change
Removed deprecated `EmbeddingStore.findRelevant()` API.
It was deprecated a while ago and wad replaced with the
`EmbeddingStore.search(EmbeddingSearchRequest)` API

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-03-21 17:27:17 +01:00
Dmytro Liubarskyi d86c4b999d
Remove deprecated APIs (#2726)
## Change
Removed:
- `ChatMessage.text()`
- `Document.metadata(String)` -> Replaced by:
`Document.metadata().get{Type}(String)`
- `TextSegment.metadata(String)` -> Replaced by:
`TextSegment.metadata().get{Type}(String)`
- `Metadata.get(String)` -> Replaced by: `Metadata.get{Type}(String)`
- `Metadata.add(String, Object)` -> Replaced by: `Metadata.put(String,
{Type})`
- `Metadata.add(String, String)` -> Replaced by: `Metadata.put(String,
{Type})`
- `Metadata.asMap()` -> Replaced by: `Metadata.toMap()`
- `Metadata.from(String, Object)` -> Replaced by: `Metadata.from(String,
String)`
- `Metadata.metadata(String, Object)` -> Replaced by:
`Metadata.metadata(String, String)`
- `RetrievalAugmentor.augment(UserMessage, Metadata)` -> Replaced by:
`RetrievalAugmentor.augment(AugmentationRequest)`
- `ContentInjector.inject(List, UserMessage)` -> Replaced by:
`ContentInjector.inject(List, ChatMessage)`
- `Retriever` -> Replaced by: `ContentRetriever`
- `EmbeddingStoreRetriever` -> Replaced by:
`EmbeddingStoreContentRetriever`
- `Utils.isCollectionEmpty(Collection)` -> Replaced by:
`Utils.isNullOrEmpty(Collection)`
- `JsonObjectSchema.Builder.properties()` -> Replaced by:
`JsonObjectSchema.Builder.addProperties()`

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-03-20 19:15:31 +01:00
Jan Martiska eedae91d1a
MCP prompt support + some MCP resource handling improvements (#2691)
## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #2304 

## Change
Support for retrieving prompts from an MCP server. Plus some
improvements to MCP resource handling (using Jackson for parsing where
applicable, and improved error handling)


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-03-20 14:28:39 +01:00
kuraleta edc684be2c
WIP: This documentation demonstrates how to implement a classification-bas… (#2679)
…ed AI service

<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-03-14 10:28:02 +01:00
Dmytro Liubarskyi 70db5b60cf docu: fix 2025-03-13 15:58:10 +01:00
Dmytro Liubarskyi 93a0504b5c docu: fix 2025-03-13 15:39:31 +01:00
Dmytro Liubarskyi 2fcfa357ef
Release 1.0.0-beta2 (#2689) 2025-03-13 15:03:17 +01:00
Julien Dubois abfac347c0
Support the official OpenAI Java SDK (#2508)
Fix #2373 

This support the Chat, Embedding and Image models, with full testing.
2025-03-13 09:50:09 +01:00
Dmytro Liubarskyi aa26a54402
Propagate gen_ai.system from ChatLanguageModel (#2556)
## Issue
Partially addresses #2547

## Change

Introduced `ModelProvider` enum that is currently exposed by
`ChatLanguageModel` and `StreamingChatLanguageModel`, as well as
`ChatModelRequestContext`, `ChatModelResponseContext` and
`ChatModelErrorContext`.

`ModelProvider` can be mapped to the OpenTelemetry's `gen_ai.system`.
For example: `ModelProvider.GOOGLE_GEMINI` -> `gemini`


## General checklist
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-12 23:19:35 +01:00
Dmytro Liubarskyi 8f0ea53bd8
Anthropic: implement (limited) support for thinking (#2601)
## Change
Implemented a **_limited_** support for
[thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
for Anthropic chat models. This change only makes sure that "thinking"
can be enabled and the user can get the **_final_** answer.

What is not implemented:
- it is currently not possible to get the thinking content from the LC4j
API. It is only visible in logs.
- thinking content is not
[preserved](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#preserving-thinking-blocks)
- etc

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-03-12 15:19:45 +01:00
Dmytro Liubarskyi b41a7b1269
Amazon Bedrock: deprecate old models using invoke API (#2675)
## Issue
Closes #2606

## Change
Deprecated old Amazon Bedrock models that used invoke API:
- `BedrockAI21LabsChatModel`
- `BedrockAnthropicCompletionChatModel`
- `BedrockAnthropicMessageChatModel`
- `BedrockCohereChatModel`
- `BedrockLlamaChatModel`
- `BedrockMistralAiChatModel`
- `BedrockStabilityAIChatModel`
- `BedrockTitanChatModel`

Please use `BedrockChatModel` instead.

## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the [core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core) and [main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j) modules, and they are all green
- [x] I have added/updated the [documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features)
- [ ] I have added/updated [Spring Boot starter(s)](https://github.com/langchain4j/langchain4j-spring) (if applicable)
2025-03-12 12:45:51 +01:00
Dmytro Liubarskyi c2e46a8b48
Removed deprecated JsonSchemaProperty, ToolParameters and Tokenizer APIs (#2668)
## Changes
- Removed `JsonSchemaProperty` and `ToolParameters` classes which were
deprecated in previous releases. If you want to specify tool parameters
in `ToolSpecification`, use `JsonObjectSchema`:
```java
ToolSpecification toolSpecification = ToolSpecification.builder()
        .name("getWeatherForecast")
        .description("Get the weather forecast for a location")
        .parameters(JsonObjectSchema.builder()
                .addStringProperty("location", "the location to get the weather forecast for")
                .required("location")
                .build())
        .build();
```
- Removed a few methods from `Tokenizer` to estimate token count of
tools (this functionality will not be supported any more)
- `AzureOpenAiStreamingChatModel`: removed the use of `Tokenizer`
methods that estimate token counts for tools (described above), so
estimated `TokenUsage` does not include tools now. This should be fixed
by https://github.com/langchain4j/langchain4j/issues/1068 in the future


## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-03-12 10:39:29 +01:00
Jan Martiska 9130edd757
MCP resources (#2656)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Partially fixes #2304 (only the resources part for now)

## Change
Support for MCP resources, as per
https://modelcontextprotocol.io/docs/concepts/resources


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-03-11 13:20:38 +01:00
Sergey Tselovalnikov 10eba9a161
docs: add a note on the required kotlin compiler arguments (#2652)
## Issue

This PR adds a note on the required kotlin compiler configuration for
defining tools using
[`@Tool`](078c5fbc89/langchain4j-core/src/main/java/dev/langchain4j/agent/tool/Tool.java (L23)).

**When this parameter is missing:**
<img width="1013" alt="Screenshot 2025-03-07 at 2 26 05 pm"
src="https://github.com/user-attachments/assets/f92e28ff-729e-41a0-98e2-ccdb0620e037"
/>

**When `javaParameters` is set to true:**

![image](https://github.com/user-attachments/assets/225f4171-3318-42d5-87c2-e6f1a787d231)

I couldn't find any relevant documentation, so I decided to add it. Let
me know if this is already mentioned somewhere, or if it should be moved
somewhere else.
2025-03-11 09:29:04 +01:00
dliubars b0b6d91385 docu: added link to multimodality section 2025-03-04 10:02:02 +01:00
dliubars b6551e8cd5 docu: added Mistral structured outputs PR link 2025-03-03 14:13:48 +01:00
Dmytro Liubarskyi b3dec0a455
Remove deprecated TokenStream API (#2627)
## Change
`TokenStream.onNext` and `onComplete` were deprecated in previous
releases, now we remove them completely.

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-02-28 17:04:27 +01:00
Dmytro Liubarskyi bebfab832d
Remove old ChatLanguageModel.generate() API (#2621)
## Change
Removed old `ChatLanguageModel.generate()` API.

The `generate()` API was deprecated in previous releases, now we are
removing it to keep only the new `chat()` API.

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have updated [examples
repo](https://github.com/langchain4j/langchain4j-examples):
3ea374bf64
- [X] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring):
https://github.com/langchain4j/langchain4j-spring/pull/117
2025-02-28 13:48:43 +01:00
idle fish 44cd0a807c
Update rag.md. Fix spelling errors (#2618)
Fix spelling errors.
ContetRetrievers -> ContentRetrievers

<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->
- Fix spelling errors.
- ContetRetrievers -> ContentRetrievers

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-02-27 16:01:32 +01:00
Dmytro Liubarskyi 46975d3d8b OpenAI: use supportedCapabilities(RESPONSE_FORMAT_JSON_SCHEMA) instead of responseFormat("json_schema") to enable structured outputs with JSON schema 2025-02-25 17:36:03 +01:00
Dmytro Liubarskyi 690812222e OpenAI: use supportedCapabilities(RESPONSE_FORMAT_JSON_SCHEMA) instead of responseFormat("json_schema") to enable structured outputs with JSON schema 2025-02-25 17:19:24 +01:00
Dmytro Liubarskyi e6c6dbd7b5
Migrate from Gson to Jackson (#2595)
## Issue
Closes #1042
Closes #1810

## Change
- Migrated `langchain4j-core`, `langchain4j` and `langchain4j-jlama`
modules from Gson to Jackson. This is supposed to be a non-breaking
change, but there might be some corner cases that I have missed, so
please report if your use case stopped working or you face any other
issue related to this change.
- Now using `JsonCodec` to deserialize tool arguments
- Migrated `langchain4j-vertex-ai` module from internal `Json` util to
use it's own Gson mapping logic

## Breaking Changes
- Removed `Json.toInputStream` and `JsonCodec.toInputStream` methods as
they are not required

## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-02-24 18:20:10 +01:00
Antonio Goncalves ceb637b06e
Adds a GitHub MCP server sample in the documentation (#2512)
Adding a GitHub MCP server sample in the documentation.

See https://github.com/langchain4j/langchain4j-examples/pull/141
2025-02-24 11:28:57 +01:00
Dmytro Liubarskyi 1a8a70e761 docu: added tools <-> MCP links 2025-02-18 20:21:19 +01:00
Christopher Gómez 4a8d4168b4
Update google-ai-gemini.md (#2566)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-02-18 13:26:02 +01:00
Konstantin Pavlov f59a7a8a6d
Add Kotlin streaming use case documentation, update test (#2525)
## Issue
Kotlin streaming api documentation

## Change

Introduce a new section in the Kotlin tutorial to demonstrate the
`chatFlow` extension for streaming AI responses using coroutines.
Additionally, update tests to showcase custom parameters like
temperature and output tokens for `chatFlow`.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j

Co-authored-by: Konstantin Pavlov <{ID}+{username}@users.noreply.github.com>
2025-02-18 08:56:29 +01:00
Dmytro Liubarskyi f1a41b2381
OpenAI: migrate to HttpClient (#2529)
## Issue
Closes #2468


## Changes
1. This PR is a continuation of efforts started in
https://github.com/langchain4j/langchain4j/pull/2413
2. When using `langchain4j-open-ai`, all `OpenAi*Model`s are now using
`java.net.http.HttpClient` instead of OkHttp/Retrofit by default. You
also have an option to [customize it or plug in any other HTTP
client](https://docs.langchain4j.dev/tutorials/customizable-http-client).
3. When using `langchain4j-open-ai-spring-boot-starter`, all
`OpenAi*Model`s are now using Spring's `RestClient` instead of
OkHttp/Retrofit by default. You also have an option to [customize it or
plug in any other HTTP
client](https://docs.langchain4j.dev/tutorials/customizable-http-client).
4. `apiKey` is now optional for all `OpenAi*Model`s
5. `OpenAi*Model`s can now throw
`dev.langchain4j.exception.HttpException` instead of
`dev.ai4j.openai4j.OpenAiHttpException`
6. The default connect timeout is now 15 seconds instead of 60 for all
`OpenAi*Model`s. The default read timeout stays the same (60 seconds).
7. To continue using the "demo" key, you now need to specify the
`baseUrl` explicitly:
```java
OpenAiChatModel model = OpenAiChatModel.builder()
        .baseUrl("http://langchain4j.dev/demo/openai/v1")
        .apiKey("demo")
        .build()
```
8. If you are using `Proxy`, now you need to configure it directly on
the HTTP client of your choice. For example, when using JDK's
`HttpClient`:
```java
HttpClient.Builder httpClientBuilder = HttpClient.newBuilder()
        .proxy(ProxySelector.of(new InetSocketAddress("XXX.XXX.XXX.XXX", 1234)));

OpenAiChatModel model = OpenAiChatModel.builder()
        .httpClientBuilder(JdkHttpClient.builder().httpClientBuilder(httpClientBuilder))
        .apiKey(System.getenv("OPENAI_API_KEY"))
        .modelName("gpt-4o-mini")
        .build();
```
This also means that all `langchain4j.open-ai.*-model.proxy.*` Spring
Boot properties are not working any more.
9. `OpenAiEmbeddingModel`: removed default `modelName`
(`TEXT_EMBEDDING_ADA_002`), please set it explicitly now
10. `OpenAiImageModel`: removed `withPersisting` and `persistTo`
properties. Persisting images will not be supported any more.
11. `OpenAiLanguageModel` and `OpenAiStreamingLanguageModel`: removed
default `modelName` (`GPT_3_5_TURBO_INSTRUCT`) and `temperature`
(`0.7`), please set it explicitly now
12. `OpenAiModerationModel`: removed default `modelName`
(`TEXT_MODERATION_LATEST`), please set it explicitly now
13. All the `OpenAi*Model` constructors are now accepting a builder
object instead of all the properties
14. The `langchain4j-local-ai` module is now also using
`java.net.http.HttpClient` instead of OkHttp/Retrofit as it depends on
the `langchain4j-open-ai` module


## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the examples repo:
https://github.com/langchain4j/langchain4j-examples/pull/143
- [x] I have added/updated Spring Boot starter:
https://github.com/langchain4j/langchain4j-spring/pull/113
2025-02-13 14:25:26 +01:00
Dmytro Liubarskyi bf4d9a200f
Release 1.0.0-beta1 (#2509) 2025-02-05 16:15:48 +01:00
Dmytro Liubarskyi 954d84cdec
OpenAI: ensure o3-mini works (#2500)
## Issue
Closes #2488

## Change
Ensure o3-mini works

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-02-04 11:51:21 +01:00
diego dupin f092341462
Here is the MariaDB database store implementation. (#2225)
## Change

Permit using MariaDB database store implementation.
see  https://mariadb.org/projects/mariadb-vector/ :)

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core]
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
- [X] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
- [X] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [X] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

---------

Co-authored-by: LangChain4j <langchain4j@gmail.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-02-04 09:54:25 +01:00
Martin7-1 caf3aaa8e2
Migrate `langchain4j-redis` (#2492)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->

1. Migarate `langchain4j-redis` and
`langchain4j-redis-spring-boot-starter` to community repo.
2. Update docu.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-02-03 10:20:46 +01:00
dependabot[bot] f1bd3b04d7
Bump path-to-regexp and express in /docs (#2245)
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) and
[express](https://github.com/expressjs/express). These dependencies
needed to be updated together.
Updates `path-to-regexp` from 0.1.10 to 1.9.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pillarjs/path-to-regexp/releases">path-to-regexp's
releases</a>.</em></p>
<blockquote>
<h2>Fix backtracking in 1.x</h2>
<p><strong>Fixed</strong></p>
<ul>
<li>Add backtrack protection to 1.x release (<a
href="https://redirect.github.com/pillarjs/path-to-regexp/issues/320">#320</a>)
925ac8e</li>
<li>Fix
<code>re.exec(&amp;[#39](https://github.com/pillarjs/path-to-regexp/issues/39);/test/route&amp;[#39](https://github.com/pillarjs/path-to-regexp/issues/39);)</code>
result (<a
href="https://redirect.github.com/pillarjs/path-to-regexp/issues/267">#267</a>)
32a14b0</li>
</ul>
<p><a
href="https://github.com/pillarjs/path-to-regexp/compare/v1.8.0...v1.9.0">https://github.com/pillarjs/path-to-regexp/compare/v1.8.0...v1.9.0</a></p>
<h2>Backport token to function options</h2>
<p><strong>Added</strong></p>
<ul>
<li>Backport <code>TokensToFunctionOptions</code></li>
</ul>
<h2>Fix backtracking (again)</h2>
<p><strong>Fixed</strong></p>
<ul>
<li>Improved backtracking protection for 0.1.x, will break some
previously valid paths (see previous advisory: <a
href="https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j">https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j</a>)</li>
</ul>
<p><a
href="https://github.com/pillarjs/path-to-regexp/compare/v0.1.11...v0.1.12">https://github.com/pillarjs/path-to-regexp/compare/v0.1.11...v0.1.12</a></p>
<h2>Error on bad input</h2>
<p><strong>Changed</strong></p>
<ul>
<li>Add error on bad input values  8f09549</li>
</ul>
<p><a
href="https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.11">https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.11</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pillarjs/path-to-regexp/blob/master/History.md">path-to-regexp's
changelog</a>.</em></p>
<blockquote>
<h1>Moved to <a
href="https://github.com/pillarjs/path-to-regexp/releases">GitHub
Releases</a></h1>
<h2>3.0.0 / 2019-01-13</h2>
<ul>
<li>Always use prefix character as delimiter token, allowing any
character to be a delimiter (e.g.
<code>/:att1-:att2-:att3-:att4-:att5</code>)</li>
<li>Remove <code>partial</code> support, prefer escaping the prefix
delimiter explicitly (e.g.
<code>\\/(apple-)?icon-:res(\\d+).png</code>)</li>
</ul>
<h2>2.4.0 / 2018-08-26</h2>
<ul>
<li>Support <code>start</code> option to disable anchoring from
beginning of the string</li>
</ul>
<h2>2.3.0 / 2018-08-20</h2>
<ul>
<li>Use <code>delimiter</code> when processing repeated matching groups
(e.g. <code>foo/bar</code> has no prefix, but has a delimiter)</li>
</ul>
<h2>2.2.1 / 2018-04-24</h2>
<ul>
<li>Allow empty string with <code>end: false</code> to match both
relative and absolute paths</li>
</ul>
<h2>2.2.0 / 2018-03-06</h2>
<ul>
<li>Pass <code>token</code> as second argument to <code>encode</code>
option (e.g. <code>encode(value, token)</code>)</li>
</ul>
<h2>2.1.0 / 2017-10-20</h2>
<ul>
<li>Handle non-ending paths where the final character is a delimiter
<ul>
<li>E.g. <code>/foo/</code> before required either <code>/foo/</code> or
<code>/foo//</code> to match in non-ending mode</li>
</ul>
</li>
</ul>
<h2>2.0.0 / 2017-08-23</h2>
<ul>
<li>New option! Ability to set <code>endsWith</code> to match paths like
<code>/test?query=string</code> up to the query string</li>
<li>New option! Set <code>delimiters</code> for specific characters to
be treated as parameter prefixes (e.g. <code>/:test</code>)</li>
<li>Remove <code>isarray</code> dependency</li>
<li>Explicitly handle trailing delimiters instead of trimming them (e.g.
<code>/test/</code> is now treated as <code>/test/</code> instead of
<code>/test</code> when matching)</li>
<li>Remove overloaded <code>keys</code> argument that accepted
<code>options</code></li>
<li>Remove <code>keys</code> list attached to the <code>RegExp</code>
output</li>
<li>Remove asterisk functionality (it's a real pain to properly
encode)</li>
<li>Change <code>tokensToFunction</code> (e.g. <code>compile</code>) to
accept an <code>encode</code> function for pretty encoding (e.g. pass
your own implementation)</li>
</ul>
<h2>1.7.0 / 2016-11-08</h2>
<ul>
<li>Allow a <code>delimiter</code> option to be passed in with
<code>tokensToRegExp</code> which will be used for
&quot;non-ending&quot; token match situations</li>
</ul>
<h2>1.6.0 / 2016-10-03</h2>
<ul>
<li>Populate <code>RegExp.keys</code> when using the
<code>tokensToRegExp</code> method (making it consistent with the main
export)</li>
<li>Allow a <code>delimiter</code> option to be passed in with
<code>parse</code></li>
<li>Updated TypeScript definition with <code>Keys</code> and
<code>Options</code> updated</li>
</ul>
<h2>1.5.3 / 2016-06-15</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c75eb105b2"><code>c75eb10</code></a>
1.9.0</li>
<li><a
href="925ac8e3c5"><code>925ac8e</code></a>
Add backtrack protection to 1.x release (<a
href="https://redirect.github.com/pillarjs/path-to-regexp/issues/320">#320</a>)</li>
<li><a
href="32a14b0185"><code>32a14b0</code></a>
Fix <code>re.exec('/test/route')</code> result (<a
href="https://redirect.github.com/pillarjs/path-to-regexp/issues/267">#267</a>)</li>
<li><a
href="79a5dcf5f2"><code>79a5dcf</code></a>
1.8.0</li>
<li><a
href="1a47442831"><code>1a47442</code></a>
feat: backport TokensToFunctionOptions to v1.x</li>
<li><a
href="9c0550cc0b"><code>9c0550c</code></a>
Update history for <code>1.7.0</code></li>
<li><a
href="a99ec3c149"><code>a99ec3c</code></a>
v1.7.0</li>
<li><a
href="69fb61b956"><code>69fb61b</code></a>
Allow delimiter to be set for <code>tokensToRegExp</code></li>
<li><a
href="1c2e8e4f23"><code>1c2e8e4</code></a>
Update history for <code>1.6.0</code></li>
<li><a
href="bdf17de3df"><code>bdf17de</code></a>
v1.6.0</li>
<li>Additional commits viewable in <a
href="https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v1.9.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `express` from 4.21.1 to 4.21.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/express/releases">express's
releases</a>.</em></p>
<blockquote>
<h2>4.21.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Add funding field (v4) by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/express/pull/6065">expressjs/express#6065</a></li>
<li>deps: path-to-regexp@0.1.11 by <a
href="https://github.com/blakeembrey"><code>@​blakeembrey</code></a> in
<a
href="https://redirect.github.com/expressjs/express/pull/5956">expressjs/express#5956</a></li>
<li>deps: bump path-to-regexp@0.1.12 by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/6209">expressjs/express#6209</a></li>
<li>Release: 4.21.2 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/6094">expressjs/express#6094</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/express/compare/4.21.1...4.21.2">https://github.com/expressjs/express/compare/4.21.1...4.21.2</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/express/blob/4.21.2/History.md">express's
changelog</a>.</em></p>
<blockquote>
<h1>4.21.2 / 2024-11-06</h1>
<ul>
<li>deps: path-to-regexp@0.1.12
<ul>
<li>Fix backtracking protection</li>
</ul>
</li>
<li>deps: path-to-regexp@0.1.11
<ul>
<li>Throws an error on invalid path values</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1faf228935"><code>1faf228</code></a>
4.21.2</li>
<li><a
href="2e0fb646d0"><code>2e0fb64</code></a>
deps: bump path-to-regexp@0.1.12 (<a
href="https://redirect.github.com/expressjs/express/issues/6209">#6209</a>)</li>
<li><a
href="59fc27028e"><code>59fc270</code></a>
deps: path-to-regexp@0.1.11 (<a
href="https://redirect.github.com/expressjs/express/issues/5956">#5956</a>)</li>
<li><a
href="51fc39ccf8"><code>51fc39c</code></a>
docs: add funding (<a
href="https://redirect.github.com/expressjs/express/issues/6065">#6065</a>)</li>
<li>See full diff in <a
href="https://github.com/expressjs/express/compare/4.21.1...4.21.2">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~jonchurch">jonchurch</a>, a new releaser
for express since your current version.</p>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-31 12:51:58 +01:00
dependabot[bot] fa864a8b33
Bump nanoid from 3.3.7 to 3.3.8 in /docs (#2259)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ai/nanoid/blob/main/CHANGELOG.md">nanoid's
changelog</a>.</em></p>
<blockquote>
<h2>3.3.8</h2>
<ul>
<li>Fixed a way to break Nano ID by passing non-integer size (by <a
href="https://github.com/myndzi"><code>@​myndzi</code></a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3044cd5e73"><code>3044cd5</code></a>
Release 3.3.8 version</li>
<li><a
href="4fe34959c3"><code>4fe3495</code></a>
Update size limit</li>
<li><a
href="d643045f40"><code>d643045</code></a>
Fix pool pollution, infinite loop (<a
href="https://redirect.github.com/ai/nanoid/issues/510">#510</a>)</li>
<li>See full diff in <a
href="https://github.com/ai/nanoid/compare/3.3.7...3.3.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nanoid&package-manager=npm_and_yarn&previous-version=3.3.7&new-version=3.3.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Konstantin Pavlov <mail@kpavlov.me>
2025-01-31 12:50:41 +01:00
dependabot[bot] e021910ac4
Bump katex from 0.16.11 to 0.16.21 in /docs (#2426)
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.16.11 to 0.16.21.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/KaTeX/KaTeX/releases">katex's
releases</a>.</em></p>
<blockquote>
<h2>v0.16.21</h2>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.20...v0.16.21">0.16.21</a>
(2025-01-17)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>escape \htmlData attribute name (<a
href="57914ad91e">57914ad</a>)
<ul>
<li>See security advisory <a
href="https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546">https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546</a></li>
</ul>
</li>
</ul>
<h2>v0.16.20</h2>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.19...v0.16.20">0.16.20</a>
(2025-01-12)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>\providecommand does not overwrite existing macro (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4000">#4000</a>)
(<a
href="6d30fe47b0">6d30fe4</a>),
closes <a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3928">#3928</a></li>
</ul>
<h2>v0.16.19</h2>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.18...v0.16.19">0.16.19</a>
(2024-12-29)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> improve <code>strict</code> function type
(<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4009">#4009</a>)
(<a
href="4228b4eb52">4228b4e</a>)</li>
</ul>
<h2>v0.16.18</h2>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.17...v0.16.18">0.16.18</a>
(2024-12-18)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Actually publish TypeScript type definitions (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4008">#4008</a>)
(<a
href="629b87354f">629b873</a>)</li>
</ul>
<h2>v0.16.17</h2>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.16...v0.16.17">0.16.17</a>
(2024-12-17)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>MathML combines multidigit numbers with sup/subscript, comma
separators, and multicharacter text when outputting to DOM (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3999">#3999</a>)
(<a
href="7d79e220f4">7d79e22</a>),
closes <a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3995">#3995</a></li>
</ul>
<h2>v0.16.16</h2>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.15...v0.16.16">0.16.16</a>
(2024-12-17)</h2>
<h3>Features</h3>
<ul>
<li>ESM exports, TypeScript types (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3992">#3992</a>)
(<a
href="ea9c173a0d">ea9c173</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md">katex's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.20...v0.16.21">0.16.21</a>
(2025-01-17)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>escape \htmlData attribute name (<a
href="57914ad91e">57914ad</a>)</li>
</ul>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.19...v0.16.20">0.16.20</a>
(2025-01-12)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>\providecommand does not overwrite existing macro (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4000">#4000</a>)
(<a
href="6d30fe47b0">6d30fe4</a>),
closes <a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3928">#3928</a></li>
</ul>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.18...v0.16.19">0.16.19</a>
(2024-12-29)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> improve <code>strict</code> function type
(<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4009">#4009</a>)
(<a
href="4228b4eb52">4228b4e</a>)</li>
</ul>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.17...v0.16.18">0.16.18</a>
(2024-12-18)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Actually publish TypeScript type definitions (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4008">#4008</a>)
(<a
href="629b87354f">629b873</a>)</li>
</ul>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.16...v0.16.17">0.16.17</a>
(2024-12-17)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>MathML combines multidigit numbers with sup/subscript, comma
separators, and multicharacter text when outputting to DOM (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3999">#3999</a>)
(<a
href="7d79e220f4">7d79e22</a>),
closes <a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3995">#3995</a></li>
</ul>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.15...v0.16.16">0.16.16</a>
(2024-12-17)</h2>
<h3>Features</h3>
<ul>
<li>ESM exports, TypeScript types (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3992">#3992</a>)
(<a
href="ea9c173a0d">ea9c173</a>)</li>
</ul>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.14...v0.16.15">0.16.15</a>
(2024-12-09)</h2>
<h3>Features</h3>
<ul>
<li>italic sans-serif in math mode via <code>\mathsfit</code> command
(<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/3998">#3998</a>)
(<a
href="22189018b6">2218901</a>)</li>
</ul>
<h2><a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.13...v0.16.14">0.16.14</a>
(2024-12-08)</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="923f2aa156"><code>923f2aa</code></a>
chore(release): 0.16.21 [ci skip]</li>
<li><a
href="57914ad91e"><code>57914ad</code></a>
fix: escape \htmlData attribute name</li>
<li><a
href="ff289955e8"><code>ff28995</code></a>
Merge commit from fork</li>
<li><a
href="28a0bf5113"><code>28a0bf5</code></a>
chore(release): 0.16.20 [ci skip]</li>
<li><a
href="6d30fe47b0"><code>6d30fe4</code></a>
fix: \providecommand does not overwrite existing macro (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4000">#4000</a>)</li>
<li><a
href="8f47dba453"><code>8f47dba</code></a>
chore(deps): update actions/upload-artifact to v4 (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4012">#4012</a>)</li>
<li><a
href="88b5056bdc"><code>88b5056</code></a>
chore(release): 0.16.19 [ci skip]</li>
<li><a
href="4228b4eb52"><code>4228b4e</code></a>
fix(types): improve <code>strict</code> function type (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4009">#4009</a>)</li>
<li><a
href="f934646444"><code>f934646</code></a>
chore(release): 0.16.18 [ci skip]</li>
<li><a
href="629b87354f"><code>629b873</code></a>
fix: Actually publish TypeScript type definitions (<a
href="https://redirect.github.com/KaTeX/KaTeX/issues/4008">#4008</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/KaTeX/KaTeX/compare/v0.16.11...v0.16.21">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=katex&package-manager=npm_and_yarn&previous-version=0.16.11&new-version=0.16.21)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-31 12:48:32 +01:00
Pablo Silberkasten bc6d2b2887
Adding some fixes to the OracleEmbeddingStore (#2239)
## Change
Adding some fixes to the OracleEmbeddingStore

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-01-31 11:42:15 +01:00
Ssvv 28d43e2695
OpenAI: add support for audio inputs (#2473)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/2434

## Change
The openai4j library didn't support audio content for chat completion.
After develop the support in that library, the InternalOpenAiHelper
class has been updated to use the new AudioContent model.

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-01-31 11:03:27 +01:00
SylvestrePinget 0cc54e6683
[feat] Add Bedrock Converse API support (#2404)
## Issue
Closes #1789
Closes #2233

## Change
This PR add support to Bedrock Converse API which enable to use any of
text genAI models in AWS Bedrock catalog (including Nova models)
A new BedrockChatModel is added in the converse package.
- Tool use is implemented
- Image content and PDF content is implemented

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


This PR follow the PR #2132. I proposed my help to @herbert-beckman on
#2132 , he gives a thumbs up so I started working on it. I opened a PR
on his (https://github.com/herbert-beckman/langchain4j/pull/1) but I
never had any reply since, so, as I can't push on the #2132 here I am
opening a new PR.
2025-01-30 17:29:57 +01:00
LucaPizzarelliDev 29370123cb
Implemented Bedrock Cohere Embedding (#2319)
## Change
Implemented `BedrockCohereEmbeddingModel`

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-01-30 11:55:35 +01:00
Florian Hotze 024e9eddd8
Support ContainsString metadata Filter (#2344)
## Change

This PR adds a new MetadataFilters that allows filtering metadata values
by checking whether they contain or not contain a given string.
Whilst this is less powerful than #2342, it is easier to implement in
embedding stores, this PR implements the `ContainsString` filter for the
following embedding stores:

- Milvus
- PgVector
- Qdrant

I tried to implement it for Chroma as well, but didn't find a way in the
Chroma docs to do so.

## General checklist

- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
2025-01-28 12:04:24 +01:00
Jan Martiska 4c3784a3a2
MCP: support logging (#2458)
Fixes https://github.com/langchain4j/langchain4j/issues/2457
2025-01-28 12:00:06 +01:00
Farah Juma e395991718
Add the ability to specify a message with the "context" role when using Ollama (#2399)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/2391

## Change
It's now possible to pass messages with the "context" role in addition
to messages with the usual "system", "user", etc. roles when using
Ollama.

This change is needed in order to be able to make use of the recent
[Granite Guardian
models](https://www.ibm.com/granite/docs/models/guardian/) with Ollama.
More details about this can be found in the [issue
description](https://github.com/langchain4j/langchain4j/issues/2391).


## General checklist
- [X] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-01-27 11:33:10 +01:00
Dmytro Liubarskyi 0a75a33c2e
OpenAI: ensure O1 models are supported (#2450)
## Change
- Ensured that O1 model series is supported
- Updated `OpenAiChatModelName` with all the latest models

## Breaking Changes
Since O1 does not support the `temperature` parameter, it is a good
occasion to finally remove the default vaue of the `temperature`
parameter from `OpenAiChatModel` and `OpenAiStreamingChatModel`.
It is also a good time to finally remove the default value of the
`modelName` parameter.

Please set those values explicitly now:
```java
OpenAiChatModel model = OpenAiChatModel.builder()
        .apiKey(System.getenv("OPENAI_API_KEY"))
        .defaultRequestParameters(ChatRequestParameters.builder()
                .modelName("gpt-4o-mini")
                .temperature(0.7)
                .build())
        .build();
```

## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [X] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring)
https://github.com/langchain4j/langchain4j-spring/pull/103
2025-01-26 18:15:23 +01:00
Konstantin Pavlov ae38e4a263
Introduce Kotlin custom builders and enhance dependencies (#2436)
## Issue
This extends Kotlin support for Chat Language Model #2197 

## Change

Introduce Kotlin custom builders and enhance dependencies

- Added type-safe Kotlin builders to improve ChatRequest creation for
enhanced usability and maintainability.
- Removed usage of deprecated `ChatLanguageModel.generate` in favour of
`ChatLanguageModel.chat`.
- Updated Kotlin dependencies.

Tests have been run in the [related PR on
fork](https://github.com/kpavlov/langchain4j/pull/21)

## General checklist
- [ ] There are no breaking changes
- [x] I have added unit and/or integration tests for my change.
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-01-24 13:29:08 +01:00
Dmytro Liubarskyi af1683e6eb docu: observability 2025-01-23 18:16:14 +01:00
Dmytro Liubarskyi 2010a563fc
Centralise observability/listener logic for chat models (#2403)
## Issue
Closes #2397


## Motivation
Currently there are a few problems with existing observability support
for chat models:
- not all models support it (see "Observability" column
[here](https://docs.langchain4j.dev/integrations/language-models/))
- the code to implement it is duplicated in each `ChatLanguageModel`
implementation
- there are redundant `ChatModelRequest` and `ChatModelResponse` types
- there is no way to propagate LLM-provider-specific chat request
parameters and chat response metadata


## Change
- centralised all the logic related to observability/listeners in
`ChatLanguageModel` and `StreamingChatLanguageModel`
- deprecated `ChatModelRequest` and `ChatModelResponse` in favour of
`ChatRequest` and `ChatResponse` in `ChatModelRequestContext`,
`ChatModelResponseContext` and `ChatModelErrorContext`
- migrated OpenAI integration (as a pilot) to inherit observability
logic from `ChatLanguageModel` and `StreamingChatLanguageModel`


## Breaking Changes

1. `OpenAiStreamingChatModel`: in case of errors that happen in the
middle of streaming, partial response (what was streamed before the
error occured) is not propagated into the `ChatModelListener.onError()`
any more in order to simplify the design and implementation. Please
reach out if you have any concerns about it.

2. `OpenAiChatModel` and `OpenAiStreamingChatModel`: if the
`maxCompletionTokens` property is set, it's value is now not propagated
into the `ChatModelListener` via `ChatModelRequest.maxTokens()`.
`ChatModelRequest.maxTokens()` will now return only the value of the
`maxTokens` parameter set on the `OpenAiChatModel` or
`OpenAiStreamingChatModel`.
Now you can get the value of the `maxCompletionTokens` parameter like
this:
```java
        ChatModelListener listener = new ChatModelListener() {
            @Override
            public void onRequest(ChatModelRequestContext requestContext) {
                ChatRequestParameters parameters = requestContext.chatRequest().parameters();
                if (parameters instanceof OpenAiChatRequestParameters openAiParameters) {
                    Integer maxCompletionTokens = openAiParameters.maxCompletionTokens();
                }
            }
        };
```


## Next Steps (next PRs)
- Migrate all existing `(Streaming)ChatLanguageModel` implementations
from their own (duplicated) observability functionality to inherit it
from `(Streaming)ChatLanguageModel`


## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and/or integration tests for my change
- [X] The tests cover both positive and negative cases
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [X] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

---------

Co-authored-by: Mario Fusco <mario.fusco@gmail.com>
2025-01-23 13:45:44 +01:00
Julien Dubois 2b18c84319
Improve documentation for Azure OpenAI, including Structured Outputs support (#2322)
As discussed in
https://github.com/langchain4j/langchain4j/pull/1982#issuecomment-2553095472
2025-01-23 12:10:59 +01:00
Eric Deandrea 9761ef9519
Classpath document source (#2060)
## Issue
Closes #2058

## Change
I Introduced new `ClassPathSource` and `ClassPathDocumentLoader` classes that are responsible for loading `Document`s from the class path.


## General checklist
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the [core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core) and [main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j) modules, and they are all green
- [x] I have added/updated the [documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features)
- [ ] I have added/updated [Spring Boot starter(s)](https://github.com/langchain4j/langchain4j-spring) (if applicable)
2025-01-22 18:23:47 +01:00
Martin7-1 b7e7a64d3a
Community document update (#2382)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes [community
issue#39](https://github.com/langchain4j/langchain4j-community/issues/39)

## Change
<!-- Please describe the changes you made. -->

1. Add configurable parameters in `DashScope` and `ZhiPuAi`.
2. Fix broken example link in the document.
3. How to migrate from main repo to community integrations.
4. Some introductions about community repo in the `intro.md`.
5. CONTRIBUTING.md update: consider adding integrations in community
repo first.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2025-01-17 11:17:19 +01:00
LangChain4j 27a14fcbe8 docu: added links to the documentation chatbot 2025-01-11 19:35:51 +01:00
LangChain4j 0c058ae5c2 docu: added links to the documentation chatbot 2025-01-11 19:12:23 +01:00
LangChain4j 10662ed4c6 docu: renamed files 2025-01-11 18:35:57 +01:00
lixw 009a473c8d
[FEATURE] add xinference doc (#2324)
> ## Issue
> Closes [langchain4j-community
#25](https://github.com/langchain4j/langchain4j-community/pull/25)
> 
> ## Change
> Add `langchain4j-community-xinference` document.
> 
> ## General checklist
> * [x]  There are no breaking changes
> * [ ]  I have added unit and integration tests for my change
> * [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
> * [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
> 
> * [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
> * [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
> * [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

Co-authored-by: lixw <>
2025-01-08 09:36:25 +01:00
Andrea Falco d0dbeff821
Use correct name in Eviction policy documentation (#2377)
## Change
Replace "MessageWindowChatMemory" with "TokenWindowChatMemory" in
Eviction policy documentation.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2025-01-08 09:33:44 +01:00
LangChain4j d3fc0401fb docu: testing 2025-01-04 18:23:53 +01:00
LangChain4j c0e735de3f docu: updated links to customer support agent example 2025-01-02 19:49:58 +01:00
LangChain4j dce5ae8bbb docu: added agents page 2025-01-02 11:01:44 +01:00
zhouhaojie e0a42e94a2
Correct a spelling mistake in structured-outputs.md (#2356) 2025-01-02 09:17:12 +01:00
LangChain4j 0f499c774c
Update index.mdx
docu: updated useful materials
2025-01-02 08:03:01 +01:00
LangChain4j 29d3a96390 fixed PgVector docu 2024-12-22 17:58:21 +01:00
LangChain4j 88adf9f1cb
Release 1.0.0-alpha1 (#2326) 2024-12-22 17:51:40 +01:00
Enigma 009d2f60c4
update spring-boot-integration.md for [add AiServiceRegisteredEvent] (#2203)
PR: https://github.com/langchain4j/langchain4j-spring/pull/89

## Issue
original PR link:
https://github.com/langchain4j/langchain4j-spring/pull/77
Issues link: langchain4j/langchain4j#2112

## Change
update spring-boot-integration.md for [add AiServiceRegisteredEvent]
2024-12-20 14:36:55 +01:00
LangChain4j 56724f4d19 Upgrade to Azure OpenAI SDK 1.0.0-beta.13 + Structured Outputs support (#1982) 2024-12-19 16:56:50 +01:00
LangChain4j 4720facff0 Ollama: support tools in streaming mode (#2210) 2024-12-18 13:15:02 +01:00
bidek 1f6e934f01
Structured output docs for Ollama (#2290)
## Change
Add documentation about Structured Outputs support in Ollama


## General checklist
- [x] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-12-18 09:35:40 +01:00
bidek 108a35cdd7
Ollama Structured Outputs (#2250)
## Issue
Closes #2246

## Change
[Structured Outputs](https://ollama.com/blog/structured-outputs) are now
supported by:
- `OllamaChatModel`
- `OllamaStreamingChatModel`
- `OllamaLanguageModel`
- `OllamaStreamingLanguageModel`

Read more
[here](https://docs.langchain4j.dev/tutorials/structured-outputs#json-schema)
and
[here](https://docs.langchain4j.dev/integrations/language-models/ollama).

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-12-16 14:41:51 +01:00
kuraleta 1482d285ad
Update pgvector.md (#2187)
## Change
Added PgVector documentation

## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-12-16 11:49:15 +01:00
Jan Martiska 90e7ff04f2
Initial implementation of the MCP client and tool provider (#2240)
## Issue
Closes #2213

## Change
See the examples in
https://github.com/langchain4j/langchain4j-examples/pull/134

## General checklist

- [x] There are no breaking changes
- [x] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases: not yet, but I
plan to add more proper error handling as a follow-up
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new maven module
- [x] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`
2024-12-10 19:25:56 +01:00
LangChain4j 2ad8e4e631 docu: Ollama: structured outputs 2024-12-06 20:59:02 +01:00
LangChain4j aa319f9a6d docu: WIP: structured outputs 2024-12-06 12:40:22 +01:00
Chao Wang 9c9bb97fa0
Resolve #2100 Update doc examples and describe 2 ways of running Ollama (#2244)
## Issue
Closes #2100

## Change
Update doc examples and describe 2 ways of running Ollama

- when Ollama runs locally
- when Ollama runs in testcontainers


## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and/or integration tests for my change
- [ ] The tests cover both positive and negative cases
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-12-06 09:30:33 +01:00
LangChain4j 725f63873a EmbeddingStore: implement addAll(ids, embeddings, segments) (#2156) 2024-12-04 18:02:33 +01:00
Jake Luciani 2666caa92f
Jlama: add tool support to streaming chat models. closes #2115 (#2181)
## Issue
Closes #2115 

## Change
Adds tool support to streaming chat models


## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
2024-12-03 18:00:38 +01:00
renovate[bot] 74cabab956
fix(deps): update docusaurus monorepo to v3.6.3 (#2172)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@docusaurus/core](https://redirect.github.com/facebook/docusaurus)
([source](https://redirect.github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus))
| [`3.6.1` ->
`3.6.3`](https://renovatebot.com/diffs/npm/@docusaurus%2fcore/3.6.1/3.6.3)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@docusaurus%2fcore/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@docusaurus%2fcore/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@docusaurus%2fcore/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@docusaurus%2fcore/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@docusaurus/module-type-aliases](https://redirect.github.com/facebook/docusaurus)
([source](https://redirect.github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-module-type-aliases))
| [`3.0.1` ->
`3.6.3`](https://renovatebot.com/diffs/npm/@docusaurus%2fmodule-type-aliases/3.0.1/3.6.3)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@docusaurus%2fmodule-type-aliases/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@docusaurus%2fmodule-type-aliases/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@docusaurus%2fmodule-type-aliases/3.0.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@docusaurus%2fmodule-type-aliases/3.0.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@docusaurus/plugin-content-docs](https://redirect.github.com/facebook/docusaurus)
([source](https://redirect.github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-plugin-content-docs))
| [`3.6.1` ->
`3.6.3`](https://renovatebot.com/diffs/npm/@docusaurus%2fplugin-content-docs/3.6.1/3.6.3)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@docusaurus%2fplugin-content-docs/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@docusaurus%2fplugin-content-docs/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@docusaurus%2fplugin-content-docs/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@docusaurus%2fplugin-content-docs/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@docusaurus/preset-classic](https://redirect.github.com/facebook/docusaurus)
([source](https://redirect.github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-preset-classic))
| [`3.6.1` ->
`3.6.3`](https://renovatebot.com/diffs/npm/@docusaurus%2fpreset-classic/3.6.1/3.6.3)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@docusaurus%2fpreset-classic/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@docusaurus%2fpreset-classic/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@docusaurus%2fpreset-classic/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@docusaurus%2fpreset-classic/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@docusaurus/theme-mermaid](https://redirect.github.com/facebook/docusaurus)
([source](https://redirect.github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-theme-mermaid))
| [`3.6.1` ->
`3.6.3`](https://renovatebot.com/diffs/npm/@docusaurus%2ftheme-mermaid/3.6.1/3.6.3)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@docusaurus%2ftheme-mermaid/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@docusaurus%2ftheme-mermaid/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@docusaurus%2ftheme-mermaid/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@docusaurus%2ftheme-mermaid/3.6.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [@docusaurus/types](https://redirect.github.com/facebook/docusaurus)
([source](https://redirect.github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-types))
| [`3.0.1` ->
`3.6.3`](https://renovatebot.com/diffs/npm/@docusaurus%2ftypes/3.0.1/3.6.3)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@docusaurus%2ftypes/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@docusaurus%2ftypes/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@docusaurus%2ftypes/3.0.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@docusaurus%2ftypes/3.0.1/3.6.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>facebook/docusaurus (@&#8203;docusaurus/core)</summary>

###
[`v3.6.3`](https://redirect.github.com/facebook/docusaurus/blob/HEAD/CHANGELOG.md#363-2024-11-22)

[Compare
Source](https://redirect.github.com/facebook/docusaurus/compare/v3.6.2...v3.6.3)

##### 🐛 Bug Fix

-   `docusaurus`
-
[#&#8203;10712](https://redirect.github.com/facebook/docusaurus/pull/10712)
fix(core): disable Rspack incremental in dev
([@&#8203;slorber](https://redirect.github.com/slorber))

##### Committers: 1

- Sébastien Lorber
([@&#8203;slorber](https://redirect.github.com/slorber))

###
[`v3.6.2`](https://redirect.github.com/facebook/docusaurus/releases/tag/v3.6.2):
3.6.2

[Compare
Source](https://redirect.github.com/facebook/docusaurus/compare/v3.6.1...v3.6.2)

#### 3.6.2 (2024-11-19)

##### 🐛 Bug Fix

-   `docusaurus-module-type-aliases`
-
[#&#8203;10693](https://redirect.github.com/facebook/docusaurus/pull/10693)
fix(types): add missing ambiant TS declarations for .md / .mdx partials
([@&#8203;slorber](https://redirect.github.com/slorber))
-   `docusaurus-theme-translations`
-
[#&#8203;10688](https://redirect.github.com/facebook/docusaurus/pull/10688)
fix(theme-translation): add and update Japanese translations
([@&#8203;Ryoga-exe](https://redirect.github.com/Ryoga-exe))
-   `docusaurus`
-
[#&#8203;10685](https://redirect.github.com/facebook/docusaurus/pull/10685)
fix(cli): `docusaurus --help` should print plugin commands using
`extendCli()` ([@&#8203;slorber](https://redirect.github.com/slorber))
-   `docusaurus-bundler`
-
[#&#8203;10680](https://redirect.github.com/facebook/docusaurus/pull/10680)
fix(bundler): allow CSS nesting by default, restore postcss-preset-env
([@&#8203;slorber](https://redirect.github.com/slorber))
-   `create-docusaurus`
-
[#&#8203;10676](https://redirect.github.com/facebook/docusaurus/pull/10676)
fix(create-docusaurus): add ts exclude to TS init template
([@&#8203;slorber](https://redirect.github.com/slorber))
-   `docusaurus-bundler`, `docusaurus-faster`, `docusaurus`
-
[#&#8203;10648](https://redirect.github.com/facebook/docusaurus/pull/10648)
fix(faster): Upgrade to Rspack 1.1.1, fix build progress bar display
([@&#8203;slorber](https://redirect.github.com/slorber))

##### 🔧 Maintenance

-
[#&#8203;10691](https://redirect.github.com/facebook/docusaurus/pull/10691)
chore(ci): retry `yarn install` to ignore temporary network errors
([@&#8203;slorber](https://redirect.github.com/slorber))

##### Committers: 5

-   Junior_Gx ([@&#8203;goffxnca](https://redirect.github.com/goffxnca))
- Kyle Tsang
([@&#8203;kyletsang](https://redirect.github.com/kyletsang))
-   Ryoga ([@&#8203;Ryoga-exe](https://redirect.github.com/Ryoga-exe))
- Sébastien Lorber
([@&#8203;slorber](https://redirect.github.com/slorber))
-   Zwyx ([@&#8203;Zwyx](https://redirect.github.com/Zwyx))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/langchain4j/langchain4j).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-03 09:06:18 +01:00
LangChain4j da66ca7722 docu: WIP: structured outputs 2024-11-29 16:30:39 +01:00
LangChain4j e963443823 docu: WIP: structured outputs 2024-11-29 16:20:09 +01:00
LangChain4j 6ae940ed4f docu: WIP: structured outputs 2024-11-29 12:48:04 +01:00
LangChain4j 748a8da5f5 docu: WIP: structured outputs 2024-11-29 12:46:04 +01:00
LangChain4j 500aeff270 docu: WIP: structured outputs 2024-11-29 12:24:28 +01:00
LangChain4j 7c2e10ca3a docu: WIP: structured outputs 2024-11-29 12:07:12 +01:00
Florian Bernard 73aea97841
[FEATURE] Add DuckDB documentation (#2183) (#2212)
## Issue
Closes #2183 

## Change
Following this PR #2184 add DuckDB documentation
2024-11-29 09:08:18 +01:00
Konstantin Pavlov 2a058796d1
#1897 Add Kotlin dependencies, plugins, and extensions (#2197)
## Issue
Discussion #1897

## Change
Porting
[kpavlov/langchain4j-kotlin](https://github.com/kpavlov/langchain4j-kotlin)

Integrated Kotlin support by adding necessary dependencies and plugins
to the project. Introduced Kotlin extensions for ChatLanguageModel with
corresponding tests. Updated .editorconfig for improved import and
properties formatting.

- Kotlin dependencies added as optional, so it will not pollute java
projects
- Maven Javadoc plugin replaced with
[Dokka](https://kotlinlang.org/docs/dokka-maven.html) in core module in
order to include both Java and Kotlin docs
- Upgrade Kotlin to
[2.1.0](https://blog.jetbrains.com/kotlin/2024/11/kotlin-2-1-0-released/)

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-28 11:53:15 +01:00
Martin7-1 cafeb93d6c
Migrate langchain4j-dashscope (#2200)
## Change
1. Delete Migrated `langchain4j-dashscope`.
2. Some document improvment about integrations.

## General checklist
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-27 13:36:07 +01:00
Maxim Katcharov 6802b50f01
Add MongoDB filtering and deletion, and various upgrades (#1869)
## Issue
Closes #1868
Closes #1532

## Change
* Implement mongodb filtering and deletion (#1868)
* Move test boilerplate into a TestHelper
* Throw an exception if no index exists once the store is created
(addresses #1532)
* Upgrade mongodb-driver-sync to 5.2.0
* Upgrade from legacy knnVector to vectorSearch
* Minor refactoring and fixes

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] **No changes to core.** I have manually run all the unit and
integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-27 09:52:10 +01:00
LangChain4j d1aba4376a Support anyOf in JSON schema (#2081) (#2148) 2024-11-26 18:21:25 +01:00
LangChain4j 5503eddb15 feat: Qdrant Embedding Removal (#2179) 2024-11-26 17:43:18 +01:00
LangChain4j 5f4fcd05b8 docu: tools 2024-11-26 14:11:21 +01:00
LangChain4j ebbd397711 docu: WIP: structured outputs 2024-11-22 16:28:37 +01:00
LangChain4j 482df66db3 docu: WIP: structured outputs 2024-11-22 14:54:02 +01:00
LangChain4j 5f78c9a2be docu: WIP: structured outputs 2024-11-22 14:28:08 +01:00
LangChain4j 2cfa56d98a docu: changed version to 0.36.2 2024-11-21 18:05:26 +01:00
Martin7-1 da42e9fcdb
Remove community modules (#2151)
## Change
1. Migrating `langchain4j-chatglm`, `langchain4j-vearch`,
`langchain4j-qianfan`, `langchain4j-zhipu-ai` from main repo to
community repo.
2. Add docs about migrating.

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-20 08:10:07 +01:00
LangChain4j 8a1d755196
Release 0.36.1 (#2149) 2024-11-19 16:26:52 +01:00
LangChain4j e84834d8fd docu: AI services 2024-11-17 15:53:24 +01:00
LangChain4j 2c1d26ed8b docu: multimodality 2024-11-15 16:43:10 +01:00
LangChain4j eb7f0c04cb docu: tool execution in streaming mode 2024-11-14 08:04:55 +01:00
LangChain4j df6f17c58c docu: added "tools in streaming mode" to the LLM comparison table 2024-11-14 07:58:27 +01:00
LangChain4j 6813c36168 docu: SB tools 2024-11-14 07:58:26 +01:00
LangChain4j 96b078ea6c docu: fixed Weaviate 2024-11-13 16:56:15 +01:00
LangChain4j e447c90468 docu: fixed Weaviate 2024-11-13 16:50:34 +01:00
LangChain4j bd53af5941 docu: updated link 2024-11-13 16:33:57 +01:00
LangChain4j 4d6755161d
Release 0.36.0 (#2104) 2024-11-13 15:48:51 +01:00
LangChain4j 5ad2fc5a92 Ollama: docu fix 2024-11-13 12:39:26 +01:00
Omar 78ff61b40e
mistral integrate moderation (#2055)
## Issue
Closes #2049

## Change


## General checklist
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-13 10:26:35 +01:00
Omar dbf180f846
Milvus: option to set MilvusServiceClient (#2042)
## Issue
Closes #2020

## Change
Added an option to set `MilvusServiceClient` when creating
`MilvusEmbeddingStore`

## General checklist
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-12 14:39:37 +01:00
Jaland da95a30c3c
Weaviate: configurable metadata keys (#1788)
## Issue
Adding flexibility to the metadata tags that are reported.
## Change

Currently, metadata is hard coded to the key "_metadata" but this pr
lets you choose a different key OR you can use a set of values from the
base obect.


## General checklist
- [ x] There are no breaking changes
- [ x] I have added unit and integration tests for my change
- [ x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
gchain4j-bom/pom.xml)

## Checklist for changing existing embedding store integration
- [ x] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-11-12 08:53:15 +01:00
Konstantin Pavlov e2d6a6e4d1
site: update npm dependencies (#2062)
## Issue
Node version requirement (20+) is not well documented. `npm audit`
detected 3 vulnerabilities.

## Change
Run `npm audit fix & npm up`

- Updated the Node.js version requirement to 20 in package.json and
introduced a .nvmrc file for Node Version Manager compatibility. Added
instructions in the README for using nvm to manage Node versions.
- Updated `node` version requirement to >=20.0 and updated several
package versions to their latest releases. Removed unused
`fast-url-parser` and `punycode` dependencies from the
`package-lock.json` to clean up the project.
- Update dependencies in package-lock.json for Algolia packages
- Upgraded various Algolia-related dependencies to their respective
latest versions. This includes packages like
`@algolia/autocomplete-core`, `@algolia/client-common`, and several
others to ensure compatibility and new feature integration.
- Now npm audit fix found 0 vulnerabilities

## General checklist
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-12 08:17:38 +01:00
LangChain4j 95f35255f4 docu: Flux 2024-11-11 13:23:33 +01:00
LangChain4j cd3ba0d51d docu: RAG 2024-11-08 15:31:21 +01:00
LangChain4j e7763cc91d docu: rearranged links 2024-11-08 15:28:32 +01:00
LangChain4j 0b4795bb20 docu: RAG 2024-11-08 15:10:36 +01:00
Claudio Silva Junior 33ab87de37
Anthropic: caching of system messages and tools (#1826)
## Issue
Closes #1915

## Change
Implemented caching of system messages and tools for Anthropic.

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-08 10:52:31 +01:00
LangChain4j 671ab5c103 docu: updated Azure OpenAI SB properties 2024-11-07 16:04:22 +01:00
Martin7-1 1f2911c92d
[Feature] Add clickhouse docs (#2037)
## Issue
Closes [langchain4j-community
#5](https://github.com/langchain4j/langchain4j-community/issues/5)

## Change
Add `langchain4j-community-clickhouse` document.

## General checklist
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-11-07 09:55:58 +01:00
Aleks Seovic 9af8f8d083
Add Oracle Coherence embedding store implementation (#2003)
## Issue
Closes #2002 

## Change
Added `langchain4j-coherence` module that provides embedding store and
chat memory store implementations that use [Oracle Coherence Community
Edition](https://github.com/oracle/coherence) as a store.

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [*] I have manually run all the unit and integration tests in the
[core]
(https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green (they are not, but I doubt it had
anything to do with my changes -- Jacoco is failing the build because
`core` requires 75% code coverage and it's only 68% at the moment)
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

We have all three of the above ready to submit, but will wait until this
PR is reviewed and approved before submitting them.

## Checklist for adding new maven module
- [X] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`


## Checklist for adding new embedding store integration
- [X] I have added a `CoherenceEmbeddingStoreIT` that extends from
either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [X] I have added a `CoherenceEmbeddingStoreRemovalIT` that extends
from `EmbeddingStoreWithRemovalIT`
2024-11-06 12:32:55 +01:00
dependabot[bot] b509fd18d2
Bump cookie and express in /docs (#2034)
Bumps [cookie](https://github.com/jshttp/cookie) and
[express](https://github.com/expressjs/express). These dependencies
needed to be updated together.
Updates `cookie` from 0.6.0 to 0.7.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/jshttp/cookie/releases">cookie's
releases</a>.</em></p>
<blockquote>
<h2>0.7.1</h2>
<p><strong>Fixed</strong></p>
<ul>
<li>Allow leading dot for domain (<a
href="https://redirect.github.com/jshttp/cookie/issues/174">#174</a>)
<ul>
<li>Although not permitted in the spec, some users expect this to work
and user agents ignore the leading dot according to spec</li>
</ul>
</li>
<li>Add fast path for <code>serialize</code> without options, use
<code>obj.hasOwnProperty</code> when parsing (<a
href="https://redirect.github.com/jshttp/cookie/issues/172">#172</a>)</li>
</ul>
<p><a
href="https://github.com/jshttp/cookie/compare/v0.7.0...v0.7.1">https://github.com/jshttp/cookie/compare/v0.7.0...v0.7.1</a></p>
<h2>0.7.0</h2>
<ul>
<li>perf: parse cookies ~10% faster (<a
href="https://redirect.github.com/jshttp/cookie/issues/144">#144</a> by
<a href="https://github.com/kurtextrem"><code>@​kurtextrem</code></a>
and <a
href="https://redirect.github.com/jshttp/cookie/issues/170">#170</a>)</li>
<li>fix: narrow the validation of cookies to match RFC6265 (<a
href="https://redirect.github.com/jshttp/cookie/issues/167">#167</a> by
<a href="https://github.com/bewinsnw"><code>@​bewinsnw</code></a>)</li>
<li>fix: add <code>main</code> to <code>package.json</code> for rspack
(<a href="https://redirect.github.com/jshttp/cookie/issues/166">#166</a>
by <a
href="https://github.com/proudparrot2"><code>@​proudparrot2</code></a>)</li>
</ul>
<p><a
href="https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.0">https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cf4658f492"><code>cf4658f</code></a>
0.7.1</li>
<li><a
href="6a8b8f5a49"><code>6a8b8f5</code></a>
Allow leading dot for domain (<a
href="https://redirect.github.com/jshttp/cookie/issues/174">#174</a>)</li>
<li><a
href="58015c0b93"><code>58015c0</code></a>
Remove more code and perf wins (<a
href="https://redirect.github.com/jshttp/cookie/issues/172">#172</a>)</li>
<li><a
href="ab057d6c06"><code>ab057d6</code></a>
0.7.0</li>
<li><a
href="5f02ca8768"><code>5f02ca8</code></a>
Migrate history to GitHub releases</li>
<li><a
href="a5d591ce84"><code>a5d591c</code></a>
Migrate history to GitHub releases</li>
<li><a
href="51968f94b5"><code>51968f9</code></a>
Skip isNaN</li>
<li><a
href="9e7ca51ade"><code>9e7ca51</code></a>
perf(parse): cache length, return early (<a
href="https://redirect.github.com/jshttp/cookie/issues/144">#144</a>)</li>
<li><a
href="d6f39b0aab"><code>d6f39b0</code></a>
Fix tests for old node</li>
<li><a
href="6bb701f14e"><code>6bb701f</code></a>
Remove failing scorecard</li>
<li>Additional commits viewable in <a
href="https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~blakeembrey">blakeembrey</a>, a new
releaser for cookie since your current version.</p>
</details>
<br />

Updates `express` from 4.21.0 to 4.21.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/express/releases">express's
releases</a>.</em></p>
<blockquote>
<h2>4.21.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Backport a fix for CVE-2024-47764 to the 4.x branch by <a
href="https://github.com/joshbuker"><code>@​joshbuker</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/6029">expressjs/express#6029</a></li>
<li>Release: 4.21.1 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/6031">expressjs/express#6031</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/express/compare/4.21.0...4.21.1">https://github.com/expressjs/express/compare/4.21.0...4.21.1</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/express/blob/4.21.1/History.md">express's
changelog</a>.</em></p>
<blockquote>
<h1>4.21.1 / 2024-10-08</h1>
<ul>
<li>Backported a fix for <a
href="https://nvd.nist.gov/vuln/detail/CVE-2024-47764">CVE-2024-47764</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8e229f9275"><code>8e229f9</code></a>
4.21.1</li>
<li><a
href="a024c8a7b6"><code>a024c8a</code></a>
fix(deps): cookie@0.7.1</li>
<li>See full diff in <a
href="https://github.com/expressjs/express/compare/4.21.0...4.21.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 12:05:15 +01:00
LangChain4j 75bf12306d docu: added structured outputs to the comparison table 2024-11-05 15:01:35 +01:00
LangChain4j ec30719d2a docu: added structured outputs to the comparison table 2024-11-05 14:49:35 +01:00
LangChain4j b8267d6f0c docu: added structured outputs to the comparison table 2024-11-05 14:47:33 +01:00
Bjarne-Kinkel aa0e488166
Adding GoogleAiGeminiStreamingChatModel (#1951)
## Issue
Closes #1903

## Change
Implemented the GoogleAiGeminiStreamingChatModel.

This PR depends on #1950.

## General checklist
- [X] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-10-31 10:07:50 +01:00
Antoine Rey d0fe74b421
Provide additional documentation details for the OpenAI demo key (#2000)
## Change

While using the OpenAI demo API key as described in the documentation
[here](https://docs.langchain4j.dev/integrations/language-models/open-ai),
I encountered two unexpected errors. Consequently, I've updated the
documentation.

> dev.ai4j.openai4j.OpenAiHttpException: Maximum number of tokens per
request for demonstration purposes is 5000. If you wish to use more,
please use your own OpenAI API key.

> dev.ai4j.openai4j.OpenAiHttpException: Only gpt-4o-mini model is
available for demonstration purposes. If you wish to use another model,
please use your own OpenAI API key.

## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)


## Checklist for adding new maven module
- [ ] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`

## Checklist for adding new embedding store integration
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT` that
extends from `EmbeddingStoreWithRemovalIT`

## Checklist for changing existing embedding store integration
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-10-29 10:17:19 +01:00
LangChain4j d262dbbd9b docu: ContentInjector 2024-10-25 15:47:04 +02:00
LangChain4j a7964b460d #1966: added warnings to documentation and javadoc 2024-10-24 11:37:02 +02:00
dependabot[bot] 5aac874a46
Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /docs (#1975)
Bumps
[http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
from 2.0.6 to 2.0.7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/chimurai/http-proxy-middleware/releases">http-proxy-middleware's
releases</a>.</em></p>
<blockquote>
<h2>v2.0.7</h2>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7">https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7</a></p>
<h2>v2.0.7-beta.1</h2>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/chimurai/http-proxy-middleware/compare/v2.0.7-beta.0...v2.0.7-beta.1">https://github.com/chimurai/http-proxy-middleware/compare/v2.0.7-beta.0...v2.0.7-beta.1</a></p>
<h2>v2.0.7-beta.0</h2>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7-beta.0">https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7-beta.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md">http-proxy-middleware's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.7">v2.0.7</a></h2>
<ul>
<li>ci(github actions): add publish.yml</li>
<li>fix(filter): handle errors</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1e92339098"><code>1e92339</code></a>
ci(github-actions): fix npm tag</li>
<li><a
href="90afb7c9a6"><code>90afb7c</code></a>
chore(package): v2.0.7</li>
<li><a
href="0b4274e8cc"><code>0b4274e</code></a>
fix(filter): handle errors</li>
<li><a
href="1bd6dd578b"><code>1bd6dd5</code></a>
ci(github actions): add publish.yml</li>
<li>See full diff in <a
href="https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=http-proxy-middleware&package-manager=npm_and_yarn&previous-version=2.0.6&new-version=2.0.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-23 11:19:28 +02:00
dependabot[bot] 8a96a3cae2
Bump mermaid from 10.6.1 to 10.9.3 in /docs (#1973)
Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.6.1 to
10.9.3.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="85ec96a72d"><code>85ec96a</code></a>
chore: bump mermaid version to v10.9.3</li>
<li><a
href="9301a5788a"><code>9301a57</code></a>
style: prettify src/diagrams/block/blockDB.ts</li>
<li><a
href="2bedd0ef87"><code>2bedd0e</code></a>
chore(deps): update katex to 0.16.11</li>
<li><a
href="92a07ffe40"><code>92a07ff</code></a>
chore(deps): update bundled DOMPurify to 3.1.6</li>
<li><a
href="4dd4997c4d"><code>4dd4997</code></a>
chore: Bump version</li>
<li><a
href="fc61512a0a"><code>fc61512</code></a>
[10] ci: upgrade to pnpm/action-setup@v4 to avoid CI failures</li>
<li><a
href="402abdf883"><code>402abdf</code></a>
[10] fix: ban version v3.1.7 of DOMPurify</li>
<li><a
href="8d815f878c"><code>8d815f8</code></a>
Lint fix</li>
<li><a
href="dab26df9c4"><code>dab26df</code></a>
Fix for proper handling of block-diagram labels</li>
<li><a
href="c7fe9a6465"><code>c7fe9a6</code></a>
Fix for proper handling of block-diagram labels</li>
<li>Additional commits viewable in <a
href="https://github.com/mermaid-js/mermaid/compare/v10.6.1...v10.9.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mermaid&package-manager=npm_and_yarn&previous-version=10.6.1&new-version=10.9.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-23 11:15:27 +02:00
LangChain4j a0a9a285ed Cleanup after #1668: simplified JsonObjectSchema API 2024-10-22 22:51:40 +02:00
LangChain4j b6f2cd685f
Fix #1747 (#1949)
## Issue
Fixes #1747

## Change
Fixed this bug for Milvus and Chroma.

Did not manage to fix it for Pinecone because Pinecone can store
`Integer`/`Long` only as `Double`. We could theoretically store them as
`String`s, but then metadata filtering for `Integer`/`Long` values will
not work. For now I've left the comment in the `PineconeEmbeddingStore`
Javadoc and Pinecone documentation about the bug and possible
workaround.

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-10-21 13:38:53 +02:00
LangChain4j 24a6f28b5f docu: added community repo 2024-10-17 10:34:41 +02:00
LangChain4j 5081b6972a feat: Tracking input tokens on embeddings store ingestor (#1907) 2024-10-17 10:12:55 +02:00
LangChain4j c6f4277916
New low-level API to specify tool parameters (#1668)
## Issue
Closes #896
Fixes #1480
Fixes #1881
Fixes #1858
Fixes #1865

## Context
Schema for tool parameters in the low-level API (`ChatLanguageModel` +
`ToolSpecification`) is currently specified using `ToolParameters` and
`JsonSchemaProperty` classes. This API works fine for simple cases, but
it does not work well for more complicated cases (e.g., when nested
objects or collections or recursion is required).

Moreover, [Structured
Outputs](https://github.com/langchain4j/langchain4j/pull/1590) feature
is using another API and a lot of logic between tools and structured
outputs is duplicated and out of sync.


## Change
`ToolParameters` and `JsonSchemaProperty` classes are now deprecated in
favour of new `JsonSchemaElement` API (which is used for Structured
Outputs as well). Most of the logic between this 2 features is now
unified.

`JsonSchemaElement` represents a schema for a JSON element. It can be of
such types:
- `JsonArraySchema`
- `JsonBooleanSchema`
- `JsonEnumSchema`
- `JsonIntegerSchema`
- `JsonNumberSchema`
- `JsonObjectSchema`
- `JsonReferenceSchema`
- `JsonStringSchema`

All model providers that support tools (see the list below) were updated
to support the new API. Old API is still supported for backward
compatibility, but will be removed in the future.

`ToolSpecifications` helper class now generates `ToolSpecification`s
using the new API only.

Example of the new API:
```java
ToolSpecification.builder()
    .name("weather")
    .description("Returns the current weather in the specified city")
    .parameters(JsonObjectSchema.builder()
        .addStringProperty("city", s -> s.description("The name of the city, e.g., Munich"))
        .addEnumProperty("units", TemperatureUnit.class)
        .required("city") // the required properties should be specified explicitly
        .build())
    .build();
```

`JsonObjectSchema` builder has some helper methods to make it easier to
add properties (e.g., `addProperty`, `addStringProperty`,
`addIntegerProperty`, etc.), but properties can also be specified using
a map:
```java
ToolSpecification.builder()
    .name("weather")
    .description("Returns the current weather in the specified city")
    .parameters(JsonObjectSchema.builder()
        .properties(Map.of(
            "city", JsonStringSchema.builder().description("The name of the city, e.g., Munich").build(),
            "units", JsonEnumSchema.builder().enumValues("CELSIUS", "FAHRENHEIT").build()
        ))
        .required("city") // the required properties should be specified explicitly
        .build())
    .build();
```

### Providers that support new `JsonSchemaElement` for tools
- [x] Amazon Bedrock
- [X] Anthropic
- [X] Azure OpenAI
- [X] DashScope
- [x] GitHub Models
- [X] Google AI Gemini
- [X] Google Vertex AI Gemini
- [x] Jlama
- [x] LocalAI
- [X] Mistral AI
- [X] Ollama
- [X] OpenAI
- [x] Qianfan
- [x] Zhipu AI

### Tested Providers
- [x] Amazon Bedrock
- [x] Anthropic
- [x] Azure OpenAI
- [x] DashScope
- [x] GitHub Models
- [x] Google AI Gemini
- [x] Google Vertex AI Gemini
- [x] Jlama
- [ ] LocalAI
- [x] Mistral AI
- [x] Ollama
- [x] OpenAI
- [x] Qianfan
- [x] Zhipu AI

### Additional Changes
Several bugs have been fixed along the way (see the list of Github
issues on the top).

### Breaking changes
- `ToolSpecification.parameters()` method has been renamed into
`toolParameters()`

### Potentially breaking changes
- `ToolSpecifications` helper class now generates `ToolSpecification`s
with parameters defined using the new API (`JsonObjectSchema`) instead
of the old API (`ToolParameters`).
- If `@Tool` does not have a description (`value` annotation attribute),
`ToolSpecifications` will return `ToolSpecification` with `description()
== null`

## General checklist
- [ ] There are no breaking changes (Most of the use cases should not
break)
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-10-16 13:30:58 +02:00
LangChain4j 486d362331 docu 2024-10-11 22:16:12 +02:00
LangChain4j 2e100e146a Adding Callback Support for Tool Execution (Stream Mode) (#1818) 2024-10-10 17:46:18 +02:00
Antonio Goncalves a4e25dfe6a
Adding Understanding LC4j book to learning materials (#1883)
<!--
Thank you so much for your contribution!

Please fill in all the sections below.
Please open the PR as a draft initially. Once it is reviewed and
approved, we will ask you to add documentation and examples.
Please note that PRs with breaking changes or without tests will be
rejected.

Please note that PRs will be reviewed based on the priority of the
issues they address.
We ask for your patience. We are doing our best to review your PR as
quickly as possible.
Please refrain from pinging and asking when it will be reviewed. Thank
you for understanding!
-->

## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
example: "Closes #1234" or "Fixes #1234" -->
Closes #

## Change
<!-- Please describe the changes you made. -->


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-10-07 12:34:26 +02:00
LangChain4j dc6bba61dd
Fix #1863: Allow using Map<K,V> as a return type of AI Service method. (#1873)
## Issue
Fixes #1863

## Change
Allow using `Map<K,V>` as a return type of AI Service method.
Added new method `<T> T fromJson(String json, Type type)` to
`JsonCodec`, Quarkus extension will need to implement it. cc @geoand

## General checklist
- [ ] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-10-07 09:58:58 +02:00
Antonio Goncalves 92fcf9ce28
Add some documentation about LambdaStreamingResponseHandler (#1844) 2024-09-27 13:06:36 +02:00
LangChain4j 79f03dff36
Release 0.35.0 (#1829) 2024-09-25 13:16:03 +02:00
Julien Dubois d546c64511
Support for GitHub Models using the Azure AI Inference API (#1807)
Fix #1719

This adds GitHub Models (see https://github.com/marketplace/models )
support with the new Azure AI Inference API Java SDK.
2024-09-24 19:18:42 +02:00
LangChain4j 42c958a458
Extract HtmlTextExtractor into its own module (#1811)
## Issue
Closes #1049

## Change
Extracted `HtmlTextExtractor` into
`langchain4j-document-transformer-jsoup` module.
Renamed `HtmlToTextDocumentTransformer` into `HtmlTextExtractor`.

Please import:
```xml
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-document-transformer-jsoup</artifactId>
    <version>0.35.0</version>
</dependency>
```

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-24 15:08:23 +02:00
LangChain4j 2929912448 Integration with Voyage (#1816) 2024-09-24 09:07:34 +02:00
Martin7-1 9e63004370
Integration with Voyage (#1816)
## Issue
Closes #1814 and #1813 

## Change
1. Integration `EmbeddingModel` and `ScoringModel` with `Voyage`.
2. Add document about `VoyageEmbeddingModel` and `VoyageScoringModel`

Related PR:

1. [Voyage
Example](https://github.com/langchain4j/langchain4j-examples/pull/109)
2. [Voyage Spring
Boot](https://github.com/langchain4j/langchain4j-spring/pull/42)

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [x] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
2024-09-24 08:59:01 +02:00
Guillaume Laforge 9e2ee938d1
New ScoringModel for Google Cloud Vertex AI Ranking API (#1820)
## Issue
Closes #1819

## Change
Add support for the Vertex AI Ranking API, by implement a `ScoringModel`
for it.

## General checklist

- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-24 08:05:19 +02:00
Guillaume Laforge 6bd851fefc
fix(Google AI Gemini) — Fixed wrong mapping between function execution requests and function execution responses. (#1802)
Added a test using `AiServices`.
Function execution requests were mapped to function execution responses.
2024-09-23 12:29:57 +02:00
Milan Le d1f5775f8b
FEATURE: Anthropic streaming with tools (#1795)
## Issue
Closes #1738

## Change
- Added AnthropicContentBlockType an enum that specifies content to
follow (text, or tool_use).
- Added AnthropicToolChoice, an enum
- Introduced AnthropicToolExecutionRequestBuilder to build tool
execution requests.
- Updated
`langchain4j-anthropic/src/main/resources/META-INF/native-image/dev.langchain4j/langchain4j-anthropic/reflect-config.json`
- Update handling of streamed content for tools
- Added integration tests

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-23 11:57:33 +02:00
LangChain4j 4af5306d50 docu: AI Services, structured outputs 2024-09-20 17:04:45 +02:00
LangChain4j 4ae78f8738 docu: Spring Boot component wiring 2024-09-20 15:47:55 +02:00
LangChain4j 8ee79fa5f6 docu: Flux 2024-09-20 15:06:50 +02:00
LangChain4j 0e573e9925 docu: logging 2024-09-20 15:00:22 +02:00
LangChain4j 40b0d01349 add scoring onnx (#1769) 2024-09-20 12:21:44 +02:00
1758225523 1c0671617d
add scoring onnx (#1769)
## Issue
Closes #1549

## Change
OnnxScoringModel similar to OnnxEmbeddingModel


## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green

## Checklist for adding new model integration
- [X] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
2024-09-20 12:18:45 +02:00
LangChain4j d66fa8554b Added listener on aws bedrock (#1805) 2024-09-20 11:41:58 +02:00
Guillaume Laforge abd98a8b0b
Vertex AI Gemini documentation with lots of examples (#1799) 2024-09-19 16:18:05 +02:00
Guillaume Laforge 34d4af44a5
Updated documentation for the Google Cloud Vertex AI embedding models and added new parameters (auto truncation and output dimensionality) (#1796)
## Change

Updated documentation for the Vertex AI embedding models, and also added
support for recent new parameters like autoTruncate and
outputDimensionality

## General checklist

- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-19 09:31:29 +02:00
ScriptShi be7454a7c6
Add langchain4j-tablestore Integration: TablestoreEmbeddingStore/TablestoreChatMemoryStore (#1650)
## Change
Add langchain4j-tablestore Integration: TablestoreEmbeddingStore /
TablestoreChatMemoryStore

## General checklist
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [x] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
2024-09-18 11:41:53 +02:00
Herbert Beckman 9ea2e27337
[FEAT] Add Function Calling to Amazon Bedrock integration (#1755)
## Issue
Closes #1074

## Change
Add function calling to Amazon Bedrock integration and his available
models by the
[doc](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features).

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-18 10:43:14 +02:00
dependabot[bot] b97492773a
Bump dompurify from 3.0.6 to 3.1.6 in /docs (#1787)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.0.6 to
3.1.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cure53/DOMPurify/releases">dompurify's
releases</a>.</em></p>
<blockquote>
<h2>DOMPurify 3.1.6</h2>
<ul>
<li>Fixed an issue with the execution logic of attribute hooks to
prevent bypasses, thanks <a
href="https://github.com/kevin-mizu"><code>@​kevin-mizu</code></a></li>
<li>Fixed an issue with element removal leading to uncaught errors
through DOM Clobbering, thanks <a
href="https://github.com/realansgar"><code>@​realansgar</code></a></li>
<li>Fixed a minor problem with the bower file pointing to the wrong dist
path</li>
<li>Fixed several minor typos in docs, comments and comment blocks,
thanks <a
href="https://github.com/Rotzbua"><code>@​Rotzbua</code></a></li>
<li>Updated several development dependencies</li>
</ul>
<h2>DOMPurify 3.1.5</h2>
<ul>
<li>Fixed a minor issue with the dist paths in <code>bower.js</code>,
thanks <a
href="https://github.com/HakumenNC"><code>@​HakumenNC</code></a></li>
<li>Fixed a minor issue with sanitizing HTML coming from copy&amp;paste
Word content, thanks <a
href="https://github.com/kakao-bishop-cho"><code>@​kakao-bishop-cho</code></a></li>
</ul>
<h2>DOMPurify 3.1.4</h2>
<ul>
<li>Fixed an issue with the recently implemented <code>isNaN</code>
checks, thanks <a
href="https://github.com/tulach"><code>@​tulach</code></a></li>
<li>Added several new popover attributes to allow-list, thanks <a
href="https://github.com/Gigabyte5671"><code>@​Gigabyte5671</code></a></li>
<li>Fixed the tests and adjusted the test runner to cover all
branches</li>
</ul>
<h2>DOMPurify 3.1.3</h2>
<ul>
<li>Fixed several mXSS variations found by and thanks to <a
href="https://github.com/kevin-mizu"><code>@​kevin-mizu</code></a> &amp;
<a href="https://github.com/Ry0taK"><code>@​Ry0taK</code></a></li>
<li>Added better configurability for comment scrubbing default
behavior</li>
<li>Added better hardening against Prototype Pollution attacks, thanks
<a
href="https://github.com/kevin-mizu"><code>@​kevin-mizu</code></a></li>
<li>Added better handling and readability of the <code>nodeType</code>
property, thanks <a
href="https://github.com/ssi02014"><code>@​ssi02014</code></a></li>
<li>Fixed some smaller issues in README and other documentation</li>
</ul>
<h2>DOMPurify 3.1.2</h2>
<ul>
<li>Addressed and fixed a mXSS variation found by <a
href="https://github.com/kevin-mizu"><code>@​kevin-mizu</code></a></li>
<li>Addressed and fixed a mXSS variation found by <a
href="https://twitter.com/hash_kitten">Adam Kues</a> of Assetnote</li>
<li>Updated tests for older Safari and Chrome versions</li>
</ul>
<h2>DOMPurify 3.1.1</h2>
<ul>
<li>Fixed an mXSS sanitiser bypass reported by <a
href="https://github.com/icesfont"><code>@​icesfont</code></a></li>
<li>Added new code to track element nesting depth</li>
<li>Added new code to enforce a maximum nesting depth of 255</li>
<li>Added coverage tests and necessary clobbering protections</li>
</ul>
<p><strong>Note that this is a security release and should be upgraded
to immediately. Please also note that further releases may follow as the
underlying vulnerability is apparently new and further variations may be
discovered.</strong></p>
<h2>DOMPurify 3.1.0</h2>
<ul>
<li>Added new setting <code>SAFE_FOR_XML</code> to enable better control
over comment scrubbing</li>
<li>Updated README to warn about <em>happy-dom</em> not being safe for
use with DOMPurify yet</li>
<li>Updated the LICENSE file to show the accurate year number</li>
<li>Updated several build and test dependencies</li>
</ul>
<h2>DOMPurify 3.0.11</h2>
<ul>
<li>Fixed another conditional bypass caused by Processing Instructions,
thanks <a
href="https://github.com/Ry0taK"><code>@​Ry0taK</code></a></li>
<li>Fixed the regex for HTML Custom Element detection, thanks <a
href="https://github.com/AlekseySolovey3T"><code>@​AlekseySolovey3T</code></a></li>
</ul>
<h2>DOMPurify 3.0.10</h2>
<ul>
<li>Fixed two possible bypasses when sanitizing an XML document and
later using it in HTML, thanks <a
href="https://github.com/Slonser"><code>@​Slonser</code></a></li>
<li>Bumped up some build and test dependencies</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4083a9096b"><code>4083a90</code></a>
Merge pull request <a
href="https://redirect.github.com/cure53/DOMPurify/issues/978">#978</a>
from cure53/main</li>
<li><a
href="90a10a14af"><code>90a10a1</code></a>
fix: Fixed a typo on the README</li>
<li><a
href="65df0428f0"><code>65df042</code></a>
chore: Preparing 3.1.6 release</li>
<li><a
href="6e03334bab"><code>6e03334</code></a>
fix: Made sure that remove() is not called directly from node</li>
<li><a
href="00fc06cf57"><code>00fc06c</code></a>
fix: Fixed a DOM clobbering issue leading to an error being thrown</li>
<li><a
href="f8c2ef5911"><code>f8c2ef5</code></a>
Merge pull request <a
href="https://redirect.github.com/cure53/DOMPurify/issues/977">#977</a>
from cure53/dependabot/npm_and_yarn/multi-99ca4f73d8</li>
<li><a
href="e5112ec40a"><code>e5112ec</code></a>
build(deps): bump ws and socket.io-adapter</li>
<li><a
href="9978cecea2"><code>9978cec</code></a>
docs: Added better security warning about SAFE_FOR_XML to README</li>
<li><a
href="fa542df7e8"><code>fa542df</code></a>
fix: Changed the order for attribute checks slightly for safer
hooks</li>
<li><a
href="b8b552cb21"><code>b8b552c</code></a>
Merge pull request <a
href="https://redirect.github.com/cure53/DOMPurify/issues/975">#975</a>
from cure53/dependabot/npm_and_yarn/multi-2d3aef8690</li>
<li>Additional commits viewable in <a
href="https://github.com/cure53/DOMPurify/compare/3.0.6...3.1.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dompurify&package-manager=npm_and_yarn&previous-version=3.0.6&new-version=3.1.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-17 09:34:39 +02:00
LangChain4j bdd42818f5 feat(Vertex AI Gemini) — listener support (streaming and non streaming) (#1779) 2024-09-16 17:31:32 +02:00
dependabot[bot] e865b88af9
Bump body-parser and express in /docs (#1764)
Bumps [body-parser](https://github.com/expressjs/body-parser) and
[express](https://github.com/expressjs/express). These dependencies
needed to be updated together.
Updates `body-parser` from 1.20.2 to 1.20.3
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/body-parser/releases">body-parser's
releases</a>.</em></p>
<blockquote>
<h2>1.20.3</h2>
<h2>What's Changed</h2>
<h3>Important</h3>
<ul>
<li>deps: qs@6.13.0</li>
<li>add <code>depth</code> option to customize the depth level in the
parser</li>
<li><strong>IMPORTANT:</strong> The default <code>depth</code> level for
parsing URL-encoded data is now <code>32</code> (previously was
<code>Infinity</code>). <a
href="1752951367/README.md (depth)">Documentation</a></li>
</ul>
<h3>Other changes</h3>
<ul>
<li>chore: add support for OSSF scorecard reporting by <a
href="https://github.com/inigomarquinez"><code>@​inigomarquinez</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/522">expressjs/body-parser#522</a></li>
<li>ci: fix errors in ci github action for node 8 and 9 by <a
href="https://github.com/inigomarquinez"><code>@​inigomarquinez</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/523">expressjs/body-parser#523</a></li>
<li>fix: pin to node@22.4.1 by <a
href="https://github.com/wesleytodd"><code>@​wesleytodd</code></a> in <a
href="https://redirect.github.com/expressjs/body-parser/pull/527">expressjs/body-parser#527</a></li>
<li>deps: qs@6.12.3 by <a
href="https://github.com/melikhov-dev"><code>@​melikhov-dev</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/521">expressjs/body-parser#521</a></li>
<li>Add OSSF Scorecard badge by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/body-parser/pull/531">expressjs/body-parser#531</a></li>
<li>Linter by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/534">expressjs/body-parser#534</a></li>
<li>Release: 1.20.3 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/535">expressjs/body-parser#535</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/inigomarquinez"><code>@​inigomarquinez</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/522">expressjs/body-parser#522</a></li>
<li><a
href="https://github.com/melikhov-dev"><code>@​melikhov-dev</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/521">expressjs/body-parser#521</a></li>
<li><a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/531">expressjs/body-parser#531</a></li>
<li><a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/534">expressjs/body-parser#534</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3">https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/body-parser/blob/master/HISTORY.md">body-parser's
changelog</a>.</em></p>
<blockquote>
<h1>1.20.3 / 2024-09-10</h1>
<ul>
<li>deps: qs@6.13.0</li>
<li>add <code>depth</code> option to customize the depth level in the
parser</li>
<li>IMPORTANT: The default <code>depth</code> level for parsing
URL-encoded data is now <code>32</code> (previously was
<code>Infinity</code>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1752951367"><code>1752951</code></a>
1.20.3</li>
<li><a
href="39744cfe2a"><code>39744cf</code></a>
chore: linter (<a
href="https://redirect.github.com/expressjs/body-parser/issues/534">#534</a>)</li>
<li><a
href="b2695c4450"><code>b2695c4</code></a>
Merge commit from fork</li>
<li><a
href="ade0f3f82f"><code>ade0f3f</code></a>
add scorecard to readme (<a
href="https://redirect.github.com/expressjs/body-parser/issues/531">#531</a>)</li>
<li><a
href="99a1bd6245"><code>99a1bd6</code></a>
deps: qs@6.12.3 (<a
href="https://redirect.github.com/expressjs/body-parser/issues/521">#521</a>)</li>
<li><a
href="9478591605"><code>9478591</code></a>
fix: pin to node@22.4.1</li>
<li><a
href="83db46a1e5"><code>83db46a</code></a>
ci: fix errors in ci github action for node 8 and 9 (<a
href="https://redirect.github.com/expressjs/body-parser/issues/523">#523</a>)</li>
<li><a
href="9d4e2125b5"><code>9d4e212</code></a>
chore: add support for OSSF scorecard reporting (<a
href="https://redirect.github.com/expressjs/body-parser/issues/522">#522</a>)</li>
<li>See full diff in <a
href="https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~ulisesgascon">ulisesgascon</a>, a new
releaser for body-parser since your current version.</p>
</details>
<br />

Updates `express` from 4.19.2 to 4.21.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/express/releases">express's
releases</a>.</em></p>
<blockquote>
<h2>4.21.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Deprecate <code>&quot;back&quot;</code> magic string in redirects by
<a href="https://github.com/blakeembrey"><code>@​blakeembrey</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5935">expressjs/express#5935</a></li>
<li>finalhandler@1.3.1 by <a
href="https://github.com/wesleytodd"><code>@​wesleytodd</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5954">expressjs/express#5954</a></li>
<li>fix(deps): serve-static@1.16.2 by <a
href="https://github.com/wesleytodd"><code>@​wesleytodd</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5951">expressjs/express#5951</a></li>
<li>Upgraded dependency qs to 6.13.0 to match qs in body-parser by <a
href="https://github.com/agadzinski93"><code>@​agadzinski93</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5946">expressjs/express#5946</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/agadzinski93"><code>@​agadzinski93</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/express/pull/5946">expressjs/express#5946</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/express/compare/4.20.0...4.21.0">https://github.com/expressjs/express/compare/4.20.0...4.21.0</a></p>
<h2>4.20.0</h2>
<h2>What's Changed</h2>
<h3>Important</h3>
<ul>
<li>IMPORTANT: The default <code>depth</code> level for parsing
URL-encoded data is now <code>32</code> (previously was
<code>Infinity</code>)</li>
<li>Remove link renderization in html while using
<code>res.redirect</code></li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>4.19.2 Staging by <a
href="https://github.com/wesleytodd"><code>@​wesleytodd</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5561">expressjs/express#5561</a></li>
<li>remove duplicate location test for data uri by <a
href="https://github.com/wesleytodd"><code>@​wesleytodd</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5562">expressjs/express#5562</a></li>
<li>feat: document beta releases expectations by <a
href="https://github.com/marco-ippolito"><code>@​marco-ippolito</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5565">expressjs/express#5565</a></li>
<li>Cut down on duplicated CI runs by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5564">expressjs/express#5564</a></li>
<li>Add a Threat Model by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5526">expressjs/express#5526</a></li>
<li>Assign captain of encodeurl by <a
href="https://github.com/blakeembrey"><code>@​blakeembrey</code></a> in
<a
href="https://redirect.github.com/expressjs/express/pull/5579">expressjs/express#5579</a></li>
<li>Nominate jonchurch as repo captain for <code>http-errors</code>,
<code>expressjs.com</code>, <code>morgan</code>, <code>cors</code>,
<code>body-parser</code> by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5587">expressjs/express#5587</a></li>
<li>docs: update Security.md by <a
href="https://github.com/inigomarquinez"><code>@​inigomarquinez</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5590">expressjs/express#5590</a></li>
<li>docs: update triage nomination policy by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5600">expressjs/express#5600</a></li>
<li>Add CodeQL (SAST) by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5433">expressjs/express#5433</a></li>
<li>docs: add UlisesGascon as triage initiative captain by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5605">expressjs/express#5605</a></li>
<li>deps: encodeurl@~2.0.0 by <a
href="https://github.com/blakeembrey"><code>@​blakeembrey</code></a> in
<a
href="https://redirect.github.com/expressjs/express/pull/5569">expressjs/express#5569</a></li>
<li>skip QUERY method test by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5628">expressjs/express#5628</a></li>
<li>ignore ETAG query test on 21 and 22, reuse skip util by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5639">expressjs/express#5639</a></li>
<li>add support Node.js@22 in the CI by <a
href="https://github.com/mertcanaltin"><code>@​mertcanaltin</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5627">expressjs/express#5627</a></li>
<li>doc: add table of contents, tc/triager lists to readme by <a
href="https://github.com/mertcanaltin"><code>@​mertcanaltin</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5619">expressjs/express#5619</a></li>
<li>List and sort all projects, add captains by <a
href="https://github.com/blakeembrey"><code>@​blakeembrey</code></a> in
<a
href="https://redirect.github.com/expressjs/express/pull/5653">expressjs/express#5653</a></li>
<li>docs: add <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
as captain for cookie-parser by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5666">expressjs/express#5666</a></li>
<li> bring back query tests for node 21 by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5690">expressjs/express#5690</a></li>
<li>[v4] Deprecate <code>res.clearCookie</code> accepting
<code>options.maxAge</code> and <code>options.expires</code> by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5672">expressjs/express#5672</a></li>
<li>skip QUERY tests for Node 21 only, still not supported by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5695">expressjs/express#5695</a></li>
<li>📝 update people, add ctcpip to TC by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5683">expressjs/express#5683</a></li>
<li>remove minor version pinning from ci by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5722">expressjs/express#5722</a></li>
<li>Fix link variable use in attribution section of CODE OF CONDUCT by
<a href="https://github.com/IamLizu"><code>@​IamLizu</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5762">expressjs/express#5762</a></li>
<li>Replace Appveyor windows testing with GHA by <a
href="https://github.com/jonchurch"><code>@​jonchurch</code></a> in <a
href="https://redirect.github.com/expressjs/express/pull/5599">expressjs/express#5599</a></li>
<li>Add OSSF Scorecard badge by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5436">expressjs/express#5436</a></li>
<li>update scorecard link by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/express/pull/5814">expressjs/express#5814</a></li>
<li>Nominate <a
href="https://github.com/IamLizu"><code>@​IamLizu</code></a> to the
triage team by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/express/pull/5836">expressjs/express#5836</a></li>
<li>deps: path-to-regexp@0.1.8 by <a
href="https://github.com/blakeembrey"><code>@​blakeembrey</code></a> in
<a
href="https://redirect.github.com/expressjs/express/pull/5603">expressjs/express#5603</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/express/blob/4.21.0/History.md">express's
changelog</a>.</em></p>
<blockquote>
<h1>4.21.0 / 2024-09-11</h1>
<ul>
<li>Deprecate <code>res.location(&quot;back&quot;)</code> and
<code>res.redirect(&quot;back&quot;)</code> magic string</li>
<li>deps: serve-static@1.16.2
<ul>
<li>includes send@0.19.0</li>
</ul>
</li>
<li>deps: finalhandler@1.3.1</li>
<li>deps: qs@6.13.0</li>
</ul>
<h1>4.20.0 / 2024-09-10</h1>
<ul>
<li>deps: serve-static@0.16.0
<ul>
<li>Remove link renderization in html while redirecting</li>
</ul>
</li>
<li>deps: send@0.19.0
<ul>
<li>Remove link renderization in html while redirecting</li>
</ul>
</li>
<li>deps: body-parser@0.6.0
<ul>
<li>add <code>depth</code> option to customize the depth level in the
parser</li>
<li>IMPORTANT: The default <code>depth</code> level for parsing
URL-encoded data is now <code>32</code> (previously was
<code>Infinity</code>)</li>
</ul>
</li>
<li>Remove link renderization in html while using
<code>res.redirect</code></li>
<li>deps: path-to-regexp@0.1.10
<ul>
<li>Adds support for named matching groups in the routes using a
regex</li>
<li>Adds backtracking protection to parameters without regexes
defined</li>
</ul>
</li>
<li>deps: encodeurl@~2.0.0
<ul>
<li>Removes encoding of <code>\</code>, <code>|</code>, and
<code>^</code> to align better with URL spec</li>
</ul>
</li>
<li>Deprecate passing <code>options.maxAge</code> and
<code>options.expires</code> to <code>res.clearCookie</code>
<ul>
<li>Will be ignored in v5, clearCookie will set a cookie with an expires
in the past to instruct clients to delete the cookie</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7e562c6d8d"><code>7e562c6</code></a>
4.21.0</li>
<li><a
href="1bcde96bc8"><code>1bcde96</code></a>
fix(deps): qs@6.13.0 (<a
href="https://redirect.github.com/expressjs/express/issues/5946">#5946</a>)</li>
<li><a
href="7d36477568"><code>7d36477</code></a>
fix(deps): serve-static@1.16.2 (<a
href="https://redirect.github.com/expressjs/express/issues/5951">#5951</a>)</li>
<li><a
href="40d2d8f2c8"><code>40d2d8f</code></a>
fix(deps): finalhandler@1.3.1</li>
<li><a
href="77ada906db"><code>77ada90</code></a>
Deprecate <code>&quot;back&quot;</code> magic string in redirects (<a
href="https://redirect.github.com/expressjs/express/issues/5935">#5935</a>)</li>
<li><a
href="21df421ebc"><code>21df421</code></a>
4.20.0</li>
<li><a
href="4c9ddc1c47"><code>4c9ddc1</code></a>
feat: upgrade to serve-static@0.16.0</li>
<li><a
href="9ebe5d500d"><code>9ebe5d5</code></a>
feat: upgrade to send@0.19.0 (<a
href="https://redirect.github.com/expressjs/express/issues/5928">#5928</a>)</li>
<li><a
href="ec4a01b6b8"><code>ec4a01b</code></a>
feat: upgrade to body-parser@1.20.3 (<a
href="https://redirect.github.com/expressjs/express/issues/5926">#5926</a>)</li>
<li><a
href="54271f69b5"><code>54271f6</code></a>
fix: don't render redirect values in anchor href</li>
<li>Additional commits viewable in <a
href="https://github.com/expressjs/express/compare/4.19.2...4.21.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 16:01:49 +02:00
LangChain4j 9fbfc19986 OpenAI: added maxCompletionTokens 2024-09-16 14:19:35 +02:00
Emmanuel Ferdman 7c14548083
docs: update example references (#1782)
## Change
Commit bfae3927e6 renamed a few files.
This PR adjusts sources to changes.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-16 12:26:15 +02:00
LangChain4j a2004b689a docu: updated some stats 2024-09-15 18:22:35 +02:00
Guillaume Laforge 858cc9c19d
Google AI Gemini — support for Enum structured output (#1741)
## Change

In addition to `application/json`, Gemini also supports `text/x.enum` as
a structured output format, which is great for classification.

This PR covers both Google Vertex AI Gemini and Google AI Gemini models.

A minor internal change to create the `GeminiService` at construction
time rather than on each request.

+ Observability (ChatLanguageModel) for Google AI Gemini


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [/] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-13 22:44:43 +02:00
Robert Kashyap d069798d52
modified: docs/docs/integrations/language-models/google-ai-gemini.m… (#1771)
## Change
Updated the documentation for the Google AI Gemini language model
integration. The changes include improvements to the integration
instructions, updated API references, and added usage examples to better
illustrate the functionality.

## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-13 16:32:52 +02:00
LangChain4j a37c5506c2 docu: refactoring 2024-09-13 16:31:45 +02:00
LangChain4j f95ebf7340 docu: observability 2024-09-13 16:31:34 +02:00
LangChain4j b4ad82202b docu: typo 2024-09-13 14:40:50 +02:00
LangChain4j 7fa434cd41 docu: specify model name explicitly 2024-09-13 14:35:30 +02:00
LangChain4j fbf5fad368 docu: Specifying Tools Dynamically 2024-09-13 14:17:31 +02:00
LangChain4j 12a08a1ebd feat: Metadata filtering Qdrant (#1646) 2024-09-12 11:32:23 +02:00
LangChain4j 7faa4ebe7d docu: use model name explicitly 2024-09-09 11:30:21 +02:00
Guillaume Laforge a1ae5fabcd
Documentation for the Google AI Gemini module (#1721) 2024-09-07 09:06:11 +02:00
LangChain4j 475e6ab53f docu: web search engines 2024-09-06 11:53:33 +02:00
LangChain4j fe73dc3753 docu: @Description 2024-09-06 11:41:21 +02:00
LangChain4j 60bfddc848 docu: dependencies 2024-09-06 11:09:26 +02:00
LangChain4j e5086da8fa docu 2024-09-05 17:33:15 +02:00
LangChain4j 0a03dfc585 docu: structured outputs, tools 2024-09-05 16:51:51 +02:00
LangChain4j b0a8e6f45b
Release 0.34.0 (#1711) 2024-09-05 16:49:39 +02:00
jiangsier-xyz c14c86c408
DashScope: Support Wanx Models (for text-generated images) (#1710)
## Change
Alibaba uses Wanx models to support text-to-image features (not Qwen),
and provides services on DashScope.
    
See:
https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-wanxiang
    
Integrate them into langchain4j-dashscope as ImageModel.



## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
2024-09-05 09:22:30 +02:00
LangChain4j 4ffaad3625 docu: Google AI Gemini 2024-09-04 15:48:52 +02:00
Jake Luciani 5d514a50b4
Add tool support for jlama (#1661)
## Issue
Closes #1660 

## Change
This PR adds tool calling support for Jlama added in 0.3.1 release.

I have tested these changes with Mistral and Llama-3.1 models.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [X] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-03 17:42:11 +02:00
LangChain4j 9e8c01d001 Adds couchbase vector storage (#1482) 2024-09-02 15:20:49 +02:00
Dmitrii Chechetkin 56d8d40875
Adds couchbase vector storage (#1482)
## Issue
<!-- Please specify the ID of the issue this PR is addressing. For
Closes #1481

## Change
Adds couchbase vector storage.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [x] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [x] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [x] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
2024-09-02 15:11:36 +02:00
LangChain4j 691af7771b Feature 1567 ai services provide information about executed tools (#1647) 2024-08-29 12:02:42 +02:00
dependabot[bot] 64c8aa2027
Bump webpack from 5.89.0 to 5.94.0 in /docs (#1651)
Bumps [webpack](https://github.com/webpack/webpack) from 5.89.0 to
5.94.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/webpack/webpack/releases">webpack's
releases</a>.</em></p>
<blockquote>
<h2>v5.94.0</h2>
<h2>Bug Fixes</h2>
<ul>
<li>Added runtime condition for harmony reexport checked</li>
<li>Handle properly
<code>data</code>/<code>http</code>/<code>https</code> protocols in
source maps</li>
<li>Make <code>bigint</code> optimistic when browserslist not found</li>
<li>Move <code>@​types/eslint-scope</code> to dev deps</li>
<li>Related in asset stats is now always an array when no related
found</li>
<li>Handle ASI for export declarations</li>
<li>Mangle destruction incorrect with export named default properly</li>
<li>Fixed unexpected asi generation with sequence expression</li>
<li>Fixed a lot of types</li>
</ul>
<h2>New Features</h2>
<ul>
<li>Added new external type &quot;module-import&quot;</li>
<li>Support <code>webpackIgnore</code> for <code>new URL()</code>
construction</li>
<li>[CSS] <code>@import</code> pathinfo support</li>
</ul>
<h2>Security</h2>
<ul>
<li>Fixed DOM clobbering in auto public path</li>
</ul>
<h2>v5.93.0</h2>
<h2>Bug Fixes</h2>
<ul>
<li>Generate correct relative path to runtime chunks</li>
<li>Makes <code>DefinePlugin</code> quieter under default log level</li>
<li>Fixed mangle destructuring default in namespace import</li>
<li>Fixed consumption of eager shared modules for module federation</li>
<li>Strip slash for pretty regexp</li>
<li>Calculate correct contenthash for CSS generator options</li>
</ul>
<h2>New Features</h2>
<ul>
<li>Added the <code>binary</code> generator option for asset modules to
explicitly keep source maps produced by loaders</li>
<li>Added the <code>modern-module</code> library value for tree shakable
output</li>
<li>Added the <code>overrideStrict</code> option to override strict or
non-strict mode for javascript modules</li>
</ul>
<h2>v5.92.1</h2>
<h2>Bug Fixes</h2>
<ul>
<li>Doesn't crash with an error when the css experiment is enabled and
contenthash is used</li>
</ul>
<h2>v5.92.0</h2>
<h2>Bug Fixes</h2>
<ul>
<li>Correct tidle range's comutation for module federation</li>
<li>Consider runtime for pure expression dependency update hash</li>
<li>Return value in the <code>subtractRuntime</code> function for
runtime logic</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eabf85d858"><code>eabf85d</code></a>
chore(release): 5.94.0</li>
<li><a
href="955e057abc"><code>955e057</code></a>
security: fix DOM clobbering in auto public path</li>
<li><a
href="9822387362"><code>9822387</code></a>
test: fix</li>
<li><a
href="cbb86ede32"><code>cbb86ed</code></a>
test: fix</li>
<li><a
href="5ac3d7f2cd"><code>5ac3d7f</code></a>
fix: unexpected asi generation with sequence expression</li>
<li><a
href="2411661bd1"><code>2411661</code></a>
security: fix DOM clobbering in auto public path</li>
<li><a
href="b8c03d4772"><code>b8c03d4</code></a>
fix: unexpected asi generation with sequence expression</li>
<li><a
href="f46a03ccbc"><code>f46a03c</code></a>
revert: do not use heuristic fallback for &quot;module-import&quot;</li>
<li><a
href="60f189871a"><code>60f1898</code></a>
fix: do not use heuristic fallback for &quot;module-import&quot;</li>
<li><a
href="66306aa456"><code>66306aa</code></a>
Revert &quot;fix: module-import get fallback from
externalsPresets&quot;</li>
<li>Additional commits viewable in <a
href="https://github.com/webpack/webpack/compare/v5.89.0...v5.94.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&previous-version=5.89.0&new-version=5.94.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-29 11:05:32 +02:00
LangChain4j 77436c621b docu: reduce duplication 2024-08-27 12:56:25 +02:00
LangChain4j 44a04402f9 formatting 2024-08-27 10:40:15 +02:00
Michael McMahon 254dc79bad
Oracle Database Embedding Store (#1490)
## Issue
Closes #1091 

## Change
Added an `EmbeddingStore` integration for Oracle Database.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [X] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


---------

Signed-off-by: Michael McMahon <michael.a.mcmahon@oracle.com>
Co-authored-by: psilberk <pablo.silberkasten@oracle.com>
Co-authored-by: Pablo Silberkasten <47338417+psilberk@users.noreply.github.com>
Co-authored-by: LangChain4j <langchain4j@gmail.com>
Co-authored-by: Fernanda Meheust <fernanda.meheust@oracle.com>
Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
2024-08-27 10:38:29 +02:00
dependabot[bot] 9284855efa
Bump micromatch from 4.0.5 to 4.0.8 in /docs (#1641)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5
to 4.0.8.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/micromatch/micromatch/blob/4.0.8/CHANGELOG.md">micromatch's
changelog</a>.</em></p>
<blockquote>
<h2>[4.0.8] - 2024-08-22</h2>
<ul>
<li>backported CVE-2024-4067 fix (from v4.0.6) over to 4.x branch</li>
</ul>
<h2>[4.0.7] - 2024-05-22</h2>
<ul>
<li>this is basically v4.0.5, with some README updates</li>
<li><strong>it is vulnerable to CVE-2024-4067</strong></li>
<li>Updated braces to v3.0.3 to avoid CVE-2024-4068</li>
<li>does NOT break API compatibility</li>
</ul>
<h2>[4.0.6] - 2024-05-21</h2>
<ul>
<li>Added <code>hasBraces</code> to check if a pattern contains
braces.</li>
<li>Fixes CVE-2024-4067</li>
<li><strong>BREAKS API COMPATIBILITY</strong></li>
<li>Should be labeled as a major release, but it's not.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8bd704ec0d"><code>8bd704e</code></a>
4.0.8</li>
<li><a
href="a0e68416a4"><code>a0e6841</code></a>
run verb to generate README documentation</li>
<li><a
href="4ec288484f"><code>4ec2884</code></a>
Merge branch 'v4' into hauserkristof-feature/v4.0.8</li>
<li><a
href="03aa805217"><code>03aa805</code></a>
Merge pull request <a
href="https://redirect.github.com/micromatch/micromatch/issues/266">#266</a>
from hauserkristof/feature/v4.0.8</li>
<li><a
href="814f5f70ef"><code>814f5f7</code></a>
lint</li>
<li><a
href="67fcce6a10"><code>67fcce6</code></a>
fix: CHANGELOG about braces &amp; CVE-2024-4068, v4.0.5</li>
<li><a
href="113f2e3fa7"><code>113f2e3</code></a>
fix: CVE numbers in CHANGELOG</li>
<li><a
href="d9dbd9a266"><code>d9dbd9a</code></a>
feat: updated CHANGELOG</li>
<li><a
href="2ab13157f4"><code>2ab1315</code></a>
fix: use actions/setup-node@v4</li>
<li><a
href="1406ea38f3"><code>1406ea3</code></a>
feat: rework test to work on macos with node 10,12 and 14</li>
<li>Additional commits viewable in <a
href="https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=micromatch&package-manager=npm_and_yarn&previous-version=4.0.5&new-version=4.0.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain4j/langchain4j/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 16:58:36 +02:00
LangChain4j 9842ab6d44 660 : Support for onRetrieved for TokenStream (#1527) 2024-08-26 12:00:53 +02:00
LangChain4j 4d21ae976e docu 2024-08-22 16:23:00 +02:00
LangChain4j 3e6d50ee40
EmbeddingStoreIT: use awaitility (#1610)
## Change
Use awaitility in `EmbeddingStoreIT`

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core]
2024-08-22 16:17:53 +02:00
LangChain4j 2e47b126be [FEATURE] Adds SearchApi as WebSearchEngine and Tool (#1216) 2024-08-22 11:16:06 +02:00
Felipe Zambrin 99ed696f05
[FEATURE] Adds SearchApi as WebSearchEngine and Tool (#1216)
## Issue
Closes #1132 

## Change
Added SearchApi as a WebSearchEngine that also can be used as a tool.
Currently using Google Search as default engine. It also allows for new
engines to be implemented using the SearchApiRequestResponseHandler
interface, and adding it to the SearchApiEngine enum so the user can
choose which one to use.


## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [X] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
* The example is in the docs, I will open a new PR to the examples repo
if it is ok

@algora-pbc /claim #1132
2024-08-22 11:05:39 +02:00
Alexey Titov 4d328ca15f
1505-feature-chroma-support-metadata-filtering (#1556)
## Issue
Closes #1505

## Change
Chroma metadata filtering is supported now

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [X] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features) -
https://github.com/langchain4j/langchain4j-examples/pull/99
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-08-21 15:48:00 +02:00
David Pilato 8f6a140260
Elasticsearch: Add approximative kNN search in addition to Cosine similarity (#712)
The current implementation uses a slow function score query which is
known to be slow because you have to iterate over all the hits to
compute the score.

Elasticsearch in the recent versions, now also allow using knn search.

This PR now allows to change the configuration:

```java
// Use the Knn implementation
ElasticsearchEmbeddingStore store = ElasticsearchEmbeddingStore.builder()
  .configuration(ElasticsearchConfigurationKnn.builder().build())
  .restClient(restClient)
  .build();

// Note that this configuration is optional as it's the default behavior. So this code is equivalent:
ElasticsearchEmbeddingStore store = ElasticsearchEmbeddingStore.builder()
  .restClient(restClient)
  .build();

// Use the Scripting implementation (slower)
ElasticsearchEmbeddingStore store = ElasticsearchEmbeddingStore.builder()
  .configuration(ElasticsearchConfigurationScript.builder().build())
  .restClient(restClient)
  .build();
```

In more details, this is what this PR is bringing:

* Add a `configuration` new option in the builder. This helps to choose
the implementation to use. It could be
`ElasticsearchConfigurationScript` (the behavior before this change) or
`ElasticsearchConfigurationKnn` for the new Knn implementation
* The Knn implementation (`ElasticsearchConfigurationKnn`) is now the
default implementation
* Removes the `dimension` parameter as Elasticsearch can guess
automatically this value based on the first document indexed. And
anyway, it's better to let the user create an index template or the
index mapping he wants.
* Modify the IT. In which case if a local instance of Elasticsearch is
yet running on https://localhost:9200, we will use it by default and
start Testcontainers only if needed.
* Make Elasticsearch container secured (which is closer to production
use case)
* We now use the `elastic.version` `pom.xml` property to launch the
right Elasticsearch TestContainer.
* Replaced the `removeAll()` implementation from a `DeleteByQuery(match
all query)` to a Delete index API call which is always the recommended
way to remove all documents. Note that this does not recreate an index.
* `ElasticsearchEmbeddingStoreRemoveIT` now extends the common removal
test class `EmbeddingStoreWithRemovalIT`. But we need to implement in
the future a `EmbeddingStoreWithRemovalIT.wait_for_ready()` method to
allow even more common tests.
* Add more logs in implementation and tests
2024-08-20 11:05:42 +02:00
hrhrng ccd5370633
Feature 949 pinecone support metadata filter (#1601)
## Issue
Closes #949

## Change
Impeletement filter search in PineconeEmbeddingStore

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core]

## Checklist for changing existing embedding store integration
- [X] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-08-20 10:28:08 +02:00
ashni 5cb71573d7
Update mongodb-atlas.md (#1515)
## Change
Updating MongoDB Atlas docs.
2024-08-16 13:57:06 +02:00