Commit Graph

838 Commits

Author SHA1 Message Date
Jan Martiska 450ffb6be7
MCP WebSocket transport (#4032) 2025-11-17 15:25:35 +01:00
Dmytro Liubarskyi e4e18b8d42 GitHub Models: support structured output (#1917) 2025-11-17 14:32:36 +01:00
Caio Carneiro 59ce706d61
feat: Enable reasoning effort control for GPT-5 (o1 series) (#4052)
<!--
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 #4051

## Change
Add support for the ReasoningEffortValue parameter in the
AzureOpenAiChatModel and AzureOpenAiStreamingChatModel.java class. This
enhancement would:
Extend the AzureOpenAiChatModel.Builder to accept a reasoningEffort
parameter
Store the reasoningEffort value in the model configuration
Pass the reasoningEffort value to the ChatCompletionsOptions when making
API calls
Allow users to specify reasoning effort levels (LOW, MEDIUM, HIGH) for
GPT-5 models
This would enable full compatibility with GPT-5 (o1 series) models and
provide users with control over the reasoning compute effort.


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes (API, behaviour)
- [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. -->
- [ ] 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-11-14 13:56:08 +01:00
Antonio Goncalves 22f0b8d48e
Initializing the guardrails module (#3928)
<!--
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
Creates a new module that will gather all the out-of-the-box guardrails
as discussed in https://github.com/langchain4j/langchain4j/issues/3248

## Change
* Added a new Maven module `langchain4j-guardrail` (I did not use the
plural `langchain4j-guardrails` because there is no other plural repo)
* Move the `JsonExtractorOutputGuardrail` (and test) from the core to
this new module (this introduces a breaking change as people have now to
depend on this module, and not just core, to get this guardrail)
* Updated the documentation to point at the new location of the
`JsonExtractorOutputGuardrailTests`


## 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] -->
- [x] I have added my new module in the root `pom.xml` and
`langchain4j-bom/pom.xml`

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-11-13 11:54:58 +01:00
Andrea Di Maio c75ff2b1b6
Add WatsonxModerationModel and refactor LangChain4j integration (#3982)
<!-- Please note that the maintainer of this repository (@dliubarskyi)
will be offline from 25 October till 10 November.
Please expect delays with processing. Thank you for your understanding.
-->

<!--
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. -->

Changes:

- Added new `WatsonxModerationModel` implementing LangChain4j's
`ModerationModel` interface
- Renamed `url()` to `baseUrl()` across all WatsonxLangChain4j model
builders for consistency
- Renamed `timeLimit()` to `timeout()` across all WatsonxLangChain4j
model builders for consistency
- Enhanced `WatsonxBuilder` with additional configuration options
(projectId, spaceId, timeout)
- Improved thinking configuration with better null handling and enabled
flag support
- Updated documentation
- Added test coverage

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes (API, behaviour)
- [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)
- [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-11-13 11:39:34 +01:00
Óscar del Pozo fd3e7a2732
Doc: Added SQLServer 2025 embedding store integration (#3992)
<!-- Please note that the maintainer of this repository (@dliubarskyi)
will be offline from 25 October till 10 November.
Please expect delays with processing. Thank you for your understanding.
-->

<!--
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 related to langchain4j-community: Add SQLServer 2025 embedding
store integration
([#432](https://github.com/langchain4j/langchain4j-community/pull/432))

## Change
<!-- Please describe the changes you made. -->
Added documentation for the new embedding store integration for SQL
Server 2025.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [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. -->
- [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-11-13 11:39:01 +01:00
Julio c7cae2d41e
Update Quarkus documentation link for Easy RAG (#4034)
Link was broken

<!--
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 (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
2025-11-12 17:00:47 +01:00
Mario Fusco 0f8e3861dc
Introduce a generic agentic planner and reimplement all agentic patterns through it (#3929)
## Custom agentic patterns

The `langchain4j-agentic` module provides out-of-the-box a few useful
agentic pattern, but what if none of them fit the specific needs of your
application? In this case it is possible to create your own custom
pattern, that orchestrates the interactions among a set of subagents in
a way that is tailored to your requirements.

In more details an agentic pattern is simply the specification of an
execution plan for the subagents that it coordinates. This plan can be
defined by implementing the following `Planner` interface:

```java
public interface Planner {

    default void init(AgenticScope agenticScope, AgentInstance plannerAgent, List<AgentInstance> subagents) { }

    default Action firstAction(AgenticScope agenticScope) {
        return nextAction(agenticScope, null);
    }

    Action nextAction(AgenticScope agenticScope, AgentExecution previousAgentExecution);
}
```

This interface has three methods: `init`, `firstAction`, and
`nextAction`. The `init` method is called once at the beginning of the
execution, and can be used to initialize any state or data structures
needed by the planner. The `firstAction` method is called to determine
the first action to be taken by the agentic pattern, while the
`nextAction` method is called after each agent execution to determine
the next action to be taken based on the current state of the
`AgenticScope` and the result of the previous agent execution.

The `Action` class returned by the `firstAction` and `nextAction`
methods represents the next step to be taken by the agentic pattern, and
can be one either a list of one or more subagents to be called next, or
a signal that the execution has been completed. If the action specifies
only one subagent invocation, then it will be executed sequentially, and
in the same thread that is executing the planner itself, while if there
are more than one, they will be executed in parallel using the provided
`Executor` or the LangChain4j default one.

All the built-in agentic patterns are also written in terms of this
`Planner` abstraction and giving a look at their implementation can
clarify how this works and be a good starting point to create your own
custom patterns. For instance the parallel workflow is probably the
simplest of those implementation, and it is defined as follows:

```java
public class ParallelPlanner implements Planner {

    private List<AgentInstance> agents;

    @Override
    public void init(AgenticScope agenticScope, AgentInstance plannerAgent, List<AgentInstance> subagents) {
        this.agents = subagents;
    }

    @Override
    public Action firstAction(AgenticScope agenticScope) {
        return call(agents);
    }

    @Override
    public Action nextAction(final AgenticScope agenticScope, final AgentExecution previousAgentExecution) {
        return done();
    }
}
```

Here the `init` method simply stores the list of subagents with which
the parallel workflow has been configured, while the `firstAction`
method returns an action that calls all those agents in parallel. Once
this parallel execution is completed, there isn't any other action to be
taken, so the `nextAction` method simply returns `done()` used to signal
the termination of the execution.

The `Planner` implementing the sequential workflow is only slightly more
complex, as it needs to keep track of the next subagent to be invoked
using an internal cursor, and then return the appropriate action in the
`nextAction` method or signal the termination of the execution when all
subagents have been invoked.

```java
public class SequentialPlanner implements Planner {

    private List<AgentInstance> agents;
    private int agentCursor = 0;

    @Override
    public void init(AgenticScope agenticScope, AgentInstance plannerAgent, List<AgentInstance> subagents) {
        this.agents = subagents;
    }

    @Override
    public Action nextAction(AgenticScope agenticScope, AgentExecution previousAgentExecution) {
        return agentCursor >= agents.size() ? done() : call(agents.get(agentCursor++));
    }
}
```

To understand how to define an agentic system from a planner
implementation, it is possible, for example, to create an instance of
the formerly discussed sequential workflow generating a novel for a
topic and then editing it for a specific style and audience, as it
follows:

```java
UntypedAgent novelCreator = AgenticServices.plannerBuilder()
                .subAgents(creativeWriter, audienceEditor, styleEditor)
                .outputKey("story")
                .planner(SequentialPlanner::new)
                .build();
```

which is totally equivalent to use the dedicated API for sequential
workflows:

```java
UntypedAgent novelCreator = AgenticServices.sequenceBuilder()
                .subAgents(creativeWriter, audienceEditor, styleEditor)
                .outputKey("story")
                .build();
```

The `plannerBuilder()` method is similar to all other agent builders,
with the only difference that it requires to provide a
`Supplier<Planner>` returning a new instance of the specific planner to
be used by this agentic system. Of course an agentic system implementing
a custom planner can be seamlessly combined with any other of the
agentic pattern offered out-of-the-box by the `langchain4j-agentic`
module.

Having clarified how this `Planner` abstraction works, it is now
possible to create your own custom agentic patterns by implementing it.
The following sections provide two examples of custom patterns that can
be useful in different scenarios.

### Goal oriented agentic pattern

The workflow patterns and the supervisor agent represents the two
extremes of the spectrum of possible agentic systems: the former is
completely deterministic and rigid, forcing to decide in advance the
sequence of agents to be invoked, while the latter is completely
flexible and adaptive, but delegates the decision of the sequence of
agents to be invoked to a non-deterministic LLM. However, there are
cases where a middle ground between these two extremes can be more
appropriate, allowing agents to work towards a specific goal in a
relatively flexible way, but also determining how these agents should be
invoked in an algorithmic way.

In order to put this approach in practice, not only the whole agentic
system needs to define a goal, but also each subagent needs to declare
its own pre and postconditions. This is necessary to calculate the
sequence of agent invocations that lead to the achievement of the goal
in the fastest possible way. However, all this information are
implicitly already present in the agentic system, as those pre and
postconditions are nothing else than the required inputs and produced
outputs of each agent, and the final goal is simply the desired outputs
of the whole agentic system.

Following this idea, it is possible to calculate a dependency graph of
all the subagents participating in the agentic system, and then to
implement a `Planner` that is capable of analyzing the initial state of
the `AgenticScope`, comparing it with the desired goal, and then using
that graph to determine the sequence of agent invocations that can lead
to the achievement of that goal.

```java
public class GoalOrientedPlanner implements Planner {

    private String goal;

    private GoalOrientedSearchGraph graph;
    private List<AgentInstance> path;

    private int agentCursor = 0;

    @Override
    public void init(AgenticScope agenticScope, AgentInstance plannerAgent, List<AgentInstance> subagents) {
        this.goal = plannerAgent.outputKey();
        this.graph = new GoalOrientedSearchGraph(subagents);
    }

    @Override
    public Action firstAction(AgenticScope agenticScope) {
        path = graph.search(agenticScope.state().keySet(), goal);
        if (path.isEmpty()) {
            throw new IllegalStateException("No path found for goal: " + goal);
        }
        return call(path.get(agentCursor++));
    }

    @Override
    public Action nextAction(AgenticScope agenticScope, AgentExecution previousAgentExecution) {
        return agentCursor >= path.size() ? done() : call(path.get(agentCursor++));
    }
}
```

As anticipated, here the goal coincides with the final output of the
planner-based agentic pattern itself, while the path from the initial
state to the goal is calculated using a `GoalOrientedSearchGraph`, that
is built analyzing the input and output keys of all subagents. The
sequence of agents to be invoked is then calculated as the shortest path
on that graph from the current state to the desired goal.

To give a practical example of how this works, let's try to build a
goal-oriented agentic system that can extract the name and zodiac sign
of a person from a prompt, generate the horoscope for that sign, look
for a related story on the internet and finally create a nice writeup
combining all this information. We can achieve this set of tasks by
using the following 5 agents:

```java
public interface HoroscopeGenerator {
    @SystemMessage(
            """
            You are an astrologist that generates horoscopes based on the user's name and zodiac sign.
            """)
    @UserMessage("""
            Generate the horoscope for {{person}} who is a {{sign}}.
            """)
    @Agent("An astrologist that generates horoscopes based on the user's name and zodiac sign.")
    String horoscope(@V("person") Person person, @V("sign") Sign sign);
}

public interface PersonExtractor {

    @UserMessage("""
            Extract a person from the following prompt: {{prompt}}
            """)
    @Agent("Extract a person from user's prompt")
    Person extractPerson(@V("prompt") String prompt);
}

public interface SignExtractor {

    @UserMessage("""
            Extract the zodiac sign of a person from the following prompt: {{prompt}}
            """)
    @Agent("Extract a person from user's prompt")
    Sign extractSign(@V("prompt") String prompt);
}

public interface Writer {
    @UserMessage("""
            Create an amusing writeup for {{person}} based on the following:
            - their horoscope: {{horoscope}}
            - a current news story: {{story}}
            """)
    @Agent("Create an amusing writeup for the target person based on their horoscope and current news stories")
    String write(@V("person") Person person, @V("horoscope") String horoscope, @V("story") String story);
}

public interface StoryFinder {

    @SystemMessage("""
            You're a story finder, use the provided web search tools, calling it once and only once,
            to find a fictional and funny story on the internet about the user provided topic.
            """)
    @UserMessage("""
            Find a story on the internet for {{person}} who has the following horoscope: {{horoscope}}.
            """)
    @Agent("Find a story on the internet for a given person with a given horoscope")
    String findStory(@V("person") Person person, @V("horoscope") String horoscope);
}
```

Leveraging the `GoalOrientedPlanner` developed before, these agents can
be combined in a goal-oriented agentic system as follows:

```java
HoroscopeGenerator horoscopeGenerator = AgenticServices.agentBuilder(HoroscopeGenerator.class)
        .chatModel(baseModel())
        .outputKey("horoscope")
        .build();

PersonExtractor personExtractor = AgenticServices.agentBuilder(PersonExtractor.class)
        .chatModel(baseModel())
        .outputKey("person")
        .build();

SignExtractor signExtractor = AgenticServices.agentBuilder(SignExtractor.class)
        .chatModel(baseModel())
        .outputKey("sign")
        .build();

Writer writer = AgenticServices.agentBuilder(Writer.class)
        .chatModel(baseModel())
        .outputKey("writeup")
        .build();

StoryFinder storyFinder = AgenticServices.agentBuilder(StoryFinder.class)
        .chatModel(baseModel())
        .tools(new WebSearchTool())
        .outputKey("story")
        .build();

UntypedAgent horoscopeAgent = AgenticServices.plannerBuilder()
        .subAgents(horoscopeGenerator, personExtractor, signExtractor, writer, storyFinder)
        .outputKey("writeup")
        .planner(GoalOrientedPlanner::new)
        .build();
```

As anticipated, the overall goal of this agentic system is to produce a
`writeup` which is also the output key of the GOAP-based planner itself.
Taking into account the inputs and outputs of all subagents, the
dependency graph built by the `GoalOrientedSearchGraph` will look like
this:

<img width="970" height="871" alt="goap"
src="https://github.com/user-attachments/assets/0249b79f-9839-427c-9548-58774c371c30"
/>

When invoking this agentic system with a prompt like "My name is Mario
and my zodiac sign is pisces"

```java
Map<String, Object> input = Map.of("prompt", "My name is Mario and my zodiac sign is pisces");
String writeup = horoscopeAgent.invoke(input);
```

the `GoalOrientedPlanner` will analyze the initial state of the
`AgenticScope`, that contains only the `prompt` variable, and then it
will calculate the shortest path on the dependency graph from that
initial state to the desired goal, which is the `writeup`, so that the
resulting sequence of agent invocations will be:

```
Agents path sequence: [extractPerson, extractSign, horoscope, findStory, write]
```
Note that, as anticipated, this goal-oriented agentic pattern can be
mixed and combined with any other of the existing agentic patterns. For
instance this possibility can be used to overcome an evident limitation
of this approach that, being optimized to reach a specific goal
following the shortest possible path, structurally doesn't allow loops,
so in some cases it could be useful to have a loop agentic pattern as a
subagent of this goal-oriented one.

### Peer-to-peer agentic pattern

All the agentic system discussed up to this point are based on a
centralized and hierarchical architecture. In fact all the workflow
patterns had a well-defined top-level agent coordinating the activities
of multiple sub-agents in a programmatically predetermined way. Even the
supervisor pattern, which is more flexible and dynamic thanks to the
presence of its LLM-based planner agent, still relies on a coordinator
agent that controls the interactions among the various sub-agents. This
typology of architectures are suitable for many applications and
scenarios, but they can also have some limitations, especially in terms
of scalability and fault tolerance. This is why we may want to offer an
alternative peer-to-peer approach for multi-agent systems, that can
overcome these limitations by adopting a more decentralized and
distributed strategy.

In a peer-to-peer agentic systems there isn't any top level agent, and
all agents are equal peers that are coordinated through the state of the
`AgenticScope`. In particular, an agent is triggered by the presence of
its own required inputs as state variables in the `AgenticScope`.
Subsequently, a change in one or more of those variables, produced by
the output of a different agent, can retrigger the invocation of that
agent again. The process terminates either when the `AgenticScope`
reaches a stable state and no agent can be invoked anymore, or when the
predefined exit condition is satisfied, or when a maximum number of
agent invocations has been reached. A `Planner` implementation that
realizes this peer-to-peer agentic pattern could be written as it
follows:

```java
public class P2PPlanner implements Planner {

    private final int maxAgentsInvocations;
    private final BiPredicate<AgenticScope, Integer> exitCondition;

    private int invocationCounter = 0;
    private Map<String, AgentActivator> agentActivators;

    public P2PPlanner(int maxAgentsInvocations, BiPredicate<AgenticScope, Integer> exitCondition) {
        this(null, maxAgentsInvocations, exitCondition);
    }

    @Override
    public void init(AgenticScope agenticScope, AgentInstance plannerAgent, List<AgentInstance> subagents) {
        this.agentActivators = subagents.stream().collect(toMap(AgentInstance::name, AgentActivator::new));
    }

    @Override
    public Action nextAction(AgenticScope agenticScope, AgentExecution previousAgentExecution) {
        if (terminated(agenticScope)) {
            return done();
        }

        AgentActivator lastExecutedAgent = agentActivators.get(previousAgentExecution.agentSpec().uniqueName());
        lastExecutedAgent.finishExecution();
        agentActivators.values().forEach(a -> a.onStateChanged(lastExecutedAgent.agent.outputKey()));

        AgentInstance[] agentsToCall = agentActivators.values().stream()
                .filter(agentActivator -> agentActivator.canActivate(agenticScope))
                .peek(AgentActivator::startExecution)
                .map(AgentActivator::agent)
                .toArray(AgentInstance[]::new);
        invocationCounter += agentsToCall.length;
        return call(agentsToCall);
    }

    private boolean terminated(AgenticScope agenticScope) {
        return invocationCounter > maxAgentsInvocations || exitCondition.test(agenticScope, invocationCounter);
    }
}
```

Here the `P2PPlanner` keeps track of the number of agent invocations
performed so far, and uses an `AgentActivator` for each subagent to
determine if it can be invoked based on the current state of the
`AgenticScope`. The `nextAction` method checks if the exit condition has
been met or if the maximum number of invocations has been reached, and
if not, it identifies all agents that can be activated based on the
current state, marks them as started, and returns an action to call
them.

To give a practical example of how this works let's try to build a
peer-to-peer agentic system that can perform a scientific research and
formulate new hypothesis on a given topic, so that the API of this
service could be something like:

```java
public interface ResearchAgent {

    @Agent("Conduct research on a given topic")
    String research(@V("topic") String topic);
}
```

To this purpose the following 5 agents can be defined:

```java
public interface LiteratureAgent {

    @SystemMessage("Search for scientific literature on the given topic and return a summary of the findings.")
    @UserMessage("""
            You are a scientific literature search agent.
            Your task is to find relevant scientific papers on the topic provided by the user and summarize them.
            Use the provided tool to search for scientific papers and return a summary of your findings.
            The topic is: {{topic}}
            """)
    @Agent("Search for scientific literature on a given topic")
    String searchLiterature(@V("topic") String topic);
}

public interface HypothesisAgent {

    @SystemMessage("Based on the research findings, formulate a clear and concise hypothesis related to the given topic.")
    @UserMessage("""
            You are a hypothesis formulation agent.
            Your task is to formulate a clear and concise hypothesis based on the research findings provided by the user.
            The topic is: {{topic}}
            The research findings are: {{researchFindings}}
            """)
    @Agent("Formulate hypothesis around a give topic based on research findings")
    String makeHypothesis(@V("topic") String topic, @V("researchFindings") String researchFindings);
}

public interface CriticAgent {

    @SystemMessage("Critically evaluate the given hypothesis related to the specified topic. Provide constructive feedback and suggest improvements if necessary.")
    @UserMessage("""
            You are a critical evaluation agent.
            Your task is to critically evaluate the hypothesis provided by the user in relation to the specified topic.
            Provide constructive feedback and suggest improvements if necessary.
            If you need to, you can also perform additional research to validate or confute the hypothesis using the provided tool.
            The topic is: {{topic}}
            The hypothesis is: {{hypothesis}}
            """)
    @Agent("Critically evaluate a hypothesis related to a given topic")
    String criticHypothesis(@V("topic") String topic, @V("hypothesis") String hypothesis);
}

public interface ValidationAgent {

    @SystemMessage("Validate the provided hypothesis on the given topic based on the critique provided.")
    @UserMessage("""
            You are a validation agent.
            Your task is to validate the hypothesis provided by the user in relation to the specified topic based on the critique provided.
            Validate the provided hypothesis, either confirming it or reformulating a different hypothesis based on the critique.
            The topic is: {{topic}}
            The hypothesis is: {{hypothesis}}
            The critique is: {{critique}}
            """)
    @Agent("Validate a hypothesis based on a given topic and critique")
    String validateHypothesis(@V("topic") String topic, @V("hypothesis") String hypothesis, @V("critique") String critique);
}

public interface ScorerAgent {

    @SystemMessage("Score the provided hypothesis on the given topic based on the critique provided.")
    @UserMessage("""
            You are a scoring agent.
            Your task is to score the hypothesis provided by the user in relation to the specified topic based on the critique provided.
            Score the provided hypothesis on a scale from 0.0 to 1.0, where 0.0 means the hypothesis is completely invalid and 1.0 means the hypothesis is fully valid.
            The topic is: {{topic}}
            The hypothesis is: {{hypothesis}}
            The critique is: {{critique}}
            """)
    @Agent("Score a hypothesis based on a given topic and critique")
    double scoreHypothesis(@V("topic") String topic, @V("hypothesis") String hypothesis, @V("critique") String critique);
}
```

These agents will be all provided with a tool capable of performing
research on scientific literature, for instance downloading academic
papers from arXiv, and then added to the P2P agentic system:

```java
ArxivCrawler arxivCrawler = new ArxivCrawler();

LiteratureAgent literatureAgent = AgenticServices.agentBuilder(LiteratureAgent.class)
        .chatModel(baseModel())
        .tools(arxivCrawler)
        .outputKey("researchFindings")
        .build();
HypothesisAgent hypothesisAgent = AgenticServices.agentBuilder(HypothesisAgent.class)
        .chatModel(baseModel())
        .tools(arxivCrawler)
        .outputKey("hypothesis")
        .build();
CriticAgent criticAgent = AgenticServices.agentBuilder(CriticAgent.class)
        .chatModel(baseModel())
        .tools(arxivCrawler)
        .outputKey("critique")
        .build();
ValidationAgent validationAgent = AgenticServices.agentBuilder(ValidationAgent.class)
        .chatModel(baseModel())
        .tools(arxivCrawler)
        .outputKey("hypothesis")
        .build();
ScorerAgent scorerAgent = AgenticServices.agentBuilder(ScorerAgent.class)
        .chatModel(baseModel())
        .tools(arxivCrawler)
        .outputKey("score")
        .build();

ResearchAgent researcher = AgenticServices.plannerBuilder(ResearchAgent.class)
        .subAgents(literatureAgent, hypothesisAgent, criticAgent, validationAgent, scorerAgent)
        .outputKey("hypothesis")
        .planner(() -> new P2PPlanner(10, agenticScope -> {
            if (!agenticScope.hasState("score")) {
                return false;
            }
            double score = agenticScope.readState("score", 0.0);
            System.out.println("Current hypothesis score: " + score);
            return score >= 0.85;
        }))
        .build();

String hypothesis = researcher.research("black holes");
```

With this configuration the `researcher` p2p coordinator is passed with
the topic of the research. At this point the only agent that can be
invoked is the `literatureAgent`, because it is the only one that has
all its required inputs, in this case the `topic`, present in the
`AgenticScope`. The invocation of this agent produces the
`researchFindings` variable, which is added to the `AgenticScope` state,
and this new variable triggers the invocation of the `HypothesisAgent`.
Then this produces a `hypothesis` that in turn triggers the
`criticAgent`. Finally, the `ValidationAgent` takes in input both the
`hypothesis` and the `critique` and generates a new `hypothesis` that
eventually retriggers the other agents again. In the meanwhile the
`ScorerAgent` gives a `score` to the `hypothesis` and the process
terminates when this `score` is greater than or equal to 0.85, or when a
maximum of 10 agents invocations have been performed. The following
image summarizes all the agents and variables involved in this
execution.

<img width="1693" height="1101" alt="p2p"
src="https://github.com/user-attachments/assets/38d96c6d-c4b8-49ac-ae5f-6741067a2ab7"
/>


For instance a typical run of this example could terminate because the
`ScorerAgent` produced a score above the predetermined threshold

```
Current hypothesis score: 0.95
```

and the final output could be something like:

```
Based on the provided references, here are some key points about stochastic gravitational wave backgrounds (SGWBs) from primordial black holes (PBHs):

1. **Detection Rates and Sources:**
   - The detection rate of gravity waves emitted during parabolic encounters of stellar black holes in globular clusters was estimated by Kocsis et al. [85].
   - Gravitational wave bursts from PBH hyperbolic encounters were discussed by García-Bellido and Nesseris [93].

2. **Energy Emission:**
   - The energy spectrum of gravitational waves from hyperbolic encounters was studied by De Vittori, Jetzer, and Klein [88].
   - Gravitational wave energy emission and detection rates for PBH hyperbolic encounters were analyzed by García-Bellido and Nesseris [90].

3. **Template Banks:**
   - Template banks for gravitational waveforms from coalescing binary black holes (including non-spinning binaries) were developed by Ajith et al. [92].

4. **Constraints on PBHs:**
   - Constraints on primordial black holes were reviewed by Carr, Kohri, Sendouda, and Yokoyama [98].
   - Universal gravitational wave signatures of cosmological solitons were discussed by Lozanov, Sasaki, and Takhistov [100].

5. **Induced SGWBs:**
   - Doubly peaked induced stochastic gravitational wave backgrounds were tested for baryogenesis from primordial black holes by Bhaumik et al. [101].
   - Distinct signatures of spinning PBH domination and evaporation, including doubly peaked gravitational waves, dark relics, and CMB complementarity, were explored by Bhaumik et al. [101].

6. **Future Detectors:**
   - Future detectors like Taiji, LISA, DECIGO, Big Bang Observer, Cosmic Explorer, Einstein Telescope, and KAGRA are expected to contribute significantly to the detection of SGWBs from PBHs.

7. **Pulsar Timing Arrays:**
   - Pulsar timing arrays have been used to search for an isotropic stochastic gravitational wave background [73-75].

8. **Template Banks and Simulations:**
   - Template banks like those developed by Ajith et al. are crucial for matching observed signals with theoretical predictions.
```
2025-11-11 16:18:41 +01:00
clammbon 47504a03c0
Fix typos in annotation and documentation (#3997)
<!-- Please note that the maintainer of this repository (@dliubarskyi)
will be offline from 25 October till 10 November.
Please expect delays with processing. Thank you for your understanding.
-->

<!--
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 #3996 

## Change
<!-- Please describe the changes you made. -->
occured → occurred
in
langchain4j-workers-ai\src\main\java\dev\langchain4j\model\workersai\WorkersAiImageModel.java
226

Syncronous → Synchronous
in docs\docs\integrations\language-models\mistral-ai.md 282 and 366

incoherrent → incoherent
in
langchain4j-bedrock\src\test\java\dev\langchain4j\model\bedrock\common\BedrockChatModelWithoutVisionIT.java
100

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [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. -->
- [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: JustinChoi <justinchoi929@foxmail.com>
2025-11-06 08:34:38 +01:00
Xin Wang abcf5a7f82
docs: add Agentic AI to intro (#3966)
<!-- Please note that the maintainer of this repository (@dliubarskyi)
will be offline from 25 October till 10 November.
Please expect delays with processing. Thank you for your understanding.
-->

<!--
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. -->
add Agentic AI to intro

## 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
2025-10-28 09:06:31 +01:00
Dmytro Liubarskyi f6c76fb8d1
docu: update versions to 1.8.0 and 1.8.0-beta15 (#3950)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-10-24 15:47:58 +02:00
Dmytro Liubarskyi ecc754ba1f
Streaming Cancellation (#3910)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/1146

## Change
Implemented streaming cancellation for the following APIs:
- `StreamingChatModel` + `StreamingChatResponseHandler`
- `TokenStream`

Implemented streaming cancellation for the following modules:
- Anthropic
- Azure OpenAI
- Bedrock
- Google AI Gemini
- Mistral
- Ollama
- OpenAI
- OpenAI Official
- Vertex AI Gemini

## Examples

### `StreamingChatModel` + `StreamingChatResponseHandler` APIs

If you wish to cancel the streaming, you can do so from one of the
following `StreamingChatResponseHandler` methods:
- `onPartialResponse(PartialResponse, PartialResponseContext)`
- `onPartialThinking(PartialThinking, PartialThinkingContext)`
- `onPartialToolCall(PartialToolCall, PartialToolCallContext)`

The context object contains the `StreamingHandle`, which can be used to
cancel the streaming:
```java
model.chat(userMessage, new StreamingChatResponseHandler() {

    @Override
    public void onPartialResponse(PartialResponse partialResponse, PartialResponseContext context) {
        process(partialResponse);
        if (shouldCancel()) {
            context.streamingHandle().cancel();
        }
    }

    @Override
    public void onCompleteResponse(ChatResponse completeResponse) {
        System.out.println("onCompleteResponse: " + completeResponse);
    }

    @Override
    public void onError(Throwable error) {
        error.printStackTrace();
    }
});
```

### `TokenStream` API

If you wish to cancel the streaming, you can do so from one of the
following callbacks:
- `onPartialResponseWithContext(BiConsumer<PartialResponse,
PartialResponseContext>)`
- `onPartialThinkingWithContext(BiConsumer<PartialThinking,
PartialThinkingContext>)`

For example:
```java
tokenStream
    .onPartialResponseWithContext((PartialResponse partialResponse, PartialResponseContext context) -> {
        process(partialResponse);
        if (shouldCancel()) {
            context.streamingHandle().cancel();
        }
    })
    .onCompleteResponse((ChatResponse response) -> futureResponse.complete(response))
    .onError((Throwable error) -> futureResponse.completeExceptionally(error))
    .start();
```

When `StreamingHandle.cancel()` is called, LangChain4j will close the
connection and stop the streaming.
Once `StreamingHandle.cancel()` has been called, `TokenStream` will not
receive any further callbacks.


## General checklist
- [x] There are no breaking changes (API, behaviour)
- [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)
2025-10-23 20:00:57 +02:00
Dmytro Liubarskyi 87bb70fcd4
Allow passing custom attributes from RAG pipeline to ChatMemoryStore (#3898)
## Issue
Closes #3574

## Change
Added mutable attributes map to the `UserMessage`. 

## General checklist
- [x] There are no breaking changes (API, behaviour)
- [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)
2025-10-21 15:31:25 +02:00
Eric Deandrea f701cf95c8
Enhance failure and fatal guardrail outcome descriptions (#3919)
Expanded descriptions for failure and fatal outcomes in InputGuardrail.
2025-10-21 09:58:01 +02:00
Jean Bisutti 81f2f1cd93
Fix typos in observability doc (#3902) 2025-10-17 09:41:15 +02:00
Xin Wang 55d6d9afdb
docs: update rag docs (#3899)
<!--
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. -->
Update rag docs

## 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
2025-10-16 13:34:47 +02:00
Xin Wang daf7126ba8
docs: update numbers in intro (#3893)
<!--
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. -->
Update numbers in intro

## 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
2025-10-16 10:36:56 +02:00
Xin Wang ed08193e17
docs: add open-ai-official model to list (#3882)
<!--
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. -->
open-ai-official  was missing in supported language models list.
Add open-ai-official model to list

## 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
2025-10-15 10:44:48 +02:00
Xin Wang e54098a927
docs: Update chat memory docs (#3876)
<!--
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. -->
Update chat memory docs
Currently, no document shows all supported Chat Memory Stores.

## 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: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-10-15 10:43:01 +02:00
Krishna Tripathi 5d837a7649
docs: Remove examples from YugabyteDB documentation (#3875)
- Remove example links from yugabyte docs that are not yet available
- Add note that examples will be added soon

Removes example links from YugabyteDB embedding store documentation.

Since the version is currently `1.8.0-beta15-SNAPSHOT` (not yet
released), the examples repository doesn't have these examples available
yet.

Current link:
90c2f0fae2

Examples PR currently under review, it will be merged once the version
is officially released.
Link: https://github.com/langchain4j/langchain4j-examples/pull/175
2025-10-15 10:39:55 +02:00
Vijay Patidar 1cba8d279d
Renamed outputName to outputKey and updated docs (#3877)
## Issue
Closes #3848

## Change
Rename `outputName` with `outputKey` in agentic module.

## 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
2025-10-14 14:31:56 +02:00
Andrea Di Maio ebaca1a439
Update the watsonx.ai SDK to the latest version (#3812)
<!--
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
- Upgraded **IBM watsonx-ai dependency** from `0.9.0` to ~`0.10.1`~
`0.11.0` and excluded Jackson transitive dependencies to prevent
conflicts.
- Updated `WatsonxChatModel` and `WatsonxStreamingChatModel` to allow
enabling **thinking mode** via parameters.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes (API, behaviour)
- [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)
2025-10-14 10:32:16 +02:00
Xin Wang 1588338ca5
docs: Add mariadb to embedding store list (#3873)
<!--
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. -->
mariadb was missing in supported embedding store list.
Add mariadb to embedding store list

## 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
2025-10-14 10:00:25 +02:00
Dinesh Kumar 5b1dd5aeeb
docs: add OpenTelemetry GenAI instrumentation guide (#3842)
<!--
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 #

## Change
- Adds a new documentation page
`docs/docs/tutorials/otel-genai-instrumentation.md`.
- Explains how to enable OpenTelemetry GenAI tracing in Spring Boot apps
via the `langchain4j-otel` starter, links to the community repo, and
embeds a Grafana screenshot showing the telemetry in action.

## General checklist
- [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
- [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
2025-10-13 18:11:13 +02:00
Malay Dewangan cc4f335115
docs(search-engine): DuckDuckGo integration (#3862)
<!--
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 #3460 

## 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 (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
2025-10-13 13:26:28 +02:00
Xin Wang f11d7358a7
Fix pure-agentic example (#3860)
<!--
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. -->

The pure agentic example code used `exchangeAgent` a non-existent agent
in the agentic tutorials.
https://docs.langchain4j.dev/tutorials/agents/#pure-agentic-ai

ExchangeAgent **exchange** = AgenticServices
        .agentBuilder(ExchangeAgent.class)
        .chatModel(BASE_MODEL)
        .tools(new ExchangeTool())
        .build();

SupervisorAgent bankSupervisor = AgenticServices
        .supervisorBuilder()
        .chatModel(PLANNER_MODEL)
        .subAgents(withdrawAgent, creditAgent, **exchangeAgent**)
        .responseStrategy(SupervisorResponseStrategy.SUMMARY)
        .build();

This PR changed the `exchange` to `exchangeAgent` in tutorials docs and
tests(`SupervisorAgentIT`).

## 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
2025-10-13 13:25:08 +02:00
Krishna Tripathi 438bde78c5
docs: Add YugabyteDB embedding store documentation (#3852)
- Add comprehensive YugabyteDB embedding store documentation
- Include detailed API descriptions for YugabyteDBEmbeddingStore,
YugabyteDBEngine, and YugabyteDBSchema
- Add parameter summary tables for all configuration options
- Document vector index types (HNSW, NoIndex)
- Document metadata storage modes (JSONB, JSON, Column-per-key)
- Include usage examples for basic operations, indexes, metadata, and
driver configuration
- Document known limitations and performance considerations
- Add YugabyteDB to embedding stores comparison table
- Version: 1.8.0-beta15

<!--
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 (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
2025-10-10 10:08:35 +02:00
Dmytro Liubarskyi 5c99ee3fa1
Automate updating versions in documentation (#3847) 2025-10-09 15:16:18 +02:00
Dmytro Liubarskyi 89cd109f1b Support tool name mapping for MCP clients (#3799) 2025-10-07 17:00:28 +02:00
Jan Martiska f291ba7f85
Support tool name mapping for MCP clients (#3799)
Fixes https://github.com/langchain4j/langchain4j/issues/3619
2025-10-07 16:49:48 +02:00
Jiang Shan 8f71286a21
fix typo (#3824)
<!--
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 (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
2025-10-07 14:25:55 +02:00
Dmytro Liubarskyi c56332762d
OpenAiStreamingChatModel: expose raw HTTP response (#3828)
## Issue
Closes #3827

## Change


## General checklist
- [x] There are no breaking changes (API, behaviour)
- [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-10-07 14:22:37 +02:00
Vijay Patidar c830634597
docs: update home page to display features in card view (#3809)
## Issue
Closes #3810

## Change
Updated the docs home page to display features using a card view for
better readability.

<img width="1680" height="1050" alt="image"
src="https://github.com/user-attachments/assets/66149771-824d-4208-b1d4-c76e96d9786a"
/>

## General checklist
- [x] There are no breaking changes
- [ ] I have manually verified the change
- [ ] I have updated the documentation
2025-10-06 15:14:58 +02:00
Dmytro Liubarskyi b4418483b3 docu: pgvector: clarified custom datasource case 2025-10-06 12:40:58 +02:00
Dmytro Liubarskyi 34632c06a2 nex dev iteration 2025-10-02 17:17:35 +02:00
Dmytro Liubarskyi 86ec010156 docu: fixed chroma 2025-10-02 16:59:43 +02:00
Dmytro Liubarskyi b94b1ee79e docu: fixed chroma 2025-10-02 16:41:19 +02:00
Dmytro Liubarskyi acb93ceb48 docu: Updated versions to 1.7.1 and 1.7.1-beta14 2025-10-02 16:35:08 +02:00
Xin Wang e09d5d1eb6
Introduce yaml document parser (#3748)
<!--
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 yaml document parser

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes (API, behaviour)
- [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: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-10-02 10:14:51 +02:00
Dmytro Liubarskyi faa12fa8de Closes https://github.com/langchain4j/langchain4j/issues/3789 2025-10-02 09:54:20 +02:00
Dmytro Liubarskyi 3ead506963
Anthropic: allow setting custom parameters (#3797)
## Change
Allow setting custom chat request parameters for Anthropic

## General checklist
- [X] There are no breaking changes (API, behaviour)
- [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-10-01 23:44:14 +02:00
Michalis Papadimitriou 245b18392d
Add GPU Support to LangChain4j via GPULlama3.java Powered by TornadoVM (#3654)
This pull request integrates GPU-accelerated large language model (LLM)
inference into LangChain4j by incorporating
GPULlama3.java](https://github.com/beehive-lab/GPULlama3.java), a
Java-native implementation of Llama3, Mistral, Phi-3, Qwen2.5, Qwen3 and
Disteled-DeepSeek models powered by TornadoVM.

Key Features:
* Multi-Model Support: Llama3, Mistral, Phi-3, Qwen2.5, Qwen3,
Distilled-DeepSeek.
* GPU Backends: Supports PTX (NVIDIA) and OpenCL devices (Intel/Apple
GPUs).
* CPU Fallback: Switch between GPU and pure-Java CPU execution
seamlessly, as GPULlama3.java extends the existing Llama3.java
implementation.


## 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
- [ ] 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

---------

Co-authored-by: ibriq <iain.apreotesei@gmail.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
Co-authored-by: Orion Papadakis <orion.papadakis@manchester.ac.uk>
2025-10-01 23:41:57 +02:00
Dmytro Liubarskyi 01e13e2882
Hugging Face: deprecate HuggingFaceChatModel and HuggingFaceLanguageModel (#3319)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/3213

## Change
Deprecated `HuggingFaceChatModel` and `HuggingFaceLanguageModel` which
do not longer work in favour of
`OpenAiChatModel` from the `langchain4j-open-ai` module.

If you wish to use [Hugging Face's Inference
Providers](https://huggingface.co/docs/inference-providers/en/index),
please use `OpenAiChatModel` or `OpenAiStreamingChatModel`:

Example:
```xml
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-open-ai</artifactId>
    <version>1.6.0</version>
</dependency>
```
```java
ChatModel model = OpenAiChatModel.builder()
    .apiKey(System.getenv("HF_API_KEY"))
    .baseUrl("https://router.huggingface.co/v1")
    .modelName("HuggingFaceTB/SmolLM3-3B:hf-inference")
    .build();

StreamingChatModel streamingModel = OpenAiStreamingChatModel.builder()
    .apiKey(System.getenv("HF_API_KEY"))
    .baseUrl("https://router.huggingface.co/v1")
    .modelName("HuggingFaceTB/SmolLM3-3B:hf-inference")
    .build();
```

## 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-09-30 18:06:29 +02:00
Loïc Mathieu 24f71d16d9
Docker MCP transport (#3513)
PR raised to open discussion for the implementation, it's only a
prototype for now.

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

## 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
- [ ] 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] -->
- [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-30 14:44:07 +02:00
Emmanuel Hugonnet d827330196
feat: Implementing ChromaDB V2 with LangChain4j HTTPClient and Jackson (#3779)
This was initially implemented by @vijaypatidar

---

Implementing ChromaDB V2 API using LangChain4J HttpClient an jackson 
Removing the use of retrofit
Upgrading testcontainers to be able to test against current ChromaDB
version( 1.1.0)

## General checklist
- [X] There are no breaking changes (API, behaviour)
- [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
- [ ] 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: Emmanuel Hugonnet <ehugonne@redhat.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-30 11:42:20 +02:00
Mario Fusco af8988f672
Allow to create agents based on classes (#3786)
<!--
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/3784

## 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 (API, behaviour)
- [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-30 10:24:00 +02:00
Robikz 4ff386d0e9
Support anyOf and null JSON schema elements in googleai.SchemaMapper (#3781)
## Issue
Fixes #3780

## Change
Support anyOf and null JSON schema elements in googleai.SchemaMapper.

## General checklist
- [X] There are no breaking changes (API, behaviour)
- [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

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-29 16:41:30 +02:00
Dmytro Liubarskyi d3dea58b0f
docu: added link to https://github.com/Arize-ai/phoenix 2025-09-29 15:55:06 +02:00
Dmytro Liubarskyi a0b54edfa9 docu: updated versions to 1.6.0 and 1.6.0-beta12 2025-09-26 16:34:31 +02:00
Lize Raes 1d6d654db3
add logos and logo license (#3739)
## Change
- Added LOGO_LICENSE.md in the root
- Added the std logo and the transparent version under docs/

## General checklist
- [V ] There are no breaking changes (API, behaviour)

---------

Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
2025-09-26 16:23:38 +02:00
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