Docs & rules

langchain4j/langchain4jGitHub

This is a public, read-only report. Striff reads this repository's docs, turns each sentence that makes a claim about the code into a rule, and checks the rule against the code on the default branch. How this works

1+ stale names in these docs.

main7d5a0bcLast read Oct 3

Is this yours? Install to manage it

Once installed, Striff checks every pull request.

Documents
Rules
345
345
345
123
123
12
21
4
8
25
26
27
1 stale name
222
4
37
4
8
18
57
14
28
13
39
26 docs
langchain4j/langchain4jOpen repository

Stale names in these docs1

Each sentence below has a stale name: a type the default branch doesn't declare, or declares somewhere else. Edit the doc so it matches the code, or bring the type back.

  • Gonedev.langchain4j.web.search.searchapi.SearchApiEngine
    import dev.langchain4j.web.search.searchapi.SearchApiEngine;

    dev.langchain4j.web.search.searchapi declares nothing by this name. Closest names there: SearchApiWebSearchEngine, SearchApiWebSearchEngineBuilder, SearchApiClient.

    View on GitHub

langchain4j/langchain4j — documented rules

345 of 345 rules, printed October 14, 2026.

The sentence in your docs
Read Oct 3
AnthropicBatchChatModel implements the core BatchChatModel interface (submit, retrieve, cancel, list).
5 rules from this sentence
AnthropicBatchChatModel implements BatchChatModel
Holds
BatchChatModel has submit
Holds
BatchChatModel has retrieve
Holds
BatchChatModel has cancel
Holds
BatchChatModel has list
Holds
Read Oct 3
The results will be available in AiMessage.attributes() under the key "server_tool_results":
AiMessage has an attributes method
Holds
Read Oct 3
The same skills(...) parameter is available on AnthropicStreamingChatModel.
AnthropicStreamingChatModel has a skills method
Holds
Read Oct 3
AnthropicChatModel and AnthropicStreamingChatModel return AnthropicTokenUsage in the response, which contains cacheCreationInputTokens and cacheReadInputTokens.
2 rules from this sentence
AnthropicTokenUsage has cacheCreationInputTokens
Holds
AnthropicTokenUsage has cacheReadInputTokens
Holds
Read Oct 3
AiMessage and ToolExecutionResultMessage carry an immutable attributes map, so set it via toBuilder().
3 rules from this sentence
ToolExecutionResultMessage has attributes
Holds
AiMessage has a toBuilder method
Holds
ToolExecutionResultMessage has a toBuilder method
Holds
Read Oct 3
The usual chat(...) methods are available:
GoogleAiGeminiChatModel has a chat method
Holds
Read Oct 3
The latter additionally exposes Gemini-only options such as aspectRatio and imageSize:
2 rules from this sentence
GoogleAiGeminiChatRequestParameters has aspectRatio
Holds
GoogleAiGeminiChatRequestParameters has imageSize
Holds
Read Oct 3
To read it, cast ChatResponse.metadata() to GoogleAiGeminiChatResponseMetadata:
ChatResponse has a metadata method
Holds
Read Oct 3
Method safetyRatings(), Meaning How the generated content was rated, one entry per harm category Empty if none
GoogleAiGeminiChatResponseMetadata has a safetyRatings method
Holds
Read Oct 3
Method promptSafetyRatings(), Meaning How your prompt was rated Empty if none
GoogleAiGeminiChatResponseMetadata has a promptSafetyRatings method
Holds
Read Oct 3
Method blockReason(), Meaning Why Gemini refused the prompt outright, or null if it did not
GoogleAiGeminiChatResponseMetadata has a blockReason method
Holds
Read Oct 3
GeminiSafetyRating.category() and probability() are plain Strings holding the raw API values, so harm categories that Google introduces later are passed through as-is instead of breaking your application.
2 rules from this sentence
GeminiSafetyRating has a category method
Holds
GeminiSafetyRating has a probability method
Holds
Read Oct 3
[1] - The JsonSchema can be generated automatically from your class using JsonSchemas.jsonSchemaFrom() helper method.
JsonSchemas has a jsonSchemaFrom method
Holds
Read Oct 3
GeminiThinkingConfig.includeThoughts and thinkingBudget: enables thinking, see more details here.
2 rules from this sentence
GeminiThinkingConfig has includeThoughts
Holds
GeminiThinkingConfig has thinkingBudget
Holds
Read Oct 3
controls whether to return thinking (if available) inside AiMessage.thinking() and whether to invoke StreamingChatResponseHandler.onPartialThinking() and TokenStream.onPartialThinking() callbacks when using GoogleAiGeminiStreamingChatModel.
3 rules from this sentence
AiMessage has a thinking method
Holds
StreamingChatResponseHandler has an onPartialThinking method
Holds
TokenStream has an onPartialThinking method
Holds
Read Oct 3
If enabled, tinking signatures will also be stored and returned inside the AiMessage.attributes().
AiMessage has an attributes method
Holds
Read Oct 3
:::note Please note that when returnThinking is not set (is null) and thinkingConfig is set, thinking text will be prepended to the actual response inside the AiMessage.text() field and StreamingChatResponseHandler.onPartialResponse() will be invoked instead of StreamingChatResponseHandler.onPartialThinking().
2 rules from this sentence
AiMessage has a text method
Holds
StreamingChatResponseHandler has an onPartialResponse method
Holds
Read Oct 3
createCache has three forms for expiration: with no expiration argument it uses the API default (currently 1 hour);
GeminiCaches has createCache
Holds
Read Oct 3
The BatchState enum represents the possible states of a batch job:
BatchState is an enumeration
Holds
Read Oct 3
Use BatchState.isTerminal() on BatchResponse.state() to detect when polling can stop.
BatchState has an isTerminal method
Holds
Read Oct 3
As well as the ChatResponse chat(ChatRequest req) method:
GoogleGenAiChatModel has a chat method
Holds
Read Oct 3
The response must be handled by a StreamingChatResponseHandler.
GoogleGenAiStreamingChatModel depends on StreamingChatResponseHandler
Holds
Read Oct 3
Instead of creating the cache out-of-band, you can create and manage it directly from LangChain4j with GoogleGenAiCaches, which wraps the SDK's cache lifecycle (create / get / list / update TTL / delete). The messages are cached using the same GoogleGenAiContentMapper the chat models use, so you stay in the LangChain4j ChatMessage domain.
GoogleGenAiCaches depends on GoogleGenAiContentMapper
Holds
Read Oct 3
They arrive as inlineData parts, and GoogleGenAiChatModel maps them into the AiMessage attributes under GENERATED_IMAGES_KEY, which is what AiMessage.images() reads:
AiMessage has an images method
Holds
Read Oct 3
The Mistral-specific options (safePrompt, randomSeed, sendThinking and returnThinking) can also be set per request via MistralAiChatRequestParameters, overriding the values configured on the model builder.
4 rules from this sentence
MistralAiChatRequestParameters has safePrompt
Holds
MistralAiChatRequestParameters has randomSeed
Holds
MistralAiChatRequestParameters has sendThinking
Holds
MistralAiChatRequestParameters has returnThinking
Holds
Read Oct 3
when enabled, reasoning text produced by the model will be parsed from the API response and stored in AiMessage.thinking().
AiMessage has a thinking method
Holds
Read Oct 3
For streaming, StreamingChatResponseHandler.onPartialThinking() and TokenStream.onPartialThinking() callbacks will also be invoked.
2 rules from this sentence
StreamingChatResponseHandler has an onPartialThinking method
Holds
TokenStream has an onPartialThinking method
Holds
Read Oct 3
MistralAiBatchChatModel implements the core BatchChatModel interface to process many chat requests asynchronously via the Mistral Batch API, at 50% of the standard per-token price.
MistralAiBatchChatModel implements BatchChatModel
Holds
Read Oct 3
In the previous section, an OpenAiOfficialChatModel object was created, which implements the ChatModel interface.
OpenAiOfficialChatModel implements ChatModel
Holds
Read Oct 3
OpenAiOfficialPromptCacheBreakpoint.mark() returns a marked copy of the message, leaving the original untouched:
OpenAiOfficialPromptCacheBreakpoint has a mark method
Holds
Read Oct 3
OpenAiOfficialResponsesChatRequestParameters extends DefaultChatRequestParameters with Responses API-specific fields: previousResponseId, maxToolCalls, parallelToolCalls, topLogprobs, truncation, include, serviceTier, safetyIdentifier, promptCacheKey, promptCacheRetention, promptCacheOptions, reasoningEffort, reasoningSummary, textVerbosity, streamIncludeObfuscation, store, strictTools, strictJsonSchema.
OpenAiOfficialResponsesChatRequestParameters extends DefaultChatRequestParameters
Holds
Read Oct 3
previousResponseId, maxToolCalls, parallelToolCalls, topLogprobs, truncation, include, serviceTier, safetyIdentifier, promptCacheKey, promptCacheRetention, promptCacheOptions, reasoningEffort, reasoningSummary, textVerbosity, streamIncludeObfuscation, store, strictTools, strictJsonSchema.
18 rules from this sentence
OpenAiOfficialResponsesChatRequestParameters has previousResponseId
Holds
OpenAiOfficialResponsesChatRequestParameters has maxToolCalls
Holds
OpenAiOfficialResponsesChatRequestParameters has parallelToolCalls
Holds
OpenAiOfficialResponsesChatRequestParameters has topLogprobs
Holds
OpenAiOfficialResponsesChatRequestParameters has truncation
Holds
OpenAiOfficialResponsesChatRequestParameters has include
Holds
OpenAiOfficialResponsesChatRequestParameters has serviceTier
Holds
OpenAiOfficialResponsesChatRequestParameters has safetyIdentifier
Holds
OpenAiOfficialResponsesChatRequestParameters has promptCacheKey
Holds
OpenAiOfficialResponsesChatRequestParameters has promptCacheRetention
Holds
OpenAiOfficialResponsesChatRequestParameters has promptCacheOptions
Holds
OpenAiOfficialResponsesChatRequestParameters has reasoningEffort
Holds
OpenAiOfficialResponsesChatRequestParameters has reasoningSummary
Holds
OpenAiOfficialResponsesChatRequestParameters has textVerbosity
Holds
OpenAiOfficialResponsesChatRequestParameters has streamIncludeObfuscation
Holds
OpenAiOfficialResponsesChatRequestParameters has store
Holds
OpenAiOfficialResponsesChatRequestParameters has strictTools
Holds
OpenAiOfficialResponsesChatRequestParameters has strictJsonSchema
Holds
Read Oct 3
When reasoningSummary is set for OpenAiOfficialResponsesStreamingChatModel, the StreamingChatResponseHandler.onPartialThinking() callback will be invoked as reasoning summary tokens are streamed:
StreamingChatResponseHandler has an onPartialThinking method
Holds
Read Oct 3
The reasoning summary in AiMessage.thinking() is informational and does not need to be sent back in follow-up requests — OpenAI discards it between turns.
AiMessage has a thinking method
Holds
Read Oct 3
This is automatically stored in AiMessage.attributes() under the key "encrypted_reasoning".
AiMessage has an attributes method
Holds
Read Oct 3
OpenAiOfficialBatchChatModel implements the core BatchChatModel interface to process many chat requests asynchronously via the OpenAI Batch API, at 50% of the standard per-token price.
OpenAiOfficialBatchChatModel implements BatchChatModel
Holds
Read Oct 3
It returns the generated audio as raw bytes wrapped in an Audio object.
OpenAiTextToSpeechModel depends on Audio
Holds
Read Oct 3
OpenAiPromptCacheOptions.implicit() and OpenAiPromptCacheOptions.explicit() are shorthands for options that only set the mode.
2 rules from this sentence
OpenAiPromptCacheOptions has an implicit method
Holds
OpenAiPromptCacheOptions has an explicit method
Holds
Read Oct 3
OpenAiPromptCacheBreakpoint.mark() returns a marked copy of the message, leaving the original untouched:
OpenAiPromptCacheBreakpoint has a mark method
Holds
Read Oct 3
OpenAiResponsesChatRequestParameters extends DefaultChatRequestParameters with Responses API-specific fields: previousResponseId, maxToolCalls, parallelToolCalls, topLogprobs, truncation, include, serviceTier, safetyIdentifier, promptCacheKey, promptCacheRetention, promptCacheOptions, reasoningEffort, reasoningSummary, textVerbosity, streamIncludeObfuscation, store, strictTools, strictJsonSchema.
OpenAiResponsesChatRequestParameters extends DefaultChatRequestParameters
Holds
Read Oct 3
previousResponseId, maxToolCalls, parallelToolCalls, topLogprobs, truncation, include, serviceTier, safetyIdentifier, promptCacheKey, promptCacheRetention, promptCacheOptions, reasoningEffort, reasoningSummary, textVerbosity, streamIncludeObfuscation, store, strictTools, strictJsonSchema.
18 rules from this sentence
OpenAiResponsesChatRequestParameters has previousResponseId
Holds
OpenAiResponsesChatRequestParameters has maxToolCalls
Holds
OpenAiResponsesChatRequestParameters has parallelToolCalls
Holds
OpenAiResponsesChatRequestParameters has topLogprobs
Holds
OpenAiResponsesChatRequestParameters has truncation
Holds
OpenAiResponsesChatRequestParameters has include
Holds
OpenAiResponsesChatRequestParameters has serviceTier
Holds
OpenAiResponsesChatRequestParameters has safetyIdentifier
Holds
OpenAiResponsesChatRequestParameters has promptCacheKey
Holds
OpenAiResponsesChatRequestParameters has promptCacheRetention
Holds
OpenAiResponsesChatRequestParameters has promptCacheOptions
Holds
OpenAiResponsesChatRequestParameters has reasoningEffort
Holds
OpenAiResponsesChatRequestParameters has reasoningSummary
Holds
OpenAiResponsesChatRequestParameters has textVerbosity
Holds
OpenAiResponsesChatRequestParameters has streamIncludeObfuscation
Holds
OpenAiResponsesChatRequestParameters has store
Holds
OpenAiResponsesChatRequestParameters has strictTools
Holds
OpenAiResponsesChatRequestParameters has strictJsonSchema
Holds
Read Oct 3
When reasoningSummary is set for OpenAiResponsesStreamingChatModel, the StreamingChatResponseHandler.onPartialThinking() callback will be invoked as reasoning summary tokens are streamed:
StreamingChatResponseHandler has an onPartialThinking method
Holds
Read Oct 3
The reasoning summary in AiMessage.thinking() is informational and does not need to be sent back in follow-up requests — OpenAI discards it between turns.
AiMessage has a thinking method
Holds
Read Oct 3
This is automatically stored in AiMessage.attributes() under the key "encrypted_reasoning".
AiMessage has an attributes method
Holds
Read Oct 3
The WatsonxChatModel class allows you to create an instance of the ChatModel interface fully encapsulated within LangChain4j.
WatsonxChatModel implements ChatModel
Holds
Read Oct 3
Each watsonx.ai chat service has its own ChatRequestParameters implementation, exposing the parameters that service accepts and nothing else: Class WatsonxChatRequestParameters, Used by WatsonxChatModel , WatsonxStreamingChatModel , WatsonxDeploymentChatModel , WatsonxDeploymentStreamingChatModel
WatsonxChatRequestParameters implements ChatRequestParameters
Holds
Read Oct 3
Parameter serviceTier(...), Description Service tier, one of AUTO , DEFAULT , FLEX , or PRIORITY
WatsonxGatewayChatRequestParameters has a serviceTier method
Holds
Read Oct 3
Parameter reasoningEffort(...), Description Reasoning effort for reasoning models, one of LOW , MEDIUM , or HIGH
WatsonxGatewayChatRequestParameters has a reasoningEffort method
Holds
Read Oct 3
Parameter router(...) / cache(...), Description Router configuration, including a prompt Cache
WatsonxGatewayChatRequestParameters has a router method
Holds
Read Oct 3
Parameter modalities(...), Description Output modalities (e.g ["text"] )
WatsonxGatewayChatRequestParameters has a modalities method
Holds
Read Oct 3
Parameter store(...), Description Whether the provider should persist the request/response
WatsonxGatewayChatRequestParameters has a store method
Holds
Read Oct 3
Parameter parallelToolCalls(...), Description Enable/disable parallel tool calls
WatsonxGatewayChatRequestParameters has a parallelToolCalls method
Holds
Read Oct 3
Parameter user(...), Description End-user identifier forwarded to the provider
WatsonxGatewayChatRequestParameters has an user method
Holds
Read Oct 3
Parameter metadata(...), Description Free-form metadata map forwarded to the provider
WatsonxGatewayChatRequestParameters has a metadata method
Holds
Read Oct 3
Parameter logitBias(...) , logprobs(...) , topLogprobs(...) , seed(...), Description OpenAI-compatible sampling controls
4 rules from this sentence
WatsonxGatewayChatRequestParameters has a logitBias method
Holds
WatsonxGatewayChatRequestParameters has a logprobs method
Holds
WatsonxGatewayChatRequestParameters has a topLogprobs method
Holds
WatsonxGatewayChatRequestParameters has a seed method
Holds
Read Oct 3
It implements the LangChain4j ModelCatalog interface, allowing you to retrieve detailed information about each model.
WatsonxModelCatalog implements ModelCatalog
Holds
Read Oct 3
It also implements the LangChain4j ModelCatalog interface.
WatsonxGatewayModelCatalog implements ModelCatalog
Holds
Read Oct 3
The name() of every returned ModelDescription is the identifier to pass to WatsonxGatewayChatModel.modelName(...) and WatsonxGatewayStreamingChatModel.modelName(...).
ModelDescription has a name method
Holds
Read Oct 3
ModelDescription displayName(), Gateway field same as name(), Notes the gateway has no separate label
ModelDescription has a displayName method
Holds
Read Oct 3
ModelDescription description(), Gateway field description, Notes user-defined, null unless the administrator set it
ModelDescription has a description method
Holds
Read Oct 3
ModelDescription owner(), Gateway field owned_by, Notes provider, e.g openai
ModelDescription has an owner method
Holds
Read Oct 3
ModelDescription createdAt(), Gateway field created, Notes Unix timestamp of the gateway configuration , not of the model release
ModelDescription has a createdAt method
Holds
Read Oct 3
ModelDescription type(), Gateway field -, Notes always ModelType.CHAT because the gateway does not expose model capabilities
ModelDescription has a type method
Holds
Read Oct 3
ModelDescription maxInputTokens(), Gateway field metadata.context_window, Notes null when the administrator did not configure the metadata
ModelDescription has a maxInputTokens method
Holds
Read Oct 3
ModelDescription maxOutputTokens(), Gateway field -, Notes always null , the gateway does not return it
ModelDescription has a maxOutputTokens method
Holds
Read Oct 3
The WatsonxTokenCountEstimator implements the LangChain4j TokenCountEstimator interface by calling the watsonx.ai tokenization endpoint, so the count comes from the tokenizer of the model itself rather than from a local approximation.
WatsonxTokenCountEstimator implements TokenCountEstimator
Holds
Read Oct 3
estimateTokenCountInMessage(...) also counts the thinking text and the > tool execution requests of an AiMessage.
WatsonxTokenCountEstimator has an estimateTokenCountInMessage method
Holds
Read Oct 3
The WatsonxModerationModel provides a LangChain4j implementation of the ModerationModel interface using IBM watsonx.ai.
WatsonxModerationModel implements ModerationModel
Holds
Read Oct 3
As you can see, there is a simple chat method that takes a String as input and returns a String as output, similar to LanguageModel.
ChatModel has a chat method
Holds
Read Oct 3
ChatMessage is a base interface that represents a chat message.
ChatMessage is a contract
Holds
Read Oct 3
One can also specify DetailLevel enum (with LOW/HIGH/AUTO options) to control how the model processes the image.
DetailLevel is an enumeration
Holds
Read Oct 3
:::warning Breaking change for Kotlin users. ChatModel now declares a Java member chatAsync(ChatRequest): CompletableFuture<ChatResponse>.
ChatModel has a chatAsync method
Holds
Read Oct 3
The DecisionModel API itself is part of langchain4j-core, which comes with every implementation: requests and questions are in dev.langchain4j.model.decision.request, answers in dev.langchain4j.model.decision.response and listeners in dev.langchain4j.model.decision.listener.
DecisionModel is in langchain4j-core
Holds
Read Oct 3
A DecisionRequest contains the input (state) and the questions, each registered under a name of your choice:
2 rules from this sentence
DecisionRequest has input
Holds
DecisionRequest has questions
Holds
Read Oct 3
YesNoQuestion.of(text), ChoiceQuestion.of(text, options) and ScaleQuestion.of(text, levels).
3 rules from this sentence
YesNoQuestion has an of method
Holds
ChoiceQuestion has an of method
Holds
ScaleQuestion has an of method
Holds
Read Oct 3
The response also carries the name of the model that produced the answers and the token usage: response.modelName() and response.tokenUsage().
2 rules from this sentence
DecisionResponse has a modelName method
Holds
DecisionResponse has a tokenUsage method
Holds
Read Oct 3
A YesNoQuestion asks a yes/no question and is answered with a YesNoAnswer, whose probability() is the probability that the answer is "yes", from 0 to 1.
YesNoAnswer has a probability method
Holds
Read Oct 3
isYes(threshold) turns it into a decision:
YesNoAnswer has an isYes method
Holds
Read Oct 3
probabilityOf(option) and margin(): the probability of one option, and the difference between the two most likely options
2 rules from this sentence
ChoiceAnswer has a probabilityOf method
Holds
ChoiceAnswer has a margin method
Holds
Read Oct 3
Choice and scale answers carry the probability of each option or level, if the model reports them (otherwise probabilities() is empty).
2 rules from this sentence
ChoiceAnswer has a probabilities method
Holds
ScaleAnswer has a probabilities method
Holds
Read Oct 3
Choice and scale answers can also carry a confidence() value from 0 to 1.
2 rules from this sentence
ChoiceAnswer has a confidence method
Holds
ScaleAnswer has a confidence method
Holds
Read Oct 3
decideAsync(request) returns a CompletableFuture<DecisionResponse>.
DecisionModel has a decideAsync method
Holds
Read Oct 3
Question and DecisionAnswer are interfaces, so an implementation can support additional question types with their own answer types.
2 rules from this sentence
Question is a contract
Holds
DecisionAnswer is a contract
Holds
Read Oct 3
Answers of such types can be read with response.answer(name, type), where type is the answer class defined by the implementation.
DecisionResponse has an answer method
Holds
Read Oct 3
Component DecisionModelInputGuardrail , DecisionModelOutputGuardrail, Module langchain4j-guardrails
2 rules from this sentence
DecisionModelInputGuardrail is in langchain4j-guardrails
Holds
DecisionModelOutputGuardrail is in langchain4j-guardrails
Holds
Read Oct 3
Component DecisionScoringModel , DecisionModelQueryRouter , RoutingChatModel + DecisionModelChatModelRouter, Module langchain4j-core
4 rules from this sentence
DecisionScoringModel is in langchain4j-core
Holds
DecisionModelQueryRouter is in langchain4j-core
Holds
RoutingChatModel is in langchain4j-core
Holds
DecisionModelChatModelRouter is in langchain4j-core
Holds
Read Oct 3
DecisionScoringModel is a ScoringModel: the score of a segment is the probability that the answer to "Does the document help answer the query?" is "yes".
DecisionScoringModel implements ScoringModel
Holds
Read Oct 3
Each segment is asked as a separate yes/no question, and the segments are scored in requests of up to 20 segments (maxSegmentsPerRequest(...)), which are sent in parallel by scoreAsync(...).
2 rules from this sentence
DecisionScoringModel has a maxSegmentsPerRequest method
Holds
DecisionScoringModel has a scoreAsync method
Holds
Read Oct 3
The decision model receives the query and, when it comes from a conversation, the 2 previous messages (maxMessages(3) by default), so that follow-up questions such as "and for contractors?" are understood.
DecisionModelQueryRouter has a maxMessages method
Holds
Read Oct 3
fallbackStrategy(ROUTE_TO_ALL) retrieves from all sources instead, which favors answer quality.
DecisionModelQueryRouter has a fallbackStrategy method
Holds
Read Oct 3
DecisionModelToolSearchStrategy is a tool search strategy: the LLM searches for tools when it needs them, and the decision model decides which tools match the search.
DecisionModelToolSearchStrategy implements ToolSearchStrategy
Holds
Read Oct 3
DecisionModelFilteringToolProvider wraps a ToolProvider and passes on only the tools that are relevant to the conversation, before the first LLM call, so no tool search round trip is needed.
DecisionModelFilteringToolProvider depends on ToolProvider
Holds
Read Oct 3
If the wrapped tool provider is dynamic (isDynamic() returns true), the AI Service asks it for tools before each LLM call of the tool-calling loop, so the decision model is called each time as well, which adds its latency to each round.
ToolProvider has an isDynamic method
Holds
Read Oct 3
Component DecisionModelChatModelRouter, Default behavior when the decision model fails the default route is used, a warning is logged, Configurable fallbackStrategy
DecisionModelChatModelRouter has fallbackStrategy
Holds
Read Oct 3
Component DecisionModelFilteringToolProvider, Default behavior when the decision model fails all tools are passed on, a warning is logged, Configurable fallbackStrategy
DecisionModelFilteringToolProvider has fallbackStrategy
Holds
Read Oct 3
All of these exceptions extend LangChain4jException.
InvalidDecisionResponseException extends LangChain4jException
Holds
Read Oct 3
mean() is the probability-weighted average of the level indexes, so it can fall between two levels.
Scale has a mean method
Holds
Read Oct 3
probabilityAtLeast(level) is useful to act on a level or anything above it, for example to page the on-call engineer when an incident is likely to be at least of high severity:
Scale has a probabilityAtLeast method
Holds
Read Oct 3
serviceInterface() and method(): the service and the method that is invoked;
2 rules from this sentence
ThresholdContext has a serviceInterface method
Holds
ThresholdContext has a method method
Holds
Read Oct 3
Input guardrails are implemented by implementing the InputGuardrail interface.
InputGuardrail is a contract
Holds
Read Oct 3
The InputGuardrail interface has two variants of the validate method, at least one of which needs to be implemented:
InputGuardrail has a validate method
Holds
Read Oct 3
Outcome success with alternate result, Helper method on InputGuardrail successWith(String), Description - Similar to success except the user message is altered before proceeding to the next step (next guardrail in the chain or calling the LLM). - A rewrite made by a guardrail overrides any rewrite made by an earlier guardrail in the chain
InputGuardrail has a successWith method
Holds
Read Oct 3
Outcome fatal, Helper method on InputGuardrail fatal(String) or fatal(String, Throwable), Description - The input is invalid and execution is halted with an InputGuardrailException . - The LLM is not called. - If a Throwable is passed, consumers can catch InputGuardrailException and check the cause It will be the Throwable passed here
InputGuardrail has a fatal method
Holds
Read Oct 3
Similar to input guardrails, output guardrails are implemented by implementing the OutputGuardrail interface.
OutputGuardrail is a contract
Holds
Read Oct 3
The OutputGuardrail interface has two variants of the validate method, at least one of which needs to be implemented:
OutputGuardrail has a validate method
Holds
Read Oct 3
Outcome failure, Helper method on OutputGuardrail failure(String) or failure(String, Throwable), Description - The output is invalid but the next guardrails in the chain continue to be executed in order to accumulate all possible validation problems. - The validation failure is returned to the user as an OutputGuardrailException
OutputGuardrail has a failure method
Holds
Read Oct 3
Outcome fatal, Helper method on OutputGuardrail fatal(String) or fatal(String, Throwable), Description The output is invalid and execution is halted with an OutputGuardrailException thrown to the caller
OutputGuardrail has a fatal method
Holds
Read Oct 3
LangChain4j exposes all of this metadata through the map stored inside ToolSpecification.metadata() method.
ToolSpecification has a metadata method
Holds
Read Oct 3
The title field that exists directly in the MCP tool definition is exposed under McpToolMetadataKeys.TITLE key in the metadata map to distinguish it from the title that is retrieved from annotations - that one is exposed under the McpToolMetadataKeys.ANNOTATION_TITLE key.
McpToolMetadataKeys has a TITLE field
Holds
Read Oct 3
If the tool has icons, they are exposed under the McpToolMetadataKeys.ICONS key in the metadata map.
McpToolMetadataKeys has ICONS
Holds
Read Oct 3
The entries of the _meta object are exposed through ToolExecutionResult.attributes(), using their original keys, with the JSON values converted into nested maps.
ToolExecutionResult has an attributes method
Holds
Read Oct 3
To keep them, enable returnToolResultAttributes on the tool provider:
McpToolProvider has returnToolResultAttributes
Holds
Read Oct 3
It is still delivered to McpClientListener.afterExecuteTool(), which receives the complete raw response.
McpClientListener has an afterExecuteTool method
Holds
Read Oct 3
McpApplicationErrorException therefore implements ToolErrorVisibleToLlm: with a tool execution error handler that honors it, such as ToolExecutionErrorHandler.failInvocationUnlessVisibleToLlm(), the server's text is sent to the LLM and it can react to it.
McpApplicationErrorException implements ToolErrorVisibleToLlm
Holds
Read Oct 3
with a tool execution error handler that honors it, such as ToolExecutionErrorHandler.failInvocationUnlessVisibleToLlm(), the server's text is sent to the LLM and it can react to it.
ToolExecutionErrorHandler has a failInvocationUnlessVisibleToLlm method
Holds
Read Oct 3
The supplier receives an McpCallContext (nullable) that contains the message being sent and, when applicable, the InvocationContext of the AI service call that triggered it.
McpCallContext depends on InvocationContext
Holds
Read Oct 3
If you want to change this behavior, there is an interface named dev.langchain4j.mcp.client.logging.McpLogMessageHandler that serves as a callback for received log messages.
McpLogMessageHandler is a contract
Holds
Read Oct 3
The interface dev.langchain4j.mcp.client.McpClientListener serves as the base for listener implementations.
2 rules from this sentence
McpClientListener is a contract
Holds
McpClientListener is in dev.langchain4j.mcp.client
Holds
Read Oct 3
Each McpResourceContents object represents either a binary blob (McpBlobResourceContents) or text (McpTextResourceContents).
2 rules from this sentence
McpBlobResourceContents depends on McpResourceContents
Holds
McpTextResourceContents depends on McpResourceContents
Holds
Read Oct 3
If you set a McpResourcesAsToolsPresenter instance using the builder when building an McpToolProvider, the MCP tool provider will automatically add two synthetic tools to the result of its provideTools method, along the 'regular' tools that are supported by the backing MCP servers. One tool should serve for obtaining a list of resources and the other for obtaining a particular resource. LangChain4j provides a default implementation named DefaultMcpResourcesAsToolsPresenter that adds these two tools:
DefaultMcpResourcesAsToolsPresenter implements McpResourcesAsToolsPresenter
Holds
Read Oct 3
You can use McpPromptMessage.toChatMessage() to convert it into a generic dev.langchain4j.data.message.ChatMessage from the LangChain4j core API.
McpPromptMessage has a toChatMessage method
Holds
Read Oct 3
You can manually clear this cache by calling DefaultMcpClient.evictToolListCache().
DefaultMcpClient has an evictToolListCache method
Holds
Read Oct 3
Then, to search for MCP servers, use the registry.listServers(McpServerListRequest) method.
DefaultMcpRegistryClient has a listServers method
Holds
Read Oct 3
The seam is there — the CompletableFutureAdapter and PublisherAdapter SPIs, discovered via ServiceLoader — but no adapter ships for them, so declaring such a return type currently fails.
2 rules from this sentence
CompletableFutureAdapter is a contract
Holds
PublisherAdapter is a contract
Holds
Read Oct 3
Layer Chat model, Blocking chat(ChatRequest), Non-blocking counterpart chatAsync(ChatRequest) , and chat(ChatRequest) returning a Publisher on StreamingChatModel
3 rules from this sentence
ChatModel has a chatAsync method
Holds
StreamingChatModel has a chat method
Holds
ChatModel has a chat method
Holds
Read Oct 3
Layer Embedding model, Blocking embed(...), Non-blocking counterpart embedAsync(...)
2 rules from this sentence
EmbeddingModel has an embedAsync method
Holds
EmbeddingModel has an embed method
Holds
Read Oct 3
Layer Scoring model, Blocking scoreAll(...), Non-blocking counterpart scoreAsync(...)
2 rules from this sentence
ScoringModel has a scoreAsync method
Holds
ScoringModel has a scoreAll method
Holds
Read Oct 3
Layer Chat memory, Blocking add , messages , set, Non-blocking counterpart addAsync , messagesAsync , setAsync
6 rules from this sentence
ChatMemory has addAsync
Holds
ChatMemory has messagesAsync
Holds
ChatMemory has setAsync
Holds
ChatMemory has add
Holds
ChatMemory has messages
Holds
ChatMemory has set
Holds
Read Oct 3
Layer Chat memory store, Blocking getMessages , updateMessages , deleteMessages, Non-blocking counterpart getMessagesAsync , updateMessagesAsync , deleteMessagesAsync
6 rules from this sentence
ChatMemoryStore has getMessagesAsync
Holds
ChatMemoryStore has updateMessagesAsync
Holds
ChatMemoryStore has deleteMessagesAsync
Holds
ChatMemoryStore has getMessages
Holds
ChatMemoryStore has updateMessages
Holds
ChatMemoryStore has deleteMessages
Holds
Read Oct 3
Layer Guardrails, Blocking validate(...), Non-blocking counterpart validateAsync(...)
2 rules from this sentence
Guardrail has a validateAsync method
Holds
Guardrail has a validate method
Holds
Read Oct 3
Layer Tools, Blocking ToolExecutor.execute(...), Non-blocking counterpart ToolExecutor.executeAsync(...)
2 rules from this sentence
ToolExecutor has an executeAsync method
Holds
ToolExecutor has an execute method
Holds
Read Oct 3
Layer RAG, Blocking RetrievalAugmentor.augment(...) , retrievers, routers, aggregators, query transformers, Non-blocking counterpart augmentAsync(...) , retrieveAsync(...) , routeAsync(...) , aggregateAsync(...) , transformAsync(...)
6 rules from this sentence
RetrievalAugmentor has an augmentAsync method
Holds
ContentRetriever has a retrieveAsync method
Holds
QueryRouter has a routeAsync method
Holds
ContentAggregator has an aggregateAsync method
Holds
QueryTransformer has a transformAsync method
Holds
RetrievalAugmentor has an augment method
Holds
Read Oct 3
Layer Embedding store, Blocking search(...), Non-blocking counterpart searchAsync(...)
2 rules from this sentence
EmbeddingStore has a searchAsync method
Holds
EmbeddingStore has a search method
Holds
Read Oct 3
Layer Web search, Blocking search(...), Non-blocking counterpart searchAsync(...)
2 rules from this sentence
WebSearchEngine has a search method
Holds
WebSearchEngine has a searchAsync method
Holds
Read Oct 3
Layer MCP, Blocking McpClient.executeTool(...), Non-blocking counterpart executeToolAsync(...)
2 rules from this sentence
McpClient has an executeToolAsync method
Holds
McpClient has an executeTool method
Holds
Read Oct 3
Layer Guardrail execution, Blocking ChatExecutor.execute(...), Non-blocking counterpart ChatExecutor.executeAsync(...)
2 rules from this sentence
ChatExecutor has an executeAsync method
Holds
ChatExecutor has an execute method
Holds
Read Oct 3
Layer HTTP client, Blocking execute(...), Non-blocking counterpart executeAsync(...) , stream(...)
3 rules from this sentence
HttpClient has an executeAsync method
Holds
HttpClient has a stream method
Holds
HttpClient has an execute method
Holds
Read Oct 3
Everywhere LangChain4j runs work off the caller thread — concurrent tool calls, offloaded retrieval, retry backoff — it takes the executor from one pluggable seam, the ExecutorProvider SPI:
ExecutorProvider is a contract
Holds
Read Oct 3
Provider OpenAI — Chat Completions, CompletableFuture ( chatAsync ) ✅, Flow.Publisher (reactive chat ) ✅
2 rules from this sentence
OpenAiChatModel has chatAsync
Holds
OpenAiStreamingChatModel has chat
Holds
Read Oct 3
Provider OpenAI — Responses, CompletableFuture ( chatAsync ) ✅, Flow.Publisher (reactive chat ) ✅
2 rules from this sentence
OpenAiOfficialChatModel has chatAsync
Holds
OpenAiOfficialStreamingChatModel has chat
Holds
Read Oct 3
Provider Anthropic, CompletableFuture ( chatAsync ) ✅, Flow.Publisher (reactive chat ) ✅
2 rules from this sentence
AnthropicChatModel has chatAsync
Holds
AnthropicStreamingChatModel has chat
Holds
Read Oct 3
Provider Bedrock, CompletableFuture ( chatAsync ) ✅, Flow.Publisher (reactive chat ) ✅
2 rules from this sentence
BedrockChatModel has chatAsync
Holds
BedrockStreamingChatModel has chat
Holds
Read Oct 3
OpenAI implements asynchronous embeddings (embedAsync), Cohere asynchronous scoring (scoreAsync) and Tavily asynchronous web search (searchAsync).
OpenAiEmbeddingModel has embedAsync
Holds
Read Oct 3
Component Chat memory, What it must implement addAsync / messagesAsync / setAsync, Bundled implementations MessageWindowChatMemory and InMemoryChatMemoryStore already do
4 rules from this sentence
MessageWindowChatMemory has addAsync
Holds
MessageWindowChatMemory has messagesAsync
Holds
MessageWindowChatMemory has setAsync
Holds
InMemoryChatMemoryStore has messagesAsync
Holds
Read Oct 3
Component Chat model router ( RoutingChatModel ), What it must implement routeAsync, Bundled implementations DecisionModelChatModelRouter does, if its decision model supports decideAsync
DecisionModelChatModelRouter has routeAsync
Holds
Read Oct 3
Each type of event includes information encapsulated inside an InvocationContext.
4 rules from this sentence
AiServiceStartedEvent depends on InvocationContext
Holds
AiServiceErrorEvent depends on InvocationContext
Holds
AiServiceCompletedEvent depends on InvocationContext
Holds
ToolExecutedEvent depends on InvocationContext
Holds
Read Oct 3
AiServiceStartedListener depends on AiServiceStartedEvent
Holds
Read Oct 3
AiServiceErrorListener depends on AiServiceErrorEvent
Holds
Read Oct 3
AiServiceCompletedListener depends on AiServiceCompletedEvent
Holds
Read Oct 3
ToolExecutedEventListener depends on ToolExecutedEvent
Holds
Read Oct 3
There are various registerListener method variants on the AiServices class.
AiServices has a registerListener method
Holds
Read Oct 3
Once you have your event and listener, you need to fire the event by obtaining/managing an instance of AiServiceListenerRegistrar and calling the fireEvent(event) method.
AiServiceListenerRegistrar has a fireEvent method
Holds
Read Oct 3
The attributes map allows passing information between the onRequest, onResponse, and onError methods of the same ChatModelListener, as well as between multiple ChatModelListeners.
3 rules from this sentence
ChatModelListener has an onRequest method
Holds
ChatModelListener has an onResponse method
Holds
ChatModelListener has an onError method
Holds
Read Oct 3
For example, you can pass tenant or correlation identifiers to ChatModelListeners through listenerAttributes.
ChatRequestOptions has listenerAttributes
Holds
Read Oct 3
The EmbeddingStoreIngestor loads a DocumentSplitter from the langchain4j-easy-rag dependency through SPI.
EmbeddingStoreIngestor depends on DocumentSplitter
Holds
Read Oct 3
The EmbeddingStoreIngestor loads an EmbeddingModel from the langchain4j-easy-rag dependency through SPI.
EmbeddingStoreIngestor depends on EmbeddingModel
Holds
Read Oct 3
Documents can represent files in various formats, such as PDF, DOC, TXT, etc. To parse each of these formats, there's a DocumentParser interface with several implementations included in the library:
DocumentParser is a contract
Holds
Read Oct 3
DocumentTransformer implementations can perform a variety of document transformations such as:
DocumentTransformer is a contract
Holds
Read Oct 3
Currently, the only implementation provided out-of-the-box is HtmlToTextDocumentTransformer in the langchain4j-document-transformer-jsoup module, which can extract desired text content and metadata entries from the raw HTML.
HtmlToTextDocumentTransformer implements DocumentTransformer
Holds
Read Oct 3
TextSegment.text() returns the text of the TextSegment
TextSegment has a text method
Holds
Read Oct 3
TextSegment.metadata() returns the Metadata of the TextSegment
TextSegment has a metadata method
Holds
Read Oct 3
TextSegment.from(String, Metadata) creates a TextSegment from text and Metadata
TextSegment has a from method
Holds
Read Oct 3
LangChain4j has a DocumentSplitter interface with several out-of-the-box implementations:
DocumentSplitter is a contract
Holds
Read Oct 3
You call the split(Document) or splitAll(List<Document>) methods of the DocumentSplitter.
2 rules from this sentence
DocumentSplitter has a split method
Holds
DocumentSplitter has a splitAll method
Holds
Read Oct 3
For instance, DocumentByParagraphSplitter divides a document into paragraphs (defined by two or more consecutive newline characters), while DocumentBySentenceSplitter uses the OpenNLP library's sentence detector to split a document into sentences, and so on.
2 rules from this sentence
DocumentByParagraphSplitter implements DocumentSplitter
Holds
DocumentBySentenceSplitter implements DocumentSplitter
Holds
Read Oct 3
CosineSimilarity.between(Embedding, Embedding) calculates the cosine similarity between 2 Embeddings
CosineSimilarity has a between method
Holds
Read Oct 3
The EmbeddingModel interface represents a special type of model that converts text into an Embedding.
EmbeddingModel is a contract
Holds
Read Oct 3
EmbeddingModel.embed(String) embeds the given text
EmbeddingModel has an embed method
Holds
Read Oct 3
EmbeddingModel.embedAll(List<TextSegment>) embeds all the given TextSegment
EmbeddingModel has an embedAll method
Holds
Read Oct 3
EmbeddingModel.dimension() returns the dimension of the Embedding produced by this model </details>
EmbeddingModel has a dimension method
Holds
Read Oct 3
All ingest() methods in EmbeddingStoreIngestor return an IngestionResult.
EmbeddingStoreIngestor has an ingest method
Holds
Read Oct 3
DefaultRetrievalAugmentor, which should be suitable for the majority of RAG use cases.
DefaultRetrievalAugmentor implements RetrievalAugmentor
Holds
Read Oct 3
EmbeddingStoreContentRetriever retrieves relevant Content from the EmbeddingStore using the EmbeddingModel to embed the Query.
2 rules from this sentence
EmbeddingStoreContentRetriever depends on EmbeddingStore
Holds
EmbeddingStoreContentRetriever depends on EmbeddingModel
Holds
Read Oct 3
WebSearchContentRetriever retrieves relevant Content from the web using a WebSearchEngine.
WebSearchContentRetriever depends on WebSearchEngine
Holds
Read Oct 3
SqlDatabaseContentRetriever is an experimental implementation of the ContentRetriever that can be found in the langchain4j-experimental-sql module.
SqlDatabaseContentRetriever implements ContentRetriever
Holds
Read Oct 3
DefaultQueryRouter is the default implementation used in DefaultRetrievalAugmentor.
2 rules from this sentence
DefaultQueryRouter implements QueryRouter
Holds
DefaultRetrievalAugmentor depends on DefaultQueryRouter
Holds
Read Oct 3
The DefaultContentAggregator is the default implementation of ContentAggregator, which performs two-stage Reciprocal Rank Fusion (RRF).
DefaultContentAggregator implements ContentAggregator
Holds
Read Oct 3
The ReRankingContentAggregator uses a ScoringModel, like Cohere, to perform re-ranking.
ReRankingContentAggregator depends on ScoringModel
Holds
Read Oct 3
There are several ways to add properties to a JsonObjectSchema: You can add all the properties at once using the properties(Map<String, JsonSchemaElement> properties) method:
JsonObjectSchema implements JsonSchemaElement
Holds
Read Oct 3
The structure of the JSON schema is defined using JsonSchemaElement interface, with the following subtypes:
JsonSchemaElement is a contract
Holds
Read Oct 3
You can add all the properties at once using the properties(Map<String, JsonSchemaElement> properties) method:
JsonObjectSchema has a properties method
Holds
Read Oct 3
All of the JsonSchemaElement subtypes, except for JsonReferenceSchema, have a description property.
10 rules from this sentence
JsonAnyOfSchema has description
Holds
JsonArraySchema has description
Holds
JsonBooleanSchema has description
Holds
JsonEnumSchema has description
Holds
JsonIntegerSchema has description
Holds
JsonNullSchema has description
Holds
JsonNumberSchema has description
Holds
JsonObjectSchema has description
Holds
JsonRawSchema has description
Holds
JsonStringSchema has description
Holds
Read Oct 3
At the low level, you can use the chat(ChatRequest) method of the ChatModel.
2 rules from this sentence
ChatModel has a chat method
Holds
ChatModel depends on ChatRequest
Holds
Read Oct 3
At the low level, you can use the chat(ChatRequest) method of the ChatModel. A similar method is also present in the StreamingChatModel.
StreamingChatModel has a chat method
Holds
Read Oct 3
The description of the tool
ToolSpecification has description
Holds
Read Oct 3
The parameters of the tool and their descriptions
ToolSpecification has parameters
Holds
Read Oct 3
The metadata of the tool.
ToolSpecification has metadata
Holds
Read Oct 3
ToolSpecifications.toolSpecificationsFrom(Class) ToolSpecifications.toolSpecificationsFrom(Object)
ToolSpecifications has a toolSpecificationsFrom method
Holds
Read Oct 3
ToolSpecifications.toolSpecificationFrom(Method)
ToolSpecifications has a toolSpecificationFrom method
Holds
Read Oct 3
ToolSpecification can be serialized to JSON and deserialized back using toJson() and fromJson() methods.
2 rules from this sentence
ToolSpecification has a toJson method
Holds
ToolSpecification has a fromJson method
Holds
Read Oct 3
You can provide your own implementation of ToolSpecificationJsonCodec via SPI by implementing ToolSpecificationJsonCodecFactory and registering it in META-INF/services/dev.langchain4j.spi.agent.tool.ToolSpecificationJsonCodecFactory.
2 rules from this sentence
ToolSpecificationJsonCodec is a contract
Holds
ToolSpecificationJsonCodecFactory is a contract
Holds
Read Oct 3
If the LLM decides to call the tool, the returned AiMessage will contain data in the toolExecutionRequests field.
AiMessage has a toolExecutionRequests field
Holds
Read Oct 3
In this case, AiMessage.hasToolExecutionRequests() will return true. Depending on the LLM, it can contain one or multiple ToolExecutionRequest objects (some LLMs support calling multiple tools in parallel).
AiMessage depends on ToolExecutionRequest
Holds
Read Oct 3
In this case, AiMessage.hasToolExecutionRequests() will return true.
AiMessage has a hasToolExecutionRequests method
Holds
Read Oct 3
The name of the tool to be called, for example:
ToolExecutionRequest has name
Holds
Read Oct 3
The arguments, for example: { "city": "London", "temperatureUnit": "CELSIUS" }
ToolExecutionRequest has arguments
Holds
Read Oct 3
Instead of using text(), you can use the builder with contents():
ToolExecutionResultMessage has a text method
Holds
Read Oct 3
If the LLM initiates multiple tool calls, the index will increment, allowing you to correlate the different PartialToolCalls with each other and with the final CompleteToolCall.
2 rules from this sentence
PartialToolCall has index
Holds
CompleteToolCall has index
Holds
Read Oct 3
The ToolProvider accepts a ToolProviderRequest (that contains the UserMessage, chat memory ID and InvocationParameters) and returns a ToolProviderResult that contains tools for the current AI Service invocation.
2 rules from this sentence
ToolProvider depends on ToolProviderRequest
Holds
ToolProvider depends on ToolProviderResult
Holds
Read Oct 3
When building ToolProviderResult, you can mark tools for immediate return using ToolProviderResult.builder().
ToolProviderResult has a builder method
Holds
Read Oct 3
Tool search is implemented via the ToolSearchStrategy interface:
ToolSearchStrategy is a contract
Holds
Read Oct 3
SimpleToolSearchStrategy – keyword-based matching
SimpleToolSearchStrategy implements ToolSearchStrategy
Holds
Read Oct 3
VectorToolSearchStrategy – semantic search using embeddings
VectorToolSearchStrategy implements ToolSearchStrategy
Holds
Read Oct 3
DecisionModelToolSearchStrategy – a decision model decides which tools match the search
DecisionModelToolSearchStrategy implements ToolSearchStrategy
Holds
Read Oct 3
When using MCP tools (via McpToolProvider), always-visible tools can be configured via alwaysVisibleToolNames:
McpToolProvider has alwaysVisibleToolNames
Holds
Read Oct 3
This can be done by configuring the returnBehavior field of the @Tool annotation as in the following example:
Tool has a returnBehavior field
Holds
Read Oct 3
ReturnBehavior.IMMEDIATE_IF_LAST is meant for tools the LLM uses to explicitly signal the end of a multi-step action — for example, an endExecutionAndGetFinalResult tool the LLM appendsafter a sequence of clicks, navigations, etc.
ReturnBehavior has IMMEDIATE_IF_LAST
Holds
Read Oct 3
a response made up only of IMMEDIATE and/or IMMEDIATE_IF_LAST tools returns immediately regardless of which one is last (still subject to the no-errors rule).
ReturnBehavior has IMMEDIATE
Holds
Read Oct 3
Handler ToolArgumentsErrorHandler.sendExceptionMessageToLlm(), What happens when a tool fails The message of the error is sent to the LLM, so that it can correct the arguments and try again The AI Service invocation continues ⚠️ See the warning below
ToolArgumentsErrorHandler has a sendExceptionMessageToLlm method
Holds
Read Oct 3
Handler ToolArgumentsErrorHandler.failInvocation(), What happens when a tool fails The error is rethrown the AI Service invocation fails and nothing is sent to the LLM
ToolArgumentsErrorHandler has a failInvocation method
Holds
Read Oct 3
Handler ToolExecutionErrorHandler.sendExceptionMessageToLlm(), What happens when a tool fails The message of the exception thrown by the tool is sent to the LLM (or the text from messageForLlm() , if the exception implements ToolErrorVisibleToLlm ), so that it can react to it The AI Service invocation continues ⚠️ See the warning below
ToolExecutionErrorHandler has a sendExceptionMessageToLlm method
Holds
Read Oct 3
Handler ToolExecutionErrorHandler.failInvocationUnlessVisibleToLlm(), What happens when a tool fails Only exceptions implementing ToolErrorVisibleToLlm are shown to the LLM, using the text they provide Every other exception fails the AI Service invocation See Deciding per exception what the LLM sees
ToolExecutionErrorHandler has a failInvocationUnlessVisibleToLlm method
Holds
Read Oct 3
Handler ToolExecutionErrorHandler.sendGenericMessageToLlmUnlessVisibleToLlm(String), What happens when a tool fails Exceptions implementing ToolErrorVisibleToLlm are shown to the LLM, using the text they provide For every other exception, the given generic message is sent to the LLM, and the exception is logged at WARN level The AI Service invocation continues
ToolExecutionErrorHandler has a sendGenericMessageToLlmUnlessVisibleToLlm method
Holds
Read Oct 3
Handler ToolExecutionErrorHandler.failInvocation(), What happens when a tool fails The exception is rethrown the AI Service invocation fails and nothing is sent to the LLM
ToolExecutionErrorHandler has a failInvocation method
Holds
Read Oct 3
Each ToolExecutionRequest should contain: The id of the tool call.
ToolExecutionRequest has id
Holds
Read Oct 3
The tools that LangChain4j provides, such as skills, tool search and MCP tools, report the errors the LLM can do something about (for example, a missing argument or an unknown skill name) with LlmVisibleToolExecutionException, which implements ToolErrorVisibleToLlm, so the LLM keeps seeing them with this handler too.
LlmVisibleToolExecutionException implements ToolErrorVisibleToLlm
Holds
345 rules from 17 docs

See these where the change is. The browser extension puts a pull request's doc findings, and a diagram of what it changed, on the GitHub page itself, so the code and what your docs say about it are side by side.