All Classes and Interfaces
Class
Description
CDI bean willing to manipulate the response of the AI model needs to implement this interface.
Enum representing various events that can occur in an AI service.
An adapter class for implementing the 
AiServiceListener interface to CDI event firing.Provides the basic building blocks that the generated Interface methods call
 into
Annotation used to select a particular AiService interface.
A concrete implementation of 
AiServiceSelector and AnnotationLiteral, used to provide
 a runtime version of the AiServiceSelector annotation.Builder class for constructing instances of 
AiServiceSelector.This annotation is useful when an AiService is meant to describe an audio as the value of the method parameter annotated
 with @AudioUrl
 will be used as an 
AudioContent.Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Base class for chat-related events that occur during AI service interactions.
Event emitted when partial responses have been accumulated into a larget message.
Event emitted when a tool is about to be executed during a chat conversation.
Event emitted when a chat conversation has been completed.
Enumeration of possible chat event types.
Event emitted when content has been fetched from a retrieval-augmented
 generation (RAG) source.
Event emitted when a partial response chunk is received during streaming.
Event emitted when a partial thinking/reasoning chunk is received during streaming.
Event emitted when a tool has been executed during a chat conversation.
Interface implemented by each AiService that allows the removal of chat memories from an AiService
Allows the application to manually control when a 
ChatMemory should be removed from the underlying
 ChatMemoryStore.Provides a way for an AiService to get its chat memory seeded.
Contributes custom attributes, events or other data to the spans created by 
SpanChatModelListener.Adds the prompt as a span attribute if so configured by the user
Allows for user code to provide a custom strategy for estimating the cost of API calls
Meant to be injected where 
ChatModelListener
 is used in order to determine the cost of the API requestUsed to make Quarkus aware of classes being used in 
AiServices.create(java.lang.Class<T>, dev.langchain4j.model.chat.ChatModel)Often LLMs return a date as a JSON object containing the date's constituents
Often LLMs return a datetime as a JSON object containing the datetime's constituents
Often LLMs return a time as a JSON object containing the time's constituents
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
Use 
GuardrailException insteadDeprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
This annotation is useful when an AiService is meant to describe an image as the value of the method parameter annotated
 with @ImageUrl
 will be used as an 
ImageContent.Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Creates the default 
InMemoryChatMemoryStore store to be used by classes annotated with RegisterAiServiceDeprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Creates metrics that follow the
 Semantic Conventions
 for GenAI Metrics
Model authentication providers can be used to supply credentials such as access tokens, API keys, and other type of
 credentials.
Marker annotation to select a named model
 Configure the 
name parameter to select the model instance.This is needed for output guardrails on a method returning Multi.
An implementation of 
ChatMemory that does nothing.An annotation to configure token accumulation when output guardrails are applied on streamed responses.
Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Interface to accumulate tokens when output guardrails are applied on streamed responses.
This annotation is useful when an AiService is meant to describe an image as the value of the method parameter annotated
 with @PdfUrl
 will be used as an 
PdfFileContent.Adds the prompt as a span attribute if so configured by the user
A 
StreamingResponseHandler implementation for Quarkus.An implementation of token stream for Quarkus.
Used to create LangChain4j's 
AiServices in a declarative manner that the application can then use simply by
 using the class as a CDI bean.Marker that is used to tell Quarkus to use the 
 that has been configured as a CDI bean by
 any of the extensions providing such capability (such as 
invalid reference
ChatLanguageModelquarkus-langchain4j-openai and
 quarkus-langchain4j-hugging-face).Marker that is used to tell Quarkus to use the retriever that the user has configured as a CDI bean.
Marker that is used to tell Quarkus to use the 
ImageModel that the user has configured as a CDI bean.Marker that is used to tell Quarkus to use the 
ModerationModel that the user has configured as a CDI bean.Marker that is used to tell Quarkus to use the 
RetrievalAugmentor that the user has configured as a CDI bean.Marker that is used to tell Quarkus to use the ToolHallucinationStrategy that the user has configured as a CDI bean.
Marker that is used to tell Quarkus to use the 
ToolProvider that the user has configured as a CDI bean.Marker that is used to tell Quarkus to use the 
 that has been configured as a CDI bean
 by * any of the extensions providing such capability (such as 
invalid reference
StreamingChatLanguageModelquarkus-langchain4j-openai and
 quarkus-langchain4j-hugging-face).Marker that is used when the user does not want any memory configured for the AiService
Marker that is used to tell Quarkus to not use any retrieval augmentor even if a CDI bean implementing
 the `RetrievalAugmentor` interface exists.
Marker class to indicate that no retriever should be used
Marker that is used when the user does not want any tool provider
This implementation uses the state of the request scope as the default value
An annotation to configure a response augmenter.
Represents the parameter passed to 
AiResponseAugmenter methods.Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability
Provides a way for an AiService to get its chat memory seeded with examples interactions.
Creates a span that follows the
 Semantic Conventions
 for GenAI operations
When used on a method of an AiService annotated with 
RegisterAiService, the method will the tool classes provided by
 value
 instead of the ones configured for the entire AiService (via RegisterAiService.tools())Deprecated, for removal: This API element is subject to removal in a future version.
In favor of https://docs.langchain4j.dev/tutorials/observability#ai-service-observability