## Issue
Closes#5798
## Change
When `logRequests`/`logResponses` are enabled, `AwsLoggingInterceptor`
logs the full HTTP header set. Because `beforeTransmission` runs after
SigV4 signing, this includes the `Authorization` header (access key ID +
signature) and, when temporary/STS credentials are used (assumed roles,
EC2/ECS/EKS instance roles, IAM Identity Center), the
`X-Amz-Security-Token` a live, replayable session token writing
credentials to whatever log sink is configured (CWE-532).
This PR masks the values of these two headers (case-insensitive) with
`[REDACTED]` before logging, via a small package-private `maskHeaders()`
helper. This matches the header redaction already used elsewhere in
langchain4j (core `HttpRequestLogger`, and the cohere/jina/ovh-ai/nomic
request logging interceptors) and the AWS SDK's own wire logging, which
never emits these values.
All other headers, URL, query parameters, and body are logged unchanged.
No public API or request-behavior change only debug log text. Adds
`AwsLoggingInterceptorTest` (7 unit tests covering redaction of both
headers, case variants, non-sensitive header preservation, multi-value
headers, and null/empty maps).
Note: the import re-sort in the diff is mandated by the repo's spotless
config (matches sibling `BedrockCustomHeadersInterceptor`); no other
reformatting was done. `spotless:check` passes.
## 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
## 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
## Issue
Closes#1153 — distinguish APIs for embedding queries vs. documents/keys
(adds `EmbeddingInputType.QUERY`/`DOCUMENT` as a per-call parameter,
plus opt-in `embeddingInputType(...)` on
`EmbeddingStoreContentRetriever` / `EmbeddingStoreIngestor`).
Partially addresses #4019 — adds the multimodal image-embedding API at
the core level (`EmbeddingInput` of `Content` parts) and wires Cohere,
Voyage, Jina, Google (Gemini Embedding 2), and Bedrock Titan; does
not implement it for `OnnxEmbeddingModel`.
Relates to #5142 — provider-specific / per-call parameters for OpenAI
embeddings (`OpenAiEmbeddingRequestParameters`: `user`,
`encodingFormat`, `customParameters`; e.g. NVIDIA NIM `input_type` via
custom
parameters).
Relates to #4273 — observability for `EmbeddingModel` via listeners
(`EmbeddingModelListener` + request/response/error contexts, wired
across providers).
## Change
Introduces an `EmbeddingModel.embed(EmbeddingRequest) →
EmbeddingResponse` API, structured like `ChatModel`'s request/response
API, so embeddings can carry **per-call parameters** and **multimodal
inputs** and
participate in **observability**. Everything is additive and
`@Experimental`; the existing `embed(String)` / `embed(TextSegment)` /
`embedAll(List)` methods keep working unchanged.
### Core (`langchain4j-core`)
- New request/response types: `EmbeddingRequest`, `EmbeddingResponse`,
`EmbeddingResponseMetadata`, `EmbeddingRequestParameters` (+
`DefaultEmbeddingRequestParameters` and typed `EmbeddingParameter<T>`
tokens), `EmbeddingInput`, `EmbeddingInputType`.
- New default methods on `EmbeddingModel`: `embed(EmbeddingRequest)`,
`doEmbed(...)`, `defaultRequestParameters()`, `supportedParameters()`,
`supportedContentTypes()`, `provider()`, `listeners()`.
- **Strict opt-in / fail-fast:** per-call parameters and content types
are token/type-checked; a request that uses something the model doesn't
declare is rejected with `UnsupportedFeatureException` instead of
being silently ignored. `overrideWith` preserves the provider-specific
parameters subtype (as on the chat side).
- **Multimodal:** an `EmbeddingInput` is an ordered list of `Content`
parts (text/image); models fuse them into one embedding (or
one-per-item, per provider). Modality is auto-detected — no manual flag.
- **Observability:** `EmbeddingModelListener` + request/response/error
contexts (same shape as `ChatModelListener`), fired inline from
`embed(EmbeddingRequest)`. `addListener(...)` still works.
- **RAG opt-in:** `EmbeddingStoreContentRetriever` and
`EmbeddingStoreIngestor` gain an optional `embeddingInputType(...)`
(QUERY / DOCUMENT). Default behavior is unchanged (no input type sent).
- `ModelProvider`: added `COHERE`, `VOYAGE_AI`, `JINA`, with matching
OpenTelemetry `gen_ai.provider.name` mappings (`cohere` is a well-known
OTel value; `voyage_ai` / `jina` are custom, as permitted by the
spec).
### Providers
- **OpenAI** (dimensions, `user`/`encodingFormat`/custom params),
**Cohere** (Embed v4 multimodal + input types), **Voyage** (multimodal +
input types), **Jina** (CLIP multimodal), **Google AI Gemini** (input
types; **Gemini Embedding 2** multimodal), **Amazon Bedrock Titan**
(multimodal).
- **Google Gen AI** (`langchain4j-google-genai`): input type → SDK
`task_type`, per-call dimensions → `outputDimensionality`, `provider()`,
listeners.
- **Ollama**: text-only — `provider()` + listeners (per-call params
correctly fail fast).
- **In-process models** (ONNX / `AbstractInProcessEmbeddingModel`):
already work via the default `doEmbed→embedAll` bridge (text-only,
image/param requests fail fast); observability via `addListener(...)`.
No
code change (no builders to wire listeners into, no dedicated
`ModelProvider`).
- **Gemini Embedding 2** dropped the `task_type` parameter, so input
types are applied as prompt instructions (`task: search result | query:
…` / `title: none | text: …`) automatically; `gemini-embedding-001`
still uses `task_type`.
- `modelName` in the response metadata reflects the API-reported model
where the provider returns one (OpenAI/Voyage/Jina), falling back to the
configured name.
### Tests
- `AbstractEmbeddingModelIT` — a shared IT base (like
`AbstractChatModelIT`) covering the new API, convenience methods,
listeners, and fail-fast; each provider adds a small
`common/…EmbeddingModelIT` that
parameterizes it and declares its capabilities via `supports*()`
overrides.
- Mock-based unit tests per provider for wire format / routing /
fail-fast (run in CI without keys), plus core value-type and listener
tests.
### Docs
- Embedding-model section in the RAG tutorial (request/response,
multimodal, query-vs-document opt-in), the EmbeddingModel listener
section in the Observability tutorial, the embedding contribution
guidance in
`CONTRIBUTING.md`, and the six provider integration pages.
### Notes
- `EmbeddingResponseMetadata` intentionally has no `finishReason`
(embeddings have no finish reason). No real provider is affected: the
only provider that emits `STOP` (Cloudflare WorkersAI) overrides the
convenience methods directly, and every other provider always returned
`null` here.
- `revapi.json` suppressions were added where the new (non-breaking)
types are exposed in provider APIs.
## 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 added/updated the documentation
- [ ] I have manually run all the unit and integration tests in the core
and main modules, and they are all green
- [ ] I have added an example in the examples repo (only for "big"
features)
- [ ] I have added/updated Spring Boot starter(s) (if applicable)
---------
Co-authored-by: agent <agent@langchain4j.dev>
## Issue
Closes#5116
## Change
Adds a new **`onUnmappedRawEvent`** streaming callback that gives
advanced users access to provider streaming events that LangChain4j does
**not** map to one of its typed callbacks — e.g. OpenAI server-tool
lifecycle events (`response.web_search_call.in_progress` / `searching` /
`completed`). This is an escape hatch so power users don't have to fall
back to a provider's native SDK for events we don't model yet.
**API** (both `@Experimental`, `@since 1.17.0`, `default` so nothing
breaks):
- `StreamingChatResponseHandler.onUnmappedRawEvent(Object rawEvent)` —
low-level API
- `TokenStream.onUnmappedRawEvent(Consumer<Object> rawEventHandler)` —
AI Services API
**Semantics — no duplication.** The callback fires **only** for events
that were *not* already delivered via a typed callback
(`onPartialResponse`, `onPartialThinking`, `onPartialToolCall`,
`onCompleteToolCall`, `onCompleteResponse`). So you can consume the
typed callbacks and the raw stream together without seeing the same
event twice. This is enforced by a small internal
`MappingTrackingStreamingChatResponseHandler` that records whether an
event was mapped to a typed callback (`wasMapped()`), and providers emit
the raw event only when it wasn't.
> Naming note: it's called `onUnmappedRawEvent` (not `onRawEvent`) to
leave room for a planned follow-up that also exposes the raw event
behind *mapped* callbacks (e.g. `PartialToolCall.rawEvent()`), giving a
clean mapped/unmapped split.
**The concrete `rawEvent` type is provider-specific:**
| Provider | Raw event type |
|---|---|
| OpenAI, Anthropic, Google AI Gemini, Mistral, Ollama |
`dev.langchain4j.http.client.sse.ServerSentEvent` |
| OpenAI (official) – Responses API |
`com.openai.models.responses.ResponseStreamEvent` |
| OpenAI (official) – Chat Completions API |
`com.openai.models.chat.completions.ChatCompletionChunk` |
| Amazon Bedrock |
`software.amazon.awssdk.services.bedrockruntime.model.ConverseStreamOutput`
|
| Google GenAI | `com.google.genai.types.GenerateContentResponse` |
**Providers wired:** OpenAI (Chat Completions + Responses),
OpenAI-official (Chat Completions + Responses), Anthropic, Google AI
Gemini, Google GenAI, Amazon Bedrock, Mistral, Ollama.
**Docs:** added a "Unmapped Raw Events" section to
`response-streaming.md` and the callback to the `TokenStream` example in
`ai-services.md`.
## General checklist
- [x] There are no breaking changes (API, behaviour) — all additions are
`default` and `@Experimental`
- [x] I have added unit and/or integration tests for my change
- [x] The tests cover both positive and negative cases — i.e. unmapped
events are forwarded *and* typed (text/tool) events are **not** repeated
as raw events
- [x] I have manually run all the unit and integration tests in the
module(s) 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)
## Issue
Closes#5138
## Change
Adds
`BedrockChatRequestParameters.Builder.enableAdaptiveReasoning(String
effort)`,
which serializes to `reasoning_config: {type: "adaptive"}` and, when
effort is
non-null, `output_config: {effort: "..."}`. This is the payload
@jfigueiras-denodo
confirmed working against Claude Opus 4.7 in #5138, where the legacy
`budget_tokens`
reasoning config now returns a 400.
The existing `enableReasoning(Integer budgetTokens)` is left unchanged,
so
Opus 4.6 / Sonnet 4.6 users keep working — matching the
deprecation/migration path
described in the issue. Added two unit tests covering
adaptive-with-effort and
adaptive-without-effort (null) serialization.
## 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
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/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)
## Issue
<!-- Update with the real issue number once the issue is filed -->
Closes#5502
## Change
`AwsDocumentConverter.getDocument(JsonNode)` matched the integer branch
on `isInt() || isLong() || isShort() || isBigInteger()` but converted
with `Document.fromNumber(value.asInt())`. Jackson `asInt()` narrows
`long`/`BigInteger` to `(int)`, silently corrupting values outside the
int range (`9223372036854775807` becomes `-1`).
This is reached on a normal path:
`AbstractBedrockChatModel.convertToolRequests()` converts LLM tool-call
argument JSON to a `Document` via `documentFromJson(...)`, so large
integer tool arguments were mangled before being sent to Bedrock.
Fix: convert with `value.bigIntegerValue()`. A
`Document.fromNumber(BigInteger)` overload exists in sdk-core, so no new
import or dependency is needed. This is width-preserving and symmetric
with the reverse `documentToObject()` (`asNumber()`) and the `double`
branch (`asDouble()`). In-range `int` values are unchanged (backward
compatible).
Tests: added `documentFromJson` round-trip tests for `Long.MAX_VALUE`, a
value above `Long.MAX_VALUE`, and an in-range int regression. The first
two fail on the old code and pass after the fix.
Note: spotless ratchet reformatted three pre-existing text blocks in the
touched test file (required to pass CI `spotless:check`).
## 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)
<!-- "new maven module" and "embedding store" checklists omitted: not
applicable to this bug fix. -->
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
<!--
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 PR corrects the misspelled `ouputAssessments` name in the Bedrock
guardrail assessment summary API by renaming it to `outputAssessments`.
The change updates:
- `GuardrailAssessmentSummary` field, getter, builder setter, and
related `equals`, `hashCode`, and `toString` methods
- `AbstractBedrockChatModel` so the mapped metadata uses the corrected
builder method
- `BedrockGuardrailIT` and `BedrockStreamingGuardrailIT` to assert
against the corrected accessor
## 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)
## Issue
Closes#5108
## Change
Added `customHeaders(Map<String, String>)` and
`customHeaders(Supplier<Map<String, String>>)` builder methods to
`BedrockChatModel` and `BedrockStreamingChatModel`.
Since Bedrock uses the AWS SDK rather than langchain4j's HTTP client
abstraction, header injection goes through a new
`BedrockCustomHeadersInterceptor` — an `ExecutionInterceptor` that calls
`modifyHttpRequest()` before each HTTP request, following the same
pattern as the existing `AwsLoggingInterceptor`.
The `Supplier` overload allows dynamic headers per request (e.g.
rotating tokens).
## 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
Fixes#5057
## Summary
- Read Bedrock Cohere input token counts from
`x-amzn-bedrock-input-token-count`
- Fall back to the response body token count when the header is not
present
- Sum token usage across batched embedding requests and keep
`tokenUsage()` null when no count is provided
## Testing
- `mvn -pl langchain4j-bedrock spotless:check`
- `mvn -pl langchain4j-bedrock -am
-Dtest=BedrockCohereEmbeddingModelTest,BedrockCohereEmbeddingModelIT
-Dsurefire.failIfNoSpecifiedTests=false test`
## Summary
Add configurable cache TTL support for Bedrock prompt caching.
Currently, all cache points use the default 5-minute TTL because
`CachePointBlock` is created without a TTL parameter. The AWS Bedrock
SDK (`bedrockruntime` 2.41+) supports `CacheTTL` with `VALUE_5_M` (5
minutes) and `VALUE_1_H` (1 hour), but there is no way to configure it
through LangChain4j.
## Problem
The `CACHE_POINT_BLOCK` in `AbstractBedrockChatModel` is hardcoded as a
static final field without TTL:
```java
private static final SystemContentBlock CACHE_POINT_BLOCK = SystemContentBlock.builder()
.cachePoint(CachePointBlock.builder()
.type(CachePointType.DEFAULT)
// no TTL set → defaults to 5 minutes
.build())
.build();
```
Users who need 1-hour TTL (e.g., for APIs called less frequently than
every 5 minutes) must bypass LangChain4j and call the Bedrock SDK
directly, losing access to LangChain4j's listener-based metrics, message
conversion, and other features.
## Solution
- **`BedrockChatRequestParameters`** — Added `cacheTtl` field and
`promptCaching(placement, ttl)` overload:
```java
BedrockChatRequestParameters.builder()
.promptCaching(BedrockCachePointPlacement.AFTER_SYSTEM,
CacheTTL.VALUE_1_H)
.build()
```
- **`AbstractBedrockChatModel`** — Replaced static `CACHE_POINT_BLOCK`
with dynamic `buildCachePoint(cacheTtl)` method that creates
`CachePointBlock` with the specified TTL. Applied to all 4 cache point
creation sites (system messages, user messages, tool configurations).
- **`BedrockChatModel` + `BedrockStreamingChatModel`** — Pass `cacheTtl`
through to all `extract*` methods.
## Backward Compatibility
**Fully backward-compatible.** When `cacheTtl` is `null` (default), the
behavior is identical to the existing implementation:
- The existing `promptCaching(placement)` method continues to work
unchanged
- `buildCachePoint(null)` returns a `CachePointBlock` without TTL (same
as before)
- No changes required in existing user code
## Usage
```java
// Existing code — unchanged, still works (5-minute default)
BedrockChatRequestParameters.builder()
.promptCaching(BedrockCachePointPlacement.AFTER_SYSTEM)
.build()
// New — 1-hour TTL
BedrockChatRequestParameters.builder()
.promptCaching(BedrockCachePointPlacement.AFTER_SYSTEM, CacheTTL.VALUE_5_M)
.build()
```
## Changed Files
| File | Change |
|------|--------|
| `BedrockChatRequestParameters.java` | Added `cacheTtl` field +
`promptCaching(placement, ttl)` overload |
| `AbstractBedrockChatModel.java` | Replaced static cache point with
dynamic `buildCachePoint(cacheTtl)` |
| `BedrockChatModel.java` | Pass `cacheTtl` to extract methods |
| `BedrockStreamingChatModel.java` | Pass `cacheTtl` to extract methods
|
## References
- [AWS Bedrock Prompt Caching
docs](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html)
- AWS SDK `CacheTTL` enum: `VALUE_5_M`, `VALUE_1_H`
- 1-hour TTL supported models: Claude Sonnet 4.5, Claude Opus 4.5,
Claude Haiku 4.5
---------
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/3804
Closes https://github.com/langchain4j/langchain4j/issues/3320
## Change
- Integrate https://revapi.org/ (`revapi-maven-plugin`) into the build
to automatically detect breaking API changes
- Revapi runs during the `verify` phase on every build, comparing the
current code against the latest released version on Maven Central
(`RELEASE`)
- Suppress `java.method.varargOverloadsOnlyDifferInVarargParameter`
globally — this is a design warning about varargs overloads, not an
actual breaking change
- Add per-module `revapi.json` justifications for pre-existing
`java.class.nonPublicPartOfAPI` warnings in `langchain4j-ollama`,
`langchain4j-bedrock`, `langchain4j-onnx-scoring`, and
`langchain4j-google-ai-gemini` — these are package-private classes
exposed through protected members on package-private base classes, so
they cannot actually leak to external
users
- Do not check depndencies - we do not expose them explicitly and are
not responsible for any changes there
- skip `integration-tests` modules - we do not release them
### How it works
- Revapi downloads the latest released JAR from Maven Central and
compares it against the locally built JAR at the bytecode level
- Any removal, signature change, or visibility reduction of public API
elements will fail the build
- Adding new public API is always fine
- To justify an intentional breaking change, add a `revapi.json` in the
module root — justifications auto-expire on the next release since the
baseline moves forward
## 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
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/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)
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/4652
## Change
- Add support for `@Tool`-annotated methods to return multimodal content
(images) to the LLM, not just text. Tools can now return `Image`,
`ImageContent`, `Content`, `List<Content>`, `Content[]`, etc.
- Refactor `ToolExecutionResultMessage` to store `List<Content>`
internally instead of a plain `String`, with backward-compatible
`text()` accessor and new `contents()` / `hasSingleText()`
methods.
- Refactor `ToolExecutionResult` to support
`resultContents(List<Content>)` as an alternative to
`resultText(String)` and `resultTextSupplier(Supplier)`.
- Implement multimodal tool result mapping for providers that support
it: Anthropic, Amazon Bedrock, and Google AI Gemini.
- Add `UnsupportedFeatureException` guards in providers that do not
support non-text tool results: Azure OpenAI, GitHub Models, Jlama,
Mistral AI, Ollama, OpenAI (Chat Completions
& Responses), Vertex AI (Anthropic & Gemini), Watsonx, and Workers AI.
- Update `ToolExecutedEvent` / `DefaultToolExecutedEvent` to carry
`resultContents` alongside the existing `resultText` accessor.
- Add comprehensive unit and integration tests
(`should_execute_tool_returning_Image`,
`should_execute_tool_returning_ImageContent`,
`should_execute_tool_returning_ContentList`,
`should_fail_when_tool_returns_image_and_provider_does_not_support_it`).
- Update tools documentation with new "Returning Images and Multimodal
Content" and "Multimodal Tool Results" sections.
## 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) (if
applicable)
…er the last user message.
## Issue
Closes#4562
## Change
Add support for Service Tiers in Bedrock.
New cache point for after last user message in Bedrock.
Allowing the user to configure the guardrail processing mode (sync and
asynchronous).
## 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
<!-- 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
- [ ] 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
- [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: Jonathan Nunez Aguin <jonathannunezaguin@fico.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
## Issue
Closes#4543
## Change
Implemented support for **Structured Output** in AWS Bedrock, allowing
models to generate responses adhering to a specific JSON schema.
**Key changes:**
- **SDK Upgrade**: Upgraded `aws-java-sdk-bedrockruntime` from `2.33.5`
to `2.41.22` to access `OutputConfig` and `JsonSchemaDefinition` APIs.
- **New Feature**: Added `outputConfig` support to `ConverseRequest` in
`BedrockChatModel` and `BedrockStreamingChatModel`.
- **Schema Mapping**: Created `BedrockSchemaMapper` to convert
LangChain4j `JsonSchema` objects into AWS SDK `Document` format.
- **Validation**: Removed the `UnsupportedFeatureException` that was
previously thrown when `ResponseFormat.JSON` was requested.
## 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)
## Checklist for adding new maven module
- [ ] I have added my new module in the root
[pom.xml](cci:7://file:///Users/mohankumarsagadevan/Documents/projects/github/langchain4j/langchain4j-parent/pom.xml:0:0-0:0)
and
[langchain4j-bom/pom.xml](cci:7://file:///Users/mohankumarsagadevan/Documents/projects/github/langchain4j/langchain4j-bom/pom.xml:0:0-0:0)
## 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
---------
Co-authored-by: Mohan Kumar Sagadevan <mohankumarsagadevan@Mohans-MacBook-Air.local>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
## Change
Implements Tool Search Tool feature initially introduced by
[Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool).
### Tool Search
When working with a large number of tools,
sending all tools on every request can significantly increase token
usage and reduce model performance.
To address this, LangChain4j provides a tool search mechanism
that allows tools to be discovered dynamically by the LLM itself,
instead of being exposed upfront.
The core idea is simple:
- Initially, the LLM is exposed to one or more special tool-search tools
- The LLM can call these tools to search for relevant tools
- Once relevant tools are found, they are included in subsequent
requests to the LLM
This enables scalable, token-efficient, and model-driven tool discovery.
#### How Tool Search Works
A tool search flow typically looks like this:
1. Initial request:
- The LLM sees only tool-search tools (not the full tool set)
2. Tool search
- The LLM calls a tool-search tool, describing what kind of tool it
needs
- The tool-search strategy matches the request against available tools
4. Tool exposure
- Matching tools are added to the next request to the LLM
5. Tool execution
- The LLM can now call the found tools normally
Previously found tools are accumulated across multiple tool-search
calls.
Each time the LLM invokes the tool-search tool,
the newly matched tools are added to the existing set of tools visible
to the LLM (they are merged, not replaced).
This means the list of tools visible to the LLM can grow over time.
Found tools remain visible to the LLM until their corresponding
`ToolExecutionResultMessage`
is evicted from the `ChatMemory`, and at least until the end of the AI
Service invocation.
If `ChatMemory` is not configured, the found tools remain visible to the
LLM
only until the end of the AI service invocation.
#### ToolSearchStrategy
Tool search is implemented via the `ToolSearchStrategy` interface:
```java
@Experimental
public interface ToolSearchStrategy {
List<ToolSpecification> getToolSearchTools(InvocationContext invocationContext);
ToolSearchResult search(ToolSearchRequest toolSearchRequest);
}
```
A `ToolSearchStrategy` is responsible for:
- Exposing tool-search tools to the LLM
- Executing tool search requests generated by the LLM
- Returning matching tool names, which will then be resolved and exposed
LangChain4j currently provides 2 out-of-the-box implementations:
- `SimpleToolSearchStrategy` – keyword-based matching
- `VectorToolSearchStrategy` – semantic search using embeddings
See Javadoc of these classes for more details.
You can also implement custom strategies.
#### Configuring Tool Search in AI Services
Tool search is configured at the AI Service level:
```java
Assistant assistant = AiServices.builder(Assistant.class)
.chatModel(chatModel)
.chatMemory(chatMemory)
.tools(tools) // tool search works for static tools
.toolProvider(mcpToolProvider) // tool search works for tools provided dynamically (e.g., MCP)
.toolSearchStrategy(new SimpleToolSearchStrategy())
.build();
```
Once configured:
- The LLM no longer sees all tools upfront
- Tool discovery becomes an explicit, model-driven step
- Token usage is reduced, especially with large tool sets
#### When to Use Tool Search
Tool search is especially useful when:
- You have many tools (dozens or hundreds)
- Tools are domain-specific or rarely used
- Tool availability depends on context, user, or permissions
- You want the LLM to reason about which tools it needs, instead of
guessing from a long list
If you have only a small number of tools, or all tools are always
relevant,
using regular approach may be simpler.
#### Always Visible Tools
When tool search is enabled, tools are normally hidden from the LLM
until they are discovered via a tool-search call.
However, in some cases you may want certain tools to always be visible
to the LLM.
Typical use cases:
- Core tools that should always be accessible
- Frequently used tools where search overhead is unnecessary
- Utility tools
LangChain4j supports this via the `ALWAYS_VISIBLE` tool search behavior.
##### How It Works
When a tool is marked as `ALWAYS_VISIBLE`:
- It is exposed to the LLM in the very first request
- It does not require discovery via tool search
- It remains visible throughout the AI Service invocation
- It is not included in searchable tool candidates
All other tools continue to follow the normal tool-search flow.
##### Using `@Tool` Annotation
You can mark a tool as always visible via the @Tool annotation:
```java
@Tool(searchBehavior = ALWAYS_VISIBLE)
String getWeather(String city) {
return weatherService.getWeather(city);
}
```
##### Using `McpToolProvider`
When using MCP tools (via `McpToolProvider`), always-visible tools can
be configured via `alwaysVisibleToolNames`:
```java
McpToolProvider.builder()
.mcpClients(mcpClient)
.alwaysVisibleToolNames("getWeather")
.build();
```
##### Using `ToolSpecification`
If you configure tools programmatically, you can mark them as always
visible using `metadata`:
```java
ToolSpecification toolSpecification = ToolSpecification.builder()
.name("getWeather")
.parameters(JsonObjectSchema.builder()
.addStringProperty("city")
.required("city")
.build())
.metadata(Map.of(ToolSpecification.METADATA_SEARCH_BEHAVIOR, SearchBehavior.ALWAYS_VISIBLE))
.build();
```
#### Notes and Limitations
NOTE: Tool search relies on the LLM’s ability to understand when and how
to search for tools.
The effectiveness of this feature depends heavily on the chosen model.
NOTE: Tool search is currently marked as experimental and may evolve in
future releases.
## 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) (if
applicable)
## Summary
Adds `BedrockSystemMessage` class to support granular cache point
placement within system messages for AWS Bedrock prompt caching.
This enables caching static portions (instructions, examples) while
keeping dynamic portions (user context) uncached, improving cache
efficiency in multi-user scenarios.
**Example usage:**
```java
BedrockSystemMessage systemMessage = BedrockSystemMessage.builder()
.addText("You are an AI assistant.")
.addTextWithCachePoint("Here are 50 examples:\n" + examples) // Cached
.addText("Current user: " + userName) // Not cached
.build();
```
## Changes
### New Classes (4 files)
- `BedrockSystemContent`: Sealed interface for content blocks with cache
points
- `BedrockSystemContentType`: Enum for content types (TEXT)
- `BedrockSystemTextContent`: Text content with optional cache point
marker
- `BedrockSystemMessage`: System message supporting multiple content
blocks
### Modified Classes (2 files)
- `AbstractBedrockChatModel`:
- Updated `extractSystemMessages()` and `extractRegularMessages()` to
handle `BedrockSystemMessage`
- Added cache point validation (max 4 per request)
- Added null-safety checks for message lists
- `BedrockCachePointPlacement`: Enhanced JavaDoc with AWS requirements
### Tests (5 files)
- `BedrockSystemContentTest`: Unit tests for content blocks
- `BedrockSystemMessageTest`: Unit tests for message builder and
validation
- `BedrockSystemMessageExtractionTest`: Unit tests for extraction logic
with mixed message types
- `BedrockTokenUsageTest`: Unit tests for token usage equals/hashCode
- `BedrockPromptCachingIT`: Integration tests with actual AWS Bedrock
## Key Features
- Granular cache point placement within system messages
- Max 4 cache points per request (AWS limit, validated at build time and
request time)
- Max 10 content blocks per message (with validation)
- Max 1MB text per content block (with validation)
- Backward compatible with existing `AFTER_SYSTEM` placement
- Immutable, thread-safe message design with builder pattern
- Comprehensive JavaDoc with AWS Bedrock caching requirements
## AWS Bedrock Caching Requirements (documented in JavaDoc)
- Maximum 4 cache points per request (across system, user, and tools)
- Minimum ~1,024 tokens for caching to activate
- 5-minute cache TTL (resets on each cache hit)
- Only Claude 3.x and Amazon Nova models support caching
## Backward Compatibility
- Existing `BedrockCachePointPlacement.AFTER_SYSTEM` continues to work
unchanged
- When using `BedrockSystemMessage` with granular cache points,
`AFTER_SYSTEM` is automatically skipped (with warning log)
- Regular `SystemMessage` usage is unaffected
## Known Limitations (documented in JavaDoc)
- Not compatible with `ChatMessageSerializer` (use `toSystemMessage()`
for persistence)
- `MessageWindowChatMemory`/`TokenWindowChatMemory` won't recognize as
system message
- `SystemMessage.findFirst()`/`findAll()`/`findLast()` won't find
`BedrockSystemMessage` instances
Resolves#4187
---------
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
## Issue
Closes https://github.com/langchain4j/langchain4j/issues/3987
## Change
For the Bedrock backend interaction, you can now include the guardrails
details so the Converse or Converse Stream will use them on the request.
## 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
<!-- 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: Jonathan Nunez Aguin <jonathannunezaguin@fico.com>
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
… more reliable results on IT tests.
## Issue
Improves the IT tests for caching interactions on AWS Bedrock.
## Change
Uses the local AWS region instead of cross region models.
## 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. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/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: Jonathan Nunez Aguin <jonathannunezaguin@fico.com>
## Issue
Closes#4035
## Change
- Removed duplicate description field from inputSchema.json in
AwsDocumentConverter
- Tool description now only appears in toolSpec level per AWS Bedrock
documentation
- Updated tests to reflect single description placement
This fix reduces token usage by eliminating unnecessary duplication of
tool descriptions in Bedrock API requests.
## General checklist
- [x] There are no breaking changes (API, behaviour)
- [x] I have written unit and/or integration tests for my change
- [x] I have manually verified that the affected modules build and run
correctly
## 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`
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreRemovalIT`
## Checklist for changing existing embedding store integration
- [ ] I have manually verified compatibility with data persisted using
the latest released version of LangChain4j
## Issue
Fixes issue with the Integration Tests while using Nova Micro.
## Change
Using 1K as the system prompt to Bedrock creates the caching point more
reliable.
## 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. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/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: Jonathan Nunez Aguin <jonathannunezaguin@fico.com>
<!--
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#2410Closes#3871
Replaces #2411
## Change
<!-- Please describe the changes you made. -->
Allows to set custom `ChatRequestParameters` when calling chat method on
`AiServices` interface.
## 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
---------
Co-authored-by: Dmytro Liubarskyi <ljubarskij@gmail.com>
<!--
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" -->
Fixes#4190
## Change
<!-- Please describe the changes you made. -->
AwsDocumentConverter was setting all of the "properties" as being
required instead of actual "required" property
## 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
- [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
---------
Co-authored-by: Nathan Ciliberto <nciliber@sscinc.com>