Index

A B C D E F G H I J K L M N O P Q R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

A

ABSOLUTE_DIRECTORY_PATH - Static variable in class dev.langchain4j.data.document.Document
Common metadata key for the absolute path of the directory from which the document was loaded.
add(Embedding) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Adds a given embedding to the store.
add(Embedding, Embedded) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Adds a given embedding and the corresponding content that has been embedded to the store.
add(ChatMessage) - Method in interface dev.langchain4j.memory.ChatMemory
Adds a message to the chat memory.
add(TokenUsage) - Method in class dev.langchain4j.model.output.TokenUsage
Adds the token usage of two responses together.
add(String, Embedding) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Adds a given embedding to the store.
add(String, Object) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.
add(String, String) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.
addAll(List<Embedding>) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Adds multiple embeddings to the store.
addAll(List<Embedding>, List<Embedded>) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Adds multiple embeddings and their corresponding contents that have been embedded to the store.
addOptionalParameter(String, JsonSchemaProperty...) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Adds an optional parameter to the tool.
addOptionalParameter(String, Iterable<JsonSchemaProperty>) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Adds an optional parameter to the tool.
addParameter(String, JsonSchemaProperty...) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Adds a parameter to the tool.
addParameter(String, Iterable<JsonSchemaProperty>) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Adds a parameter to the tool.
aggregate(Map<Query, Collection<List<Content>>>) - Method in interface dev.langchain4j.rag.content.aggregator.ContentAggregator
Aggregates all Contents retrieved by all ContentRetrievers using all Querys.
aggregate(Map<Query, Collection<List<Content>>>) - Method in class dev.langchain4j.rag.content.aggregator.DefaultContentAggregator
 
aggregate(Map<Query, Collection<List<Content>>>) - Method in class dev.langchain4j.rag.content.aggregator.ReRankingContentAggregator
 
AI - Enum constant in enum dev.langchain4j.data.message.ChatMessageType
A message from the AI.
aiMessage(ToolExecutionRequest...) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
aiMessage(String) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given text.
aiMessage(List<ToolExecutionRequest>) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
AiMessage - Class in dev.langchain4j.data.message
Represents a response message from an AI (language model).
AiMessage(String) - Constructor for class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given text.
AiMessage(List<ToolExecutionRequest>) - Constructor for class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
and(Filter) - Method in interface dev.langchain4j.store.embedding.filter.Filter
 
and(Filter, Filter) - Static method in interface dev.langchain4j.store.embedding.filter.Filter
 
And - Class in dev.langchain4j.store.embedding.filter.logical
 
And(Filter, Filter) - Constructor for class dev.langchain4j.store.embedding.filter.logical.And
 
apply(Object) - Method in class dev.langchain4j.model.input.PromptTemplate
Applies a value to a template containing a single variable.
apply(Map<String, Object>) - Method in class dev.langchain4j.model.input.PromptTemplate
Applies multiple values to a template containing multiple variables.
areNotNullOrBlank(String...) - Static method in class dev.langchain4j.internal.Utils
Are all the given strings not null and not blank?
argument(ToolExecutionRequest, String) - Static method in class dev.langchain4j.agent.tool.ToolExecutionRequestUtil
Get an argument value from ToolExecutionRequest.
arguments() - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest
Returns the arguments of the tool.
arguments(String) - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest.Builder
Sets the arguments.
argumentsAsMap(String) - Static method in class dev.langchain4j.agent.tool.ToolExecutionRequestUtil
Convert arguments to map.
ARRAY - Static variable in class dev.langchain4j.agent.tool.JsonSchemaProperty
A property with key "type" and value "array".
asMap() - Method in class dev.langchain4j.data.document.Metadata
Get a copy of the metadata as a map of key-value pairs.
augment(UserMessage, Metadata) - Method in class dev.langchain4j.rag.DefaultRetrievalAugmentor
 
augment(UserMessage, Metadata) - Method in interface dev.langchain4j.rag.RetrievalAugmentor
Augments the provided UserMessage with retrieved content.
AUTO - Enum constant in enum dev.langchain4j.data.message.ImageContent.DetailLevel
Auto detail.

B

backoffExp(double) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy.Builder
Sets the backoff exponent.
base64Data() - Method in class dev.langchain4j.data.image.Image
Get the base64 data of the image.
base64Data(String) - Method in class dev.langchain4j.data.image.Image.Builder
Set the base64 data of the image.
between(Embedding, Embedding) - Static method in class dev.langchain4j.store.embedding.CosineSimilarity
Calculates cosine similarity between two vectors.
BOOLEAN - Static variable in class dev.langchain4j.agent.tool.JsonSchemaProperty
A property with key "type" and value "boolean".
build() - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest.Builder
Returns a ToolExecutionRequest built from the parameters previously set.
build() - Method in class dev.langchain4j.agent.tool.ToolParameters.Builder
Returns a ToolParameters built from the parameters previously set.
build() - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Returns a ToolSpecification built from the parameters previously set.
build() - Method in class dev.langchain4j.data.image.Image.Builder
Build the Image.
build() - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy.Builder
Builds a RetryPolicy.
build() - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Builds the EmbeddingStoreIngestor.
builder() - Static method in class dev.langchain4j.agent.tool.ToolExecutionRequest
Creates builder to build ToolExecutionRequest.
builder() - Static method in class dev.langchain4j.agent.tool.ToolParameters
ToolParameters builder static inner class.
builder() - Static method in class dev.langchain4j.agent.tool.ToolSpecification
Creates builder to build ToolSpecification.
builder() - Static method in class dev.langchain4j.data.image.Image
Create a new Image.Builder.
builder() - Static method in class dev.langchain4j.rag.DefaultRetrievalAugmentor
 
builder() - Static method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor
Creates a new EmbeddingStoreIngestor builder.
Builder() - Constructor for class dev.langchain4j.data.image.Image.Builder
Create a new Image.Builder.
Builder() - Constructor for class dev.langchain4j.internal.RetryUtils.RetryPolicy.Builder
Construct a RetryPolicy.Builder.
Builder() - Constructor for class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Creates a new EmbeddingStoreIngestor builder.

C

Chain<Input,Output> - Interface in dev.langchain4j.chain
Represents a chain step that takes an input and produces an output.
chatLanguageModel - Variable in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
chatLanguageModel - Variable in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
chatLanguageModel - Variable in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
ChatLanguageModel - Interface in dev.langchain4j.model.chat
Represents a language model that has a chat interface.
chatMemory() - Method in class dev.langchain4j.rag.query.Metadata
 
ChatMemory - Interface in dev.langchain4j.memory
Represents the memory (history) of a chat conversation.
chatMemoryId() - Method in class dev.langchain4j.rag.query.Metadata
 
ChatMemoryStore - Interface in dev.langchain4j.store.memory.chat
Represents a store for the ChatMemory state.
ChatMessage - Interface in dev.langchain4j.data.message
A chat message.
ChatMessageDeserializer - Class in dev.langchain4j.data.message
A deserializer for ChatMessage objects.
ChatMessageJsonCodec - Interface in dev.langchain4j.data.message
A codec for serializing and deserializing ChatMessage objects to and from JSON.
ChatMessageJsonCodecFactory - Interface in dev.langchain4j.spi.data.message
A factory for creating ChatMessageJsonCodec objects.
ChatMessageSerializer - Class in dev.langchain4j.data.message
 
ChatMessageSerializer() - Constructor for class dev.langchain4j.data.message.ChatMessageSerializer
 
ChatMessageType - Enum in dev.langchain4j.data.message
The type of content, e.g.
classify(Document) - Method in interface dev.langchain4j.classification.TextClassifier
Classify the given Document.
classify(TextSegment) - Method in interface dev.langchain4j.classification.TextClassifier
Classify the given TextSegment.
classify(String) - Method in interface dev.langchain4j.classification.TextClassifier
Classify the given text.
clear() - Method in interface dev.langchain4j.memory.ChatMemory
Clears the chat memory.
CodeExecutionEngine - Interface in dev.langchain4j.code
Interface for executing code.
comparisonValue() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsEqualTo
 
comparisonValue() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThan
 
comparisonValue() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThanOrEqualTo
 
comparisonValue() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsLessThan
 
comparisonValue() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsLessThanOrEqualTo
 
comparisonValue() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsNotEqualTo
 
comparisonValues() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsIn
 
comparisonValues() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsNotIn
 
CompressingQueryTransformer - Class in dev.langchain4j.rag.query.transformer
A QueryTransformer that leverages a ChatLanguageModel to condense a given Query along with a chat memory (previous conversation history) into a concise Query.
CompressingQueryTransformer(ChatLanguageModel) - Constructor for class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
CompressingQueryTransformer(ChatLanguageModel, PromptTemplate) - Constructor for class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
containsKey(String) - Method in class dev.langchain4j.data.document.Metadata
Check whether this Metadata contains a given key.
content() - Method in class dev.langchain4j.model.output.Response
Get the content.
Content - Class in dev.langchain4j.rag.content
Represents content relevant to a user Query with the potential to enhance and ground the LLM's response.
Content - Interface in dev.langchain4j.data.message
Abstract base interface for message content.
Content(TextSegment) - Constructor for class dev.langchain4j.rag.content.Content
 
Content(String) - Constructor for class dev.langchain4j.rag.content.Content
 
CONTENT_FILTER - Enum constant in enum dev.langchain4j.model.output.FinishReason
The call finished signalling a need for content filtering.
ContentAggregator - Interface in dev.langchain4j.rag.content.aggregator
Aggregates all Contents retrieved from all ContentRetrievers using all Querys.
ContentInjector - Interface in dev.langchain4j.rag.content.injector
Injects given Contents into a given UserMessage.
contentRetriever(ContentRetriever) - Method in class dev.langchain4j.rag.DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder
 
ContentRetriever - Interface in dev.langchain4j.rag.content.retriever
Retrieves Contents from an underlying data source using a given Query.
contents() - Method in class dev.langchain4j.data.message.UserMessage
The contents of the message.
ContentType - Enum in dev.langchain4j.data.message
The type of content, e.g.
copy() - Method in class dev.langchain4j.data.document.Metadata
Copies the metadata.
copyIfNotNull(List<T>) - Static method in class dev.langchain4j.internal.Utils
Returns an (unmodifiable) copy of the provided list.
CosineSimilarity - Class in dev.langchain4j.store.embedding
Utility class for calculating cosine similarity between two vectors.
create() - Method in interface dev.langchain4j.spi.data.message.ChatMessageJsonCodecFactory
Creates a new ChatMessageJsonCodec object.
create() - Method in interface dev.langchain4j.spi.json.JsonCodecFactory
Create a new Json.JsonCodec.
create(PromptTemplateFactory.Input) - Method in interface dev.langchain4j.spi.prompt.PromptTemplateFactory
Create a new prompt template.
createPrompt(UserMessage, List<Content>) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
createPrompt(Query) - Method in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
createPrompt(Query) - Method in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
createPrompt(Query, String) - Method in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 

D

DEFAULT_FILTER - Static variable in class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever
 
DEFAULT_MAX_RESULTS - Static variable in class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever
 
DEFAULT_MIN_SCORE - Static variable in class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever
 
DEFAULT_N - Static variable in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
DEFAULT_PROMPT_TEMPLATE - Static variable in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
DEFAULT_PROMPT_TEMPLATE - Static variable in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
DEFAULT_PROMPT_TEMPLATE - Static variable in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
DEFAULT_PROMPT_TEMPLATE - Static variable in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
DEFAULT_QUERY_SELECTOR - Static variable in class dev.langchain4j.rag.content.aggregator.ReRankingContentAggregator
 
DEFAULT_RETRY_POLICY - Static variable in class dev.langchain4j.internal.RetryUtils
Default retry policy used by RetryUtils.withRetry(Callable).
DefaultContentAggregator - Class in dev.langchain4j.rag.content.aggregator
Default implementation of ContentAggregator intended to be suitable for the majority of use cases.
DefaultContentAggregator() - Constructor for class dev.langchain4j.rag.content.aggregator.DefaultContentAggregator
 
DefaultContentInjector - Class in dev.langchain4j.rag.content.injector
Default implementation of ContentInjector intended to be suitable for the majority of use cases.
DefaultContentInjector() - Constructor for class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
DefaultContentInjector(PromptTemplate) - Constructor for class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
DefaultContentInjector(PromptTemplate, List<String>) - Constructor for class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
DefaultContentInjector(List<String>) - Constructor for class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
DefaultQueryRouter - Class in dev.langchain4j.rag.query.router
Default implementation of QueryRouter intended to be suitable for the majority of use cases.
DefaultQueryRouter(ContentRetriever...) - Constructor for class dev.langchain4j.rag.query.router.DefaultQueryRouter
 
DefaultQueryRouter(Collection<ContentRetriever>) - Constructor for class dev.langchain4j.rag.query.router.DefaultQueryRouter
 
DefaultQueryTransformer - Class in dev.langchain4j.rag.query.transformer
Default implementation of QueryTransformer intended to be suitable for the majority of use cases.
DefaultQueryTransformer() - Constructor for class dev.langchain4j.rag.query.transformer.DefaultQueryTransformer
 
DefaultRetrievalAugmentor - Class in dev.langchain4j.rag
The default implementation of RetrievalAugmentor intended to be suitable for the majority of use cases.
DefaultRetrievalAugmentor(QueryTransformer, QueryRouter, ContentAggregator, ContentInjector, Executor) - Constructor for class dev.langchain4j.rag.DefaultRetrievalAugmentor
 
DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder - Class in dev.langchain4j.rag
 
DefaultRetrievalAugmentorBuilder() - Constructor for class dev.langchain4j.rag.DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder
 
DefaultStructuredPromptFactory - Class in dev.langchain4j.model.input.structured
Default implementation of StructuredPromptFactory.
DefaultStructuredPromptFactory() - Constructor for class dev.langchain4j.model.input.structured.DefaultStructuredPromptFactory
Create a default structured prompt factory.
delayMillis(int) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy.Builder
Sets the base delay in milliseconds.
deleteMessages(Object) - Method in interface dev.langchain4j.store.memory.chat.ChatMemoryStore
Deletes all messages for a specified chat memory.
deleteMessages(Object) - Method in class dev.langchain4j.store.memory.chat.InMemoryChatMemoryStore
 
delimiter() - Element in annotation type dev.langchain4j.model.input.structured.StructuredPrompt
The delimiter to join the lines of the prompt template.
description() - Method in class dev.langchain4j.agent.tool.ToolSpecification
Returns the description of the tool.
description(String) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "description" and value.
description(String) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Sets the description.
Description - Annotation Type in dev.langchain4j.model.output.structured
Annotation to attach a description to a class field.
detailLevel() - Method in class dev.langchain4j.data.message.ImageContent
Get the DetailLevel.
dev.langchain4j - package dev.langchain4j
 
dev.langchain4j.agent.tool - package dev.langchain4j.agent.tool
 
dev.langchain4j.chain - package dev.langchain4j.chain
 
dev.langchain4j.classification - package dev.langchain4j.classification
 
dev.langchain4j.code - package dev.langchain4j.code
 
dev.langchain4j.data.document - package dev.langchain4j.data.document
 
dev.langchain4j.data.embedding - package dev.langchain4j.data.embedding
 
dev.langchain4j.data.image - package dev.langchain4j.data.image
 
dev.langchain4j.data.message - package dev.langchain4j.data.message
 
dev.langchain4j.data.segment - package dev.langchain4j.data.segment
 
dev.langchain4j.internal - package dev.langchain4j.internal
 
dev.langchain4j.memory - package dev.langchain4j.memory
 
dev.langchain4j.model - package dev.langchain4j.model
 
dev.langchain4j.model.chat - package dev.langchain4j.model.chat
 
dev.langchain4j.model.embedding - package dev.langchain4j.model.embedding
 
dev.langchain4j.model.image - package dev.langchain4j.model.image
 
dev.langchain4j.model.input - package dev.langchain4j.model.input
 
dev.langchain4j.model.input.structured - package dev.langchain4j.model.input.structured
 
dev.langchain4j.model.language - package dev.langchain4j.model.language
 
dev.langchain4j.model.moderation - package dev.langchain4j.model.moderation
 
dev.langchain4j.model.output - package dev.langchain4j.model.output
 
dev.langchain4j.model.output.structured - package dev.langchain4j.model.output.structured
 
dev.langchain4j.model.scoring - package dev.langchain4j.model.scoring
 
dev.langchain4j.rag - package dev.langchain4j.rag
 
dev.langchain4j.rag.content - package dev.langchain4j.rag.content
 
dev.langchain4j.rag.content.aggregator - package dev.langchain4j.rag.content.aggregator
 
dev.langchain4j.rag.content.injector - package dev.langchain4j.rag.content.injector
 
dev.langchain4j.rag.content.retriever - package dev.langchain4j.rag.content.retriever
 
dev.langchain4j.rag.query - package dev.langchain4j.rag.query
 
dev.langchain4j.rag.query.router - package dev.langchain4j.rag.query.router
 
dev.langchain4j.rag.query.transformer - package dev.langchain4j.rag.query.transformer
 
dev.langchain4j.retriever - package dev.langchain4j.retriever
 
dev.langchain4j.spi - package dev.langchain4j.spi
 
dev.langchain4j.spi.data.message - package dev.langchain4j.spi.data.message
 
dev.langchain4j.spi.json - package dev.langchain4j.spi.json
 
dev.langchain4j.spi.prompt - package dev.langchain4j.spi.prompt
 
dev.langchain4j.spi.prompt.structured - package dev.langchain4j.spi.prompt.structured
 
dev.langchain4j.store.embedding - package dev.langchain4j.store.embedding
 
dev.langchain4j.store.embedding.filter - package dev.langchain4j.store.embedding.filter
 
dev.langchain4j.store.embedding.filter.comparison - package dev.langchain4j.store.embedding.filter.comparison
 
dev.langchain4j.store.embedding.filter.logical - package dev.langchain4j.store.embedding.filter.logical
 
dev.langchain4j.store.memory.chat - package dev.langchain4j.store.memory.chat
 
dimension() - Method in class dev.langchain4j.data.embedding.Embedding
Returns the dimension of the vector.
DisabledChatLanguageModel - Class in dev.langchain4j.model.chat
A ChatLanguageModel which throws a ModelDisabledException for all of its methods
DisabledChatLanguageModel() - Constructor for class dev.langchain4j.model.chat.DisabledChatLanguageModel
 
DisabledEmbeddingModel - Class in dev.langchain4j.model.embedding
An EmbeddingModel which throws a ModelDisabledException for all of its methods
DisabledEmbeddingModel() - Constructor for class dev.langchain4j.model.embedding.DisabledEmbeddingModel
 
DisabledImageModel - Class in dev.langchain4j.model.image
An ImageModel which throws a ModelDisabledException for all of its methods
DisabledImageModel() - Constructor for class dev.langchain4j.model.image.DisabledImageModel
 
DisabledLanguageModel - Class in dev.langchain4j.model.language
A LanguageModel which throws a ModelDisabledException for all of its methods
DisabledLanguageModel() - Constructor for class dev.langchain4j.model.language.DisabledLanguageModel
 
DisabledModerationModel - Class in dev.langchain4j.model.moderation
A ModerationModel which throws a ModelDisabledException for all of its methods
DisabledModerationModel() - Constructor for class dev.langchain4j.model.moderation.DisabledModerationModel
 
DisabledStreamingChatLanguageModel - Class in dev.langchain4j.model.chat
A StreamingChatLanguageModel which throws a ModelDisabledException for all of its methods
DisabledStreamingChatLanguageModel() - Constructor for class dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel
 
DisabledStreamingLanguageModel - Class in dev.langchain4j.model.language
A StreamingLanguageModel which throws a ModelDisabledException for all of its methods
DisabledStreamingLanguageModel() - Constructor for class dev.langchain4j.model.language.DisabledStreamingLanguageModel
 
DO_NOT_ROUTE - Enum constant in enum dev.langchain4j.rag.query.router.LanguageModelQueryRouter.FallbackStrategy
In this case, the Query will not be routed to any ContentRetriever, thus skipping the RAG flow.
document(String) - Static method in class dev.langchain4j.data.document.Document
Creates a new Document from the given text.
document(String, Metadata) - Static method in class dev.langchain4j.data.document.Document
Creates a new Document from the given text.
Document - Class in dev.langchain4j.data.document
Represents an unstructured piece of text that usually corresponds to a content of a single file.
Document(String) - Constructor for class dev.langchain4j.data.document.Document
Creates a new Document from the given text.
Document(String, Metadata) - Constructor for class dev.langchain4j.data.document.Document
Creates a new Document from the given text.
DocumentLoader - Class in dev.langchain4j.data.document
Utility class for loading documents.
DocumentParser - Interface in dev.langchain4j.data.document
Defines the interface for parsing an InputStream into a Document.
DocumentSource - Interface in dev.langchain4j.data.document
Defines the interface for a Document source.
documentSplitter(DocumentSplitter) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the document splitter.
DocumentSplitter - Interface in dev.langchain4j.data.document
Defines the interface for splitting a document into text segments.
documentTransformer(DocumentTransformer) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the document transformer.
DocumentTransformer - Interface in dev.langchain4j.data.document
Defines the interface for transforming a Document.

E

edit(Image, Image, String) - Method in class dev.langchain4j.model.image.DisabledImageModel
 
edit(Image, Image, String) - Method in interface dev.langchain4j.model.image.ImageModel
Given an existing image, edit this image following the given prompt and apply the changes only to the part of the image specified by the given mask.
edit(Image, String) - Method in class dev.langchain4j.model.image.DisabledImageModel
 
edit(Image, String) - Method in interface dev.langchain4j.model.image.ImageModel
Given an existing image, edit this image following the given prompt.
embed(TextSegment) - Method in class dev.langchain4j.model.embedding.DisabledEmbeddingModel
 
embed(TextSegment) - Method in interface dev.langchain4j.model.embedding.EmbeddingModel
Embed the text content of a TextSegment.
embed(String) - Method in class dev.langchain4j.model.embedding.DisabledEmbeddingModel
 
embed(String) - Method in interface dev.langchain4j.model.embedding.EmbeddingModel
Embed a text.
embedAll(List<TextSegment>) - Method in class dev.langchain4j.model.embedding.DisabledEmbeddingModel
 
embedAll(List<TextSegment>) - Method in interface dev.langchain4j.model.embedding.EmbeddingModel
Embeds the text content of a list of TextSegments.
embedded() - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
Returns the original content that was embedded.
embedding() - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
Returns the embedding that has been matched.
Embedding - Class in dev.langchain4j.data.embedding
Represents a dense vector embedding of a text.
Embedding(float[]) - Constructor for class dev.langchain4j.data.embedding.Embedding
Creates a new Embedding.
embeddingId() - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
The ID of the embedding assigned when adding this embedding to the store.
EmbeddingMatch<Embedded> - Class in dev.langchain4j.store.embedding
Represents a matched embedding along with its relevance score (derivative of cosine distance), ID, and original embedded content.
EmbeddingMatch(Double, String, Embedding, Embedded) - Constructor for class dev.langchain4j.store.embedding.EmbeddingMatch
Creates a new instance.
embeddingModel(EmbeddingModel) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the embedding model.
EmbeddingModel - Interface in dev.langchain4j.model.embedding
Represents a model that can convert a given text into an embedding (vector representation of the text).
EmbeddingSearchRequest - Class in dev.langchain4j.store.embedding
Represents a request to search in an EmbeddingStore.
EmbeddingSearchRequest(Embedding, Integer, Double, Filter) - Constructor for class dev.langchain4j.store.embedding.EmbeddingSearchRequest
Creates an instance of an EmbeddingSearchRequest.
EmbeddingSearchResult<Embedded> - Class in dev.langchain4j.store.embedding
Represents a result of a search in an EmbeddingStore.
EmbeddingSearchResult(List<EmbeddingMatch<Embedded>>) - Constructor for class dev.langchain4j.store.embedding.EmbeddingSearchResult
 
embeddingStore(EmbeddingStore<TextSegment>) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the embedding store.
EmbeddingStore<Embedded> - Interface in dev.langchain4j.store.embedding
Represents a store for embeddings, also known as a vector database.
EmbeddingStoreContentRetriever - Class in dev.langchain4j.rag.content.retriever
A ContentRetriever that retrieves from an EmbeddingStore.
EmbeddingStoreContentRetriever(EmbeddingStore<TextSegment>, EmbeddingModel) - Constructor for class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever
 
EmbeddingStoreContentRetriever(EmbeddingStore<TextSegment>, EmbeddingModel, int) - Constructor for class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever
 
EmbeddingStoreContentRetriever(EmbeddingStore<TextSegment>, EmbeddingModel, Integer, Double) - Constructor for class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever
 
EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder - Class in dev.langchain4j.rag.content.retriever
 
EmbeddingStoreContentRetrieverBuilder() - Constructor for class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder
 
EmbeddingStoreIngestor - Class in dev.langchain4j.store.embedding
EmbeddingStoreIngestor is responsible for the ingestion of documents into an embedding store.
EmbeddingStoreIngestor(DocumentTransformer, DocumentSplitter, TextSegmentTransformer, EmbeddingModel, EmbeddingStore<TextSegment>) - Constructor for class dev.langchain4j.store.embedding.EmbeddingStoreIngestor
Creates a new EmbeddingStoreIngestor.
EmbeddingStoreIngestor.Builder - Class in dev.langchain4j.store.embedding
EmbeddingStoreIngestor builder.
ensureBetween(Double, double, double, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given Double value is in [min, max].
ensureBetween(Integer, int, int, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given Integer value is in [min, max].
ensureBetween(Long, long, long, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given Long value is in [min, max].
ensureEq(Object, Object, String, Object...) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensure that the two values are equal.
ensureGreaterThanZero(Integer, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given expression is true.
ensureNotBlank(String, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given string is not null and not blank.
ensureNotEmpty(Map<K, V>, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given map is not null and not empty.
ensureNotEmpty(T, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given collection is not null and not empty.
ensureNotNull(T, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given object is not null.
ensureNotNull(T, String, Object...) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given object is not null.
ensureTrue(boolean, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given expression is true.
enums(Class<?>) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "enum" and all enum values taken from enumClass.
enums(Object...) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "enum" and value enumValues.
enums(String...) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "enum" and value enumValues.
EPSILON - Static variable in class dev.langchain4j.store.embedding.CosineSimilarity
A small value to avoid division by zero.
equals(Object) - Method in class dev.langchain4j.agent.tool.JsonSchemaProperty
 
equals(Object) - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest
 
equals(Object) - Method in class dev.langchain4j.agent.tool.ToolParameters
 
equals(Object) - Method in class dev.langchain4j.agent.tool.ToolSpecification
 
equals(Object) - Method in class dev.langchain4j.data.document.Document
 
equals(Object) - Method in class dev.langchain4j.data.document.Metadata
 
equals(Object) - Method in class dev.langchain4j.data.embedding.Embedding
 
equals(Object) - Method in class dev.langchain4j.data.image.Image
 
equals(Object) - Method in class dev.langchain4j.data.message.AiMessage
 
equals(Object) - Method in class dev.langchain4j.data.message.ImageContent
 
equals(Object) - Method in class dev.langchain4j.data.message.SystemMessage
 
equals(Object) - Method in class dev.langchain4j.data.message.TextContent
 
equals(Object) - Method in class dev.langchain4j.data.message.ToolExecutionResultMessage
 
equals(Object) - Method in class dev.langchain4j.data.message.UserMessage
 
equals(Object) - Method in class dev.langchain4j.data.segment.TextSegment
 
equals(Object) - Method in class dev.langchain4j.model.input.Prompt
 
equals(Object) - Method in class dev.langchain4j.model.moderation.Moderation
 
equals(Object) - Method in class dev.langchain4j.model.output.Response
 
equals(Object) - Method in class dev.langchain4j.model.output.TokenUsage
 
equals(Object) - Method in class dev.langchain4j.rag.content.Content
 
equals(Object) - Method in class dev.langchain4j.rag.query.Metadata
 
equals(Object) - Method in class dev.langchain4j.rag.query.Query
 
equals(Object) - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
 
estimateTokenCount(UserMessage) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified message.
estimateTokenCount(TextSegment) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified text segment.
estimateTokenCount(TextSegment) - Method in interface dev.langchain4j.model.embedding.TokenCountEstimator
Estimates the count of tokens in the given text segment.
estimateTokenCount(TextSegment) - Method in interface dev.langchain4j.model.language.TokenCountEstimator
Estimates the count of tokens in the given text segment.
estimateTokenCount(Prompt) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified prompt.
estimateTokenCount(Prompt) - Method in interface dev.langchain4j.model.language.TokenCountEstimator
Estimates the count of tokens in the given prompt.
estimateTokenCount(String) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified text.
estimateTokenCount(String) - Method in interface dev.langchain4j.model.embedding.TokenCountEstimator
Estimates the count of tokens in the given text.
estimateTokenCount(String) - Method in interface dev.langchain4j.model.language.TokenCountEstimator
Estimates the count of tokens in the given text.
estimateTokenCount(List<ChatMessage>) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified list of messages.
estimateTokenCount(List<TextSegment>) - Method in interface dev.langchain4j.model.embedding.TokenCountEstimator
Estimates the count of tokens in the given text segments.
estimateTokenCountInForcefulToolExecutionRequest(ToolExecutionRequest) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in the given tool execution request.
estimateTokenCountInForcefulToolSpecification(ToolSpecification) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in the given tool specification.
estimateTokenCountInMessage(ChatMessage) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in the given message.
estimateTokenCountInMessages(Iterable<ChatMessage>) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in the given messages.
estimateTokenCountInText(String) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in the given text.
estimateTokenCountInToolExecutionRequests(Iterable<ToolExecutionRequest>) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in the given tool execution requests.
estimateTokenCountInTools(Iterable<Object>) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in Tool annotations of the given objects.
estimateTokenCountInTools(Object) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in Tool annotations of the given object.
estimateTokenCountInToolSpecifications(Iterable<ToolSpecification>) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in the given tool specifications.
Exceptions - Class in dev.langchain4j.internal
Utility methods for creating common exceptions.
execute(Input) - Method in interface dev.langchain4j.chain.Chain
Execute the chain step.
execute(String) - Method in interface dev.langchain4j.code.CodeExecutionEngine
Execute the given code.
ExpandingQueryTransformer - Class in dev.langchain4j.rag.query.transformer
A QueryTransformer that utilizes a ChatLanguageModel to expand a given Query.
ExpandingQueryTransformer(ChatLanguageModel) - Constructor for class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
ExpandingQueryTransformer(ChatLanguageModel, int) - Constructor for class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
ExpandingQueryTransformer(ChatLanguageModel, PromptTemplate) - Constructor for class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
ExpandingQueryTransformer(ChatLanguageModel, PromptTemplate, Integer) - Constructor for class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
Experimental - Annotation Type in dev.langchain4j
Indicates that a class/constructor/method is experimental and might change in the future.
expression() - Method in class dev.langchain4j.store.embedding.filter.logical.Not
 

F

FAIL - Enum constant in enum dev.langchain4j.rag.query.router.LanguageModelQueryRouter.FallbackStrategy
In this case, an original exception will be re-thrown, and the RAG flow will fail.
fallback(Query, Exception) - Method in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
fallbackStrategy - Variable in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
FILE_NAME - Static variable in class dev.langchain4j.data.document.Document
Common metadata key for the name of the file from which the document was loaded.
filter() - Method in class dev.langchain4j.store.embedding.EmbeddingSearchRequest
 
filter(Filter) - Method in class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder
 
Filter - Interface in dev.langchain4j.store.embedding.filter
This class represents a filter that can be applied during search in an EmbeddingStore.
FilterParser - Interface in dev.langchain4j.store.embedding.filter
Parses a filter expression string into a Filter object.
findRelevant(Embedding, int) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Finds the most relevant (closest in space) embeddings to the provided reference embedding.
findRelevant(Embedding, int, double) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Finds the most relevant (closest in space) embeddings to the provided reference embedding.
findRelevant(Object, Embedding, int) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Finds the most relevant (closest in space) embeddings to the provided reference embedding.
findRelevant(Object, Embedding, int, double) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Finds the most relevant (closest in space) embeddings to the provided reference embedding.
findRelevant(Object, String) - Method in interface dev.langchain4j.retriever.Retriever
Deprecated.
Find relevant items for the given text and memoryId.
findRelevant(String) - Method in interface dev.langchain4j.retriever.Retriever
Deprecated.
Find relevant items for the given text.
finishReason() - Method in class dev.langchain4j.model.output.Response
Get the finish reason.
FinishReason - Enum in dev.langchain4j.model.output
The reason why a model call finished.
firstChars(String, int) - Static method in class dev.langchain4j.internal.Utils
Returns the first numberOfChars characters of the given string.
flagged() - Method in class dev.langchain4j.model.moderation.Moderation
Returns true if the text was flagged.
flagged(String) - Static method in class dev.langchain4j.model.moderation.Moderation
Constructs a Moderation object that is flagged.
flaggedText() - Method in class dev.langchain4j.model.moderation.Moderation
Returns the text that was flagged.
format(Metadata) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
format(ChatMessage) - Method in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
format(Content) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
format(String, String) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
format(List<ChatMessage>) - Method in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
format(List<Content>) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
formatInstructions() - Method in interface dev.langchain4j.model.output.OutputParser
Description of the text format.
from(float[]) - Static method in class dev.langchain4j.data.embedding.Embedding
Creates a new Embedding from the given vector.
from(ToolExecutionRequest...) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
from(ToolExecutionRequest, String) - Static method in class dev.langchain4j.data.message.ToolExecutionResultMessage
Creates a ToolExecutionResultMessage from a ToolExecutionRequest and the result of the tool execution.
from(Image) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given image.
from(Image, ImageContent.DetailLevel) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given image.
from(Content...) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from contents.
from(UserMessage, Object, List<ChatMessage>) - Static method in class dev.langchain4j.rag.query.Metadata
 
from(TextSegment) - Static method in class dev.langchain4j.rag.content.Content
 
from(String) - Static method in class dev.langchain4j.data.document.Document
Creates a new Document from the given text.
from(String) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given text.
from(String) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url.
from(String) - Static method in class dev.langchain4j.data.message.SystemMessage
Creates a new system message.
from(String) - Static method in class dev.langchain4j.data.message.TextContent
Creates a new text content.
from(String) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a text.
from(String) - Static method in class dev.langchain4j.data.segment.TextSegment
Creates a new text segment.
from(String) - Static method in class dev.langchain4j.model.input.Prompt
Create a new Prompt.
from(String) - Static method in class dev.langchain4j.model.input.PromptTemplate
Create a new PromptTemplate.
from(String) - Static method in class dev.langchain4j.rag.content.Content
 
from(String) - Static method in class dev.langchain4j.rag.query.Query
 
from(String, Metadata) - Static method in class dev.langchain4j.data.document.Document
Creates a new Document from the given text.
from(String, Metadata) - Static method in class dev.langchain4j.data.segment.TextSegment
Creates a new text segment.
from(String, Content...) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and contents.
from(String, ImageContent.DetailLevel) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url and detail level.
from(String, Metadata) - Static method in class dev.langchain4j.rag.query.Query
 
from(String, Object) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key and value.
from(String, Object) - Static method in class dev.langchain4j.data.document.Metadata
Deprecated.
from(String, String) - Static method in class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a single key-value pair.
from(String, String) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given base64 data and mime type.
from(String, String) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and a text.
from(String, String, ImageContent.DetailLevel) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given base64 data and mime type.
from(String, String, String) - Static method in class dev.langchain4j.data.message.ToolExecutionResultMessage
Creates a ToolExecutionResultMessage from a ToolExecutionRequest and the result of the tool execution.
from(String, List<Content>) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and contents.
from(URI) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url.
from(URI, ImageContent.DetailLevel) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url and detail level.
from(List<ToolExecutionRequest>) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
from(List<Content>) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from contents.
from(List<Float>) - Static method in class dev.langchain4j.data.embedding.Embedding
Creates a new Embedding from the given vector.
from(Map<String, ?>) - Static method in class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a map of key-value pairs.
from(T) - Static method in class dev.langchain4j.model.output.Response
Create a new Response.
from(T, TokenUsage) - Static method in class dev.langchain4j.model.output.Response
Create a new Response.
from(T, TokenUsage, FinishReason) - Static method in class dev.langchain4j.model.output.Response
Create a new Response.
fromCosineSimilarity(double) - Static method in class dev.langchain4j.store.embedding.RelevanceScore
Converts cosine similarity into relevance score.
fromJson(String, Class<T>) - Static method in class dev.langchain4j.internal.Json
Convert the given JSON string to an object of the given type.
fromJson(String, Class<T>) - Method in interface dev.langchain4j.internal.Json.JsonCodec
Convert the given JSON string to an object of the given type.
fromRelevanceScore(double) - Static method in class dev.langchain4j.store.embedding.CosineSimilarity
Converts relevance score into cosine similarity.
fuse(Collection<List<Content>>) - Static method in class dev.langchain4j.rag.content.aggregator.ReciprocalRankFuser
Fuses multiple List<Content> into a single List<Content> using the Reciprocal Rank Fusion (RRF) algorithm with k=60.
fuse(Collection<List<Content>>, int) - Static method in class dev.langchain4j.rag.content.aggregator.ReciprocalRankFuser
Fuses multiple List<Content> into a single List<Content> using the Reciprocal Rank Fusion (RRF) algorithm.
fuse(Map<Query, Collection<List<Content>>>) - Method in class dev.langchain4j.rag.content.aggregator.DefaultContentAggregator
 
fuse(Map<Query, Collection<List<Content>>>) - Method in class dev.langchain4j.rag.content.aggregator.ReRankingContentAggregator
 

G

generate(ChatMessage...) - Method in interface dev.langchain4j.model.chat.ChatLanguageModel
Generates a response from the model based on a sequence of messages.
generate(ChatMessage...) - Method in class dev.langchain4j.model.chat.DisabledChatLanguageModel
 
generate(Prompt) - Method in class dev.langchain4j.model.language.DisabledLanguageModel
 
generate(Prompt) - Method in interface dev.langchain4j.model.language.LanguageModel
Generate a response to the given prompt.
generate(Prompt, StreamingResponseHandler<String>) - Method in class dev.langchain4j.model.language.DisabledStreamingLanguageModel
 
generate(Prompt, StreamingResponseHandler<String>) - Method in interface dev.langchain4j.model.language.StreamingLanguageModel
Generates a response from the model based on a prompt.
generate(String) - Method in interface dev.langchain4j.model.chat.ChatLanguageModel
Generates a response from the model based on a message from a user.
generate(String) - Method in class dev.langchain4j.model.chat.DisabledChatLanguageModel
 
generate(String) - Method in class dev.langchain4j.model.image.DisabledImageModel
 
generate(String) - Method in interface dev.langchain4j.model.image.ImageModel
Given a prompt, generate an image.
generate(String) - Method in class dev.langchain4j.model.language.DisabledLanguageModel
 
generate(String) - Method in interface dev.langchain4j.model.language.LanguageModel
Generate a response to the given prompt.
generate(String, int) - Method in class dev.langchain4j.model.image.DisabledImageModel
 
generate(String, int) - Method in interface dev.langchain4j.model.image.ImageModel
Given a prompt, generate n images.
generate(String, StreamingResponseHandler<AiMessage>) - Method in class dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel
 
generate(String, StreamingResponseHandler<AiMessage>) - Method in interface dev.langchain4j.model.chat.StreamingChatLanguageModel
Generates a response from the model based on a message from a user.
generate(String, StreamingResponseHandler<String>) - Method in class dev.langchain4j.model.language.DisabledStreamingLanguageModel
 
generate(String, StreamingResponseHandler<String>) - Method in interface dev.langchain4j.model.language.StreamingLanguageModel
Generates a response from the model based on a prompt.
generate(List<ChatMessage>) - Method in interface dev.langchain4j.model.chat.ChatLanguageModel
Generates a response from the model based on a sequence of messages.
generate(List<ChatMessage>) - Method in class dev.langchain4j.model.chat.DisabledChatLanguageModel
 
generate(List<ChatMessage>, ToolSpecification) - Method in interface dev.langchain4j.model.chat.ChatLanguageModel
Generates a response from the model based on a list of messages and a single tool specification.
generate(List<ChatMessage>, ToolSpecification) - Method in class dev.langchain4j.model.chat.DisabledChatLanguageModel
 
generate(List<ChatMessage>, ToolSpecification, StreamingResponseHandler<AiMessage>) - Method in class dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel
 
generate(List<ChatMessage>, ToolSpecification, StreamingResponseHandler<AiMessage>) - Method in interface dev.langchain4j.model.chat.StreamingChatLanguageModel
Generates a response from the model based on a list of messages and a tool specification.
generate(List<ChatMessage>, StreamingResponseHandler<AiMessage>) - Method in class dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel
 
generate(List<ChatMessage>, StreamingResponseHandler<AiMessage>) - Method in interface dev.langchain4j.model.chat.StreamingChatLanguageModel
Generates a response from the model based on a sequence of messages.
generate(List<ChatMessage>, List<ToolSpecification>) - Method in interface dev.langchain4j.model.chat.ChatLanguageModel
Generates a response from the model based on a list of messages and a list of tool specifications.
generate(List<ChatMessage>, List<ToolSpecification>) - Method in class dev.langchain4j.model.chat.DisabledChatLanguageModel
 
generate(List<ChatMessage>, List<ToolSpecification>, StreamingResponseHandler<AiMessage>) - Method in class dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel
 
generate(List<ChatMessage>, List<ToolSpecification>, StreamingResponseHandler<AiMessage>) - Method in interface dev.langchain4j.model.chat.StreamingChatLanguageModel
Generates a response from the model based on a list of messages and a list of tool specifications.
generateUUIDFrom(String) - Static method in class dev.langchain4j.internal.Utils
Generates a UUID from a hash of the given input string.
get(String) - Method in class dev.langchain4j.data.document.Metadata
Returns the value associated with the given key.
getContentClass() - Method in enum dev.langchain4j.data.message.ContentType
Returns the class of the content type.
getDouble(String) - Method in class dev.langchain4j.data.document.Metadata
Returns the Double value associated with the given key.
getFloat(String) - Method in class dev.langchain4j.data.document.Metadata
Returns the Float value associated with the given key.
getInteger(String) - Method in class dev.langchain4j.data.document.Metadata
Returns the Integer value associated with the given key.
getLong(String) - Method in class dev.langchain4j.data.document.Metadata
Returns the Long value associated with the given key.
getMessages(Object) - Method in interface dev.langchain4j.store.memory.chat.ChatMemoryStore
Retrieves messages for a specified chat memory.
getMessages(Object) - Method in class dev.langchain4j.store.memory.chat.InMemoryChatMemoryStore
 
getName() - Method in interface dev.langchain4j.spi.prompt.PromptTemplateFactory.Input
Get the name of the template.
getOrDefault(T, Supplier<T>) - Static method in class dev.langchain4j.internal.Utils
Returns the given value if it is not null, otherwise returns the value returned by the given supplier.
getOrDefault(T, T) - Static method in class dev.langchain4j.internal.Utils
Returns the given value if it is not null, otherwise returns the given default value.
getString(String) - Method in class dev.langchain4j.data.document.Metadata
Returns the String value associated with the given key.
getTemplate() - Method in interface dev.langchain4j.spi.prompt.PromptTemplateFactory.Input
Get the template string.
GSON - Static variable in class dev.langchain4j.agent.tool.ToolExecutionRequestUtil
Gson instance.
GsonChatMessageJsonCodec - Class in dev.langchain4j.data.message
A codec for serializing and deserializing ChatMessage objects to and from JSON.
GsonChatMessageJsonCodec() - Constructor for class dev.langchain4j.data.message.GsonChatMessageJsonCodec
Constructs a new GsonChatMessageJsonCodec.

H

hashCode() - Method in class dev.langchain4j.agent.tool.JsonSchemaProperty
 
hashCode() - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest
 
hashCode() - Method in class dev.langchain4j.agent.tool.ToolParameters
 
hashCode() - Method in class dev.langchain4j.agent.tool.ToolSpecification
 
hashCode() - Method in class dev.langchain4j.data.document.Document
 
hashCode() - Method in class dev.langchain4j.data.document.Metadata
 
hashCode() - Method in class dev.langchain4j.data.embedding.Embedding
 
hashCode() - Method in class dev.langchain4j.data.image.Image
 
hashCode() - Method in class dev.langchain4j.data.message.AiMessage
 
hashCode() - Method in class dev.langchain4j.data.message.ImageContent
 
hashCode() - Method in class dev.langchain4j.data.message.SystemMessage
 
hashCode() - Method in class dev.langchain4j.data.message.TextContent
 
hashCode() - Method in class dev.langchain4j.data.message.ToolExecutionResultMessage
 
hashCode() - Method in class dev.langchain4j.data.message.UserMessage
 
hashCode() - Method in class dev.langchain4j.data.segment.TextSegment
 
hashCode() - Method in class dev.langchain4j.model.input.Prompt
 
hashCode() - Method in class dev.langchain4j.model.moderation.Moderation
 
hashCode() - Method in class dev.langchain4j.model.output.Response
 
hashCode() - Method in class dev.langchain4j.model.output.TokenUsage
 
hashCode() - Method in class dev.langchain4j.rag.content.Content
 
hashCode() - Method in class dev.langchain4j.rag.query.Metadata
 
hashCode() - Method in class dev.langchain4j.rag.query.Query
 
hashCode() - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
 
hasSingleText() - Method in class dev.langchain4j.data.message.UserMessage
Whether this message contains a single TextContent.
hasToolExecutionRequests() - Method in class dev.langchain4j.data.message.AiMessage
Check if the message has ToolExecutionRequests.
HIGH - Enum constant in enum dev.langchain4j.data.message.ImageContent.DetailLevel
High detail.

I

id() - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest
Returns the id of the tool.
id() - Method in class dev.langchain4j.data.message.ToolExecutionResultMessage
Returns the id of the tool.
id() - Method in interface dev.langchain4j.memory.ChatMemory
The ID of the ChatMemory.
id(String) - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest.Builder
Sets the id.
idToRetriever - Variable in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
illegalArgument(String, Object...) - Static method in class dev.langchain4j.internal.Exceptions
Constructs an IllegalArgumentException with the given formatted result.
image() - Method in class dev.langchain4j.data.message.ImageContent
Get the Image.
Image - Class in dev.langchain4j.data.image
Represents an image as a URL or as a Base64-encoded string.
IMAGE - Enum constant in enum dev.langchain4j.data.message.ContentType
Image content.
Image.Builder - Class in dev.langchain4j.data.image
Builder for Image.
ImageContent - Class in dev.langchain4j.data.message
Represents an image with a DetailLevel.
ImageContent(Image) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given image.
ImageContent(Image, ImageContent.DetailLevel) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given image.
ImageContent(String) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url.
ImageContent(String, ImageContent.DetailLevel) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url and detail level.
ImageContent(String, String) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given base64 data and mime type.
ImageContent(String, String, ImageContent.DetailLevel) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given base64 data and mime type.
ImageContent(URI) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url.
ImageContent(URI, ImageContent.DetailLevel) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url and detail level.
ImageContent.DetailLevel - Enum in dev.langchain4j.data.message
The detail level of an Image.
ImageModel - Interface in dev.langchain4j.model.image
Text to Image generator model.
ingest(Document) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor
Ingests a single document.
ingest(Document...) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor
Ingests multiple documents.
ingest(List<Document>) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor
Ingests multiple documents.
inject(List<Content>, UserMessage) - Method in interface dev.langchain4j.rag.content.injector.ContentInjector
Injects given Contents into a given UserMessage.
inject(List<Content>, UserMessage) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
InMemoryChatMemoryStore - Class in dev.langchain4j.store.memory.chat
Implementation of ChatMemoryStore that stores state of ChatMemory (chat messages) in-memory.
InMemoryChatMemoryStore() - Constructor for class dev.langchain4j.store.memory.chat.InMemoryChatMemoryStore
Constructs a new InMemoryChatMemoryStore.
inputStream() - Method in interface dev.langchain4j.data.document.DocumentSource
Provides an InputStream to read the content of the document.
inputTokenCount() - Method in class dev.langchain4j.model.output.TokenUsage
Returns the input token count, or null if unknown.
INTEGER - Static variable in class dev.langchain4j.agent.tool.JsonSchemaProperty
A property with key "type" and value "integer".
isBetween(double, double) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isBetween(float, float) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isBetween(int, int) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isBetween(long, long) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isBetween(String, String) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isCollectionEmpty(Collection<?>) - Static method in class dev.langchain4j.internal.Utils
Deprecated.
isEqualTo(double) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isEqualTo(float) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isEqualTo(int) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isEqualTo(long) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isEqualTo(String) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsEqualTo - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsEqualTo(String, Object) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsEqualTo
 
isGreaterThan(double) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThan(float) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThan(int) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThan(long) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThan(String) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsGreaterThan - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsGreaterThan(String, Comparable<?>) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThan
 
isGreaterThanOrEqualTo(double) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThanOrEqualTo(float) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThanOrEqualTo(int) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThanOrEqualTo(long) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isGreaterThanOrEqualTo(String) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsGreaterThanOrEqualTo - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsGreaterThanOrEqualTo(String, Comparable<?>) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThanOrEqualTo
 
isIn(double...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isIn(float...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isIn(int...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isIn(long...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isIn(String...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isIn(Collection<?>) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsIn - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsIn(String, Collection<?>) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsIn
 
isLessThan(double) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThan(float) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThan(int) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThan(long) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThan(String) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsLessThan - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsLessThan(String, Comparable<?>) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsLessThan
 
isLessThanOrEqualTo(double) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThanOrEqualTo(float) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThanOrEqualTo(int) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThanOrEqualTo(long) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isLessThanOrEqualTo(String) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsLessThanOrEqualTo - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsLessThanOrEqualTo(String, Comparable<?>) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsLessThanOrEqualTo
 
isNotEqualTo(double) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotEqualTo(float) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotEqualTo(int) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotEqualTo(long) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotEqualTo(String) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsNotEqualTo - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsNotEqualTo(String, Object) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsNotEqualTo
 
isNotIn(double...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotIn(float...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotIn(int...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotIn(long...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotIn(String...) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
isNotIn(Collection<?>) - Method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
IsNotIn - Class in dev.langchain4j.store.embedding.filter.comparison
 
IsNotIn(String, Collection<?>) - Constructor for class dev.langchain4j.store.embedding.filter.comparison.IsNotIn
 
isNotNullOrBlank(String) - Static method in class dev.langchain4j.internal.Utils
Is the given string not null and not blank?
isNullOrBlank(String) - Static method in class dev.langchain4j.internal.Utils
Is the given string null or blank?
isNullOrEmpty(Collection<?>) - Static method in class dev.langchain4j.internal.Utils
Is the collection null or empty?
items(JsonSchemaProperty) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Wraps the given type in a property with key "items".

J

JacocoIgnoreCoverageGenerated - Annotation Type in dev.langchain4j.internal
Annotation to mark methods where JaCoCo coverage should be ignored.
jitterDelayMillis(int) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy
This method returns the jitter delay in milliseconds for a given attempt.
jitterScale(double) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy.Builder
Sets the jitter scale.
join(StructuredPrompt) - Static method in class dev.langchain4j.model.input.structured.StructuredPrompt.Util
Joins the lines of the prompt template.
Json - Class in dev.langchain4j.internal
A utility class for JSON.
Json.JsonCodec - Interface in dev.langchain4j.internal
The abstract JSON codec interface.
JsonCodecFactory - Interface in dev.langchain4j.spi.json
A factory for creating Json.JsonCodec instances through SPI.
JsonSchemaProperty - Class in dev.langchain4j.agent.tool
Represents a property in a JSON schema.
JsonSchemaProperty(String, Object) - Constructor for class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key and value.

K

key() - Method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Get the key.
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsEqualTo
 
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThan
 
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThanOrEqualTo
 
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsIn
 
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsLessThan
 
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsLessThanOrEqualTo
 
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsNotEqualTo
 
key() - Method in class dev.langchain4j.store.embedding.filter.comparison.IsNotIn
 

L

LanguageModel - Interface in dev.langchain4j.model.language
Represents a language model that has a simple text interface (as opposed to a chat interface).
LanguageModelQueryRouter - Class in dev.langchain4j.rag.query.router
A QueryRouter that utilizes a ChatLanguageModel to make a routing decision.
LanguageModelQueryRouter(ChatLanguageModel, Map<ContentRetriever, String>) - Constructor for class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
LanguageModelQueryRouter(ChatLanguageModel, Map<ContentRetriever, String>, PromptTemplate, LanguageModelQueryRouter.FallbackStrategy) - Constructor for class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
LanguageModelQueryRouter.FallbackStrategy - Enum in dev.langchain4j.rag.query.router
Strategy applied if the call to the LLM fails of if LLM does not return a valid response.
left() - Method in class dev.langchain4j.store.embedding.filter.logical.And
 
left() - Method in class dev.langchain4j.store.embedding.filter.logical.Or
 
LENGTH - Enum constant in enum dev.langchain4j.model.output.FinishReason
The call finished because the token length was reached.
load(DocumentSource, DocumentParser) - Static method in class dev.langchain4j.data.document.DocumentLoader
Loads a document from the given source using the given parser.
loadFactories(Class<T>) - Static method in class dev.langchain4j.spi.ServiceHelper
Load all the services of a given type.
loadFactories(Class<T>, ClassLoader) - Static method in class dev.langchain4j.spi.ServiceHelper
Load all the services of a given type.
LOW - Enum constant in enum dev.langchain4j.data.message.ImageContent.DetailLevel
Low detail.

M

MAP_TYPE - Static variable in class dev.langchain4j.agent.tool.ToolExecutionRequestUtil
Utility TypeToken describing Map<String, Object>.
matches() - Method in class dev.langchain4j.store.embedding.EmbeddingSearchResult
 
maxAttempts(int) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy.Builder
Sets the default maximum number of attempts.
maxResults() - Method in class dev.langchain4j.store.embedding.EmbeddingSearchRequest
 
maxResults(Integer) - Method in class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder
 
messageClass() - Method in enum dev.langchain4j.data.message.ChatMessageType
Returns the class of the message type.
messageFromJson(String) - Static method in class dev.langchain4j.data.message.ChatMessageDeserializer
Deserializes a JSON string into a ChatMessage.
messageFromJson(String) - Method in interface dev.langchain4j.data.message.ChatMessageJsonCodec
Deserializes a JSON string to a ChatMessage object.
messageFromJson(String) - Method in class dev.langchain4j.data.message.GsonChatMessageJsonCodec
 
messages() - Method in interface dev.langchain4j.memory.ChatMemory
Retrieves messages from the chat memory.
messagesFromJson(String) - Static method in class dev.langchain4j.data.message.ChatMessageDeserializer
Deserializes a JSON string into a list of ChatMessage.
messagesFromJson(String) - Method in interface dev.langchain4j.data.message.ChatMessageJsonCodec
Deserializes a JSON string to a list of ChatMessage objects.
messagesFromJson(String) - Method in class dev.langchain4j.data.message.GsonChatMessageJsonCodec
 
messagesToJson(List<ChatMessage>) - Method in interface dev.langchain4j.data.message.ChatMessageJsonCodec
Serializes a list of ChatMessage objects to a JSON string.
messagesToJson(List<ChatMessage>) - Static method in class dev.langchain4j.data.message.ChatMessageSerializer
Serializes a list of chat messages into a JSON string.
messagesToJson(List<ChatMessage>) - Method in class dev.langchain4j.data.message.GsonChatMessageJsonCodec
 
messageToJson(ChatMessage) - Method in interface dev.langchain4j.data.message.ChatMessageJsonCodec
Serializes a ChatMessage object to a JSON string.
messageToJson(ChatMessage) - Static method in class dev.langchain4j.data.message.ChatMessageSerializer
Serializes a chat message into a JSON string.
messageToJson(ChatMessage) - Method in class dev.langchain4j.data.message.GsonChatMessageJsonCodec
 
metadata() - Method in class dev.langchain4j.data.document.Document
Returns the metadata associated with this document.
metadata() - Method in interface dev.langchain4j.data.document.DocumentSource
Returns the metadata associated with the source of the document.
metadata() - Method in class dev.langchain4j.data.segment.TextSegment
Returns the metadata.
metadata() - Method in class dev.langchain4j.rag.query.Query
 
metadata(String) - Method in class dev.langchain4j.data.document.Document
Looks up the metadata value for the given key.
metadata(String) - Method in class dev.langchain4j.data.segment.TextSegment
Returns the metadata value for the given key.
metadata(String, Object) - Static method in class dev.langchain4j.data.document.Metadata
Deprecated.
metadata(String, String) - Static method in class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a single key-value pair.
Metadata - Class in dev.langchain4j.data.document
Represents metadata of a Document or a TextSegment.
Metadata - Class in dev.langchain4j.rag.query
Represents metadata that may be useful or necessary for retrieval or augmentation purposes.
Metadata() - Constructor for class dev.langchain4j.data.document.Metadata
Construct a Metadata object with an empty map of key-value pairs.
Metadata(UserMessage, Object, List<ChatMessage>) - Constructor for class dev.langchain4j.rag.query.Metadata
 
Metadata(Map<String, ?>) - Constructor for class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a map of key-value pairs.
MetadataFilterBuilder - Class in dev.langchain4j.store.embedding.filter
A helper class for building a Filter for Metadata key.
MetadataFilterBuilder(String) - Constructor for class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
metadataKey(String) - Static method in class dev.langchain4j.store.embedding.filter.MetadataFilterBuilder
 
mimeType() - Method in class dev.langchain4j.data.image.Image
Get the mime type of the image.
mimeType(String) - Method in class dev.langchain4j.data.image.Image.Builder
Set the mime type of the image.
minScore() - Method in class dev.langchain4j.store.embedding.EmbeddingSearchRequest
 
minScore(Double) - Method in class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder
 
ModelDisabledException - Exception Class in dev.langchain4j.model
An exception thrown by a model that could be disabled by a user.
ModelDisabledException(String) - Constructor for exception class dev.langchain4j.model.ModelDisabledException
 
moderate(ChatMessage) - Method in class dev.langchain4j.model.moderation.DisabledModerationModel
 
moderate(ChatMessage) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given chat message.
moderate(TextSegment) - Method in class dev.langchain4j.model.moderation.DisabledModerationModel
 
moderate(TextSegment) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given text segment.
moderate(Prompt) - Method in class dev.langchain4j.model.moderation.DisabledModerationModel
 
moderate(Prompt) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given prompt.
moderate(String) - Method in class dev.langchain4j.model.moderation.DisabledModerationModel
 
moderate(String) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given text.
moderate(List<ChatMessage>) - Method in class dev.langchain4j.model.moderation.DisabledModerationModel
 
moderate(List<ChatMessage>) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given list of chat messages.
Moderation - Class in dev.langchain4j.model.moderation
Represents moderation status.
Moderation() - Constructor for class dev.langchain4j.model.moderation.Moderation
Construct a Moderation object that is not flagged.
Moderation(String) - Constructor for class dev.langchain4j.model.moderation.Moderation
Construct a Moderation object that is flagged.
ModerationModel - Interface in dev.langchain4j.model.moderation
Represents a model that can moderate text.

N

n - Variable in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
name() - Element in annotation type dev.langchain4j.agent.tool.Tool
Name of the tool.
name() - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest
Returns the name of the tool.
name() - Method in class dev.langchain4j.agent.tool.ToolSpecification
Returns the name of the tool.
name() - Method in class dev.langchain4j.data.message.UserMessage
The name of the user.
name(String) - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest.Builder
Sets the name.
name(String) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Sets the name.
normalize() - Method in class dev.langchain4j.data.embedding.Embedding
Normalize vector
not(Filter) - Static method in interface dev.langchain4j.store.embedding.filter.Filter
 
Not - Class in dev.langchain4j.store.embedding.filter.logical
 
Not(Filter) - Constructor for class dev.langchain4j.store.embedding.filter.logical.Not
 
notFlagged() - Static method in class dev.langchain4j.model.moderation.Moderation
Constructs a Moderation object that is not flagged.
NULL - Static variable in class dev.langchain4j.agent.tool.JsonSchemaProperty
A property with key "type" and value "null".
NUMBER - Static variable in class dev.langchain4j.agent.tool.JsonSchemaProperty
A property with key "type" and value "number".

O

OBJECT - Static variable in class dev.langchain4j.agent.tool.JsonSchemaProperty
A property with key "type" and value "object".
onComplete(Response<T>) - Method in interface dev.langchain4j.model.StreamingResponseHandler
Invoked when the language model has finished streaming a response.
onError(Throwable) - Method in interface dev.langchain4j.model.StreamingResponseHandler
This method is invoked when an error occurs during streaming.
onNext(String) - Method in interface dev.langchain4j.model.StreamingResponseHandler
Invoked each time the language model generates a new token in a textual response.
options - Variable in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
or(Filter) - Method in interface dev.langchain4j.store.embedding.filter.Filter
 
or(Filter, Filter) - Static method in interface dev.langchain4j.store.embedding.filter.Filter
 
Or - Class in dev.langchain4j.store.embedding.filter.logical
 
Or(Filter, Filter) - Constructor for class dev.langchain4j.store.embedding.filter.logical.Or
 
OTHER - Enum constant in enum dev.langchain4j.model.output.FinishReason
The call finished for some other reason.
OutputParser<T> - Interface in dev.langchain4j.model.output
Represents an output parser.
outputTokenCount() - Method in class dev.langchain4j.model.output.TokenUsage
Returns the output token count, or null if unknown.

P

P - Annotation Type in dev.langchain4j.agent.tool
Parameter of a Tool
parameters() - Method in class dev.langchain4j.agent.tool.ToolSpecification
Returns the parameters of the tool.
parameters(ToolParameters) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Sets the parameters.
parse(InputStream) - Method in interface dev.langchain4j.data.document.DocumentParser
Parses an InputStream into a Document.
parse(String) - Method in interface dev.langchain4j.model.output.OutputParser
Parse the given text.
parse(String) - Method in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
parse(String) - Method in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
parse(String) - Method in interface dev.langchain4j.store.embedding.filter.FilterParser
Parses a filter expression string into a Filter object.
Prompt - Class in dev.langchain4j.model.input
Represents a prompt (an input text sent to the LLM).
Prompt(String) - Constructor for class dev.langchain4j.model.input.Prompt
Create a new Prompt.
promptTemplate - Variable in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
promptTemplate - Variable in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
promptTemplate - Variable in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
PromptTemplate - Class in dev.langchain4j.model.input
Represents a template of a prompt that can be reused multiple times.
PromptTemplate(String) - Constructor for class dev.langchain4j.model.input.PromptTemplate
Create a new PromptTemplate.
PromptTemplateFactory - Interface in dev.langchain4j.spi.prompt
A factory for creating prompt templates.
PromptTemplateFactory.Input - Interface in dev.langchain4j.spi.prompt
Interface for input for the factory.
PromptTemplateFactory.Template - Interface in dev.langchain4j.spi.prompt
Interface for a prompt template.
properties() - Method in class dev.langchain4j.agent.tool.ToolParameters
Returns the properties of the tool.
properties(Map<String, Map<String, Object>>) - Method in class dev.langchain4j.agent.tool.ToolParameters.Builder
Sets the properties.
property(String, Object) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key and value.
put(String, double) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.
put(String, float) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.
put(String, int) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.
put(String, long) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.
put(String, String) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.

Q

Query - Class in dev.langchain4j.rag.query
Represents a query from the user intended for retrieving relevant Contents.
Query(String) - Constructor for class dev.langchain4j.rag.query.Query
 
Query(String, Metadata) - Constructor for class dev.langchain4j.rag.query.Query
 
queryEmbedding() - Method in class dev.langchain4j.store.embedding.EmbeddingSearchRequest
 
QueryRouter - Interface in dev.langchain4j.rag.query.router
Routes the given Query to one or multiple ContentRetrievers.
QueryTransformer - Interface in dev.langchain4j.rag.query.transformer
Transforms the given Query into one or multiple Querys.
quoted(Object) - Static method in class dev.langchain4j.internal.Utils
Returns the given object's toString() surrounded by quotes.

R

randomUUID() - Static method in class dev.langchain4j.internal.Utils
Returns a random UUID.
rawDelayMs(int) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy
This method returns the raw delay in milliseconds for a given attempt.
readBytes(String) - Static method in class dev.langchain4j.internal.Utils
Reads the content as bytes from the given URL as a GET request.
ReciprocalRankFuser - Class in dev.langchain4j.rag.content.aggregator
Implementation of Reciprocal Rank Fusion.
ReciprocalRankFuser() - Constructor for class dev.langchain4j.rag.content.aggregator.ReciprocalRankFuser
 
RelevanceScore - Class in dev.langchain4j.store.embedding
Utility class for converting between cosine similarity and relevance score.
remove(String) - Method in class dev.langchain4j.data.document.Metadata
Removes the given key from the metadata.
render(Map<String, Object>) - Method in interface dev.langchain4j.spi.prompt.PromptTemplateFactory.Template
Render the template.
repeat(String, int) - Static method in class dev.langchain4j.internal.Utils
Returns a string consisting of the given string repeated times times.
required() - Method in class dev.langchain4j.agent.tool.ToolParameters
Returns the required properties of the tool.
required(List<String>) - Method in class dev.langchain4j.agent.tool.ToolParameters.Builder
Sets the required.
reRankAndFilter(List<Content>, Query) - Method in class dev.langchain4j.rag.content.aggregator.ReRankingContentAggregator
 
ReRankingContentAggregator - Class in dev.langchain4j.rag.content.aggregator
A ContentAggregator that performs re-ranking using a ScoringModel, such as Cohere.
ReRankingContentAggregator(ScoringModel) - Constructor for class dev.langchain4j.rag.content.aggregator.ReRankingContentAggregator
 
ReRankingContentAggregator(ScoringModel, Function<Map<Query, Collection<List<Content>>>, Query>, Double) - Constructor for class dev.langchain4j.rag.content.aggregator.ReRankingContentAggregator
 
Response<T> - Class in dev.langchain4j.model.output
Represents the response from various types of models, including language, chat, embedding, and moderation models.
Response(T) - Constructor for class dev.langchain4j.model.output.Response
Create a new Response.
Response(T, TokenUsage, FinishReason) - Constructor for class dev.langchain4j.model.output.Response
Create a new Response.
RetrievalAugmentor - Interface in dev.langchain4j.rag
Augments the provided UserMessage with retrieved content.
retrieve(Query) - Method in interface dev.langchain4j.rag.content.retriever.ContentRetriever
Retrieves relevant Contents using a given Query.
retrieve(Query) - Method in class dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever
 
Retriever<T> - Interface in dev.langchain4j.retriever
Deprecated.
RetryPolicy(int, int, double, double) - Constructor for class dev.langchain4j.internal.RetryUtils.RetryPolicy
Construct a RetryPolicy.
retryPolicyBuilder() - Static method in class dev.langchain4j.internal.RetryUtils
This method returns a RetryPolicy.Builder.
RetryUtils - Class in dev.langchain4j.internal
Utility class for retrying actions.
RetryUtils.RetryPolicy - Class in dev.langchain4j.internal
This class encapsulates a retry policy.
RetryUtils.RetryPolicy.Builder - Class in dev.langchain4j.internal
This class encapsulates a retry policy builder.
revisedPrompt() - Method in class dev.langchain4j.data.image.Image
Get the revised prompt of the image.
revisedPrompt(String) - Method in class dev.langchain4j.data.image.Image.Builder
Set the revised prompt of the image.
right() - Method in class dev.langchain4j.store.embedding.filter.logical.And
 
right() - Method in class dev.langchain4j.store.embedding.filter.logical.Or
 
route(Query) - Method in class dev.langchain4j.rag.query.router.DefaultQueryRouter
 
route(Query) - Method in class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
route(Query) - Method in interface dev.langchain4j.rag.query.router.QueryRouter
Routes the given Query to one or multiple ContentRetrievers.
ROUTE_TO_ALL - Enum constant in enum dev.langchain4j.rag.query.router.LanguageModelQueryRouter.FallbackStrategy
In this case, the Query will be routed to all ContentRetrievers.
runtime(String, Object...) - Static method in class dev.langchain4j.internal.Exceptions
Constructs an RuntimeException with the given formatted result.

S

score() - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
Returns the relevance score (derivative of cosine distance) of this embedding compared to a reference embedding during a search.
score(TextSegment, String) - Method in interface dev.langchain4j.model.scoring.ScoringModel
Scores a given TextSegment against a given query.
score(String, String) - Method in interface dev.langchain4j.model.scoring.ScoringModel
Scores a given text against a given query.
scoreAll(List<TextSegment>, String) - Method in interface dev.langchain4j.model.scoring.ScoringModel
Scores all provided TextSegments against a given query.
ScoringModel - Interface in dev.langchain4j.model.scoring
Represents a model capable of scoring a text against a query.
search(EmbeddingSearchRequest) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Searches for the most similar (closest in the embedding space) Embeddings.
ServiceHelper - Class in dev.langchain4j.spi
Utility wrapper around ServiceLoader.load().
singleText() - Method in class dev.langchain4j.data.message.UserMessage
Returns text from a single TextContent.
sleep(int) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy
This method sleeps for a given attempt.
split(Document) - Method in interface dev.langchain4j.data.document.DocumentSplitter
Splits a single Document into a list of TextSegment objects.
splitAll(List<Document>) - Method in interface dev.langchain4j.data.document.DocumentSplitter
Splits a list of Documents into a list of TextSegment objects.
STOP - Enum constant in enum dev.langchain4j.model.output.FinishReason
The model call finished because the model decided the request was done.
StreamingChatLanguageModel - Interface in dev.langchain4j.model.chat
Represents a language model that has a chat interface and can stream a response one token at a time.
StreamingLanguageModel - Interface in dev.langchain4j.model.language
Represents a language model that has a simple text interface (as opposed to a chat interface) and can stream a response one token at a time.
StreamingResponseHandler<T> - Interface in dev.langchain4j.model
Represents a handler for streaming responses from a language model.
STRING - Static variable in class dev.langchain4j.agent.tool.JsonSchemaProperty
A property with key "type" and value "string".
StructuredPrompt - Annotation Type in dev.langchain4j.model.input.structured
Represents a structured prompt.
StructuredPrompt.Util - Class in dev.langchain4j.model.input.structured
Utility class for StructuredPrompt.
StructuredPromptFactory - Interface in dev.langchain4j.spi.prompt.structured
Represents a factory for structured prompts.
StructuredPromptProcessor - Class in dev.langchain4j.model.input.structured
Utility class for structured prompts.
SYSTEM - Enum constant in enum dev.langchain4j.data.message.ChatMessageType
A message from the system, typically defined by a developer.
systemMessage(String) - Static method in class dev.langchain4j.data.message.SystemMessage
Creates a new system message.
SystemMessage - Class in dev.langchain4j.data.message
Represents a system message, typically defined by a developer.
SystemMessage(String) - Constructor for class dev.langchain4j.data.message.SystemMessage
Creates a new system message.

T

template() - Method in class dev.langchain4j.model.input.PromptTemplate
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsEqualTo
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThan
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsGreaterThanOrEqualTo
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsIn
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsLessThan
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsLessThanOrEqualTo
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsNotEqualTo
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.comparison.IsNotIn
 
test(Object) - Method in interface dev.langchain4j.store.embedding.filter.Filter
Tests if a given object satisfies this Filter.
test(Object) - Method in class dev.langchain4j.store.embedding.filter.logical.And
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.logical.Not
 
test(Object) - Method in class dev.langchain4j.store.embedding.filter.logical.Or
 
text() - Method in class dev.langchain4j.data.document.Document
Returns the text of this document.
text() - Method in class dev.langchain4j.data.message.AiMessage
Get the text of the message.
text() - Method in interface dev.langchain4j.data.message.ChatMessage
Deprecated.
decode through ChatMessage.type() instead.
text() - Method in class dev.langchain4j.data.message.SystemMessage
Returns the message text.
text() - Method in class dev.langchain4j.data.message.TextContent
Returns the text.
text() - Method in class dev.langchain4j.data.message.ToolExecutionResultMessage
Returns the result of the tool execution.
text() - Method in class dev.langchain4j.data.message.UserMessage
text() - Method in class dev.langchain4j.data.segment.TextSegment
Returns the text.
text() - Method in class dev.langchain4j.model.input.Prompt
The text of the prompt.
text() - Method in class dev.langchain4j.rag.query.Query
 
TEXT - Enum constant in enum dev.langchain4j.data.message.ContentType
Text content.
TextClassifier<E> - Interface in dev.langchain4j.classification
Classifies given text according to specified enum.
TextContent - Class in dev.langchain4j.data.message
Represents a text content.
TextContent(String) - Constructor for class dev.langchain4j.data.message.TextContent
Creates a new text content.
textSegment() - Method in class dev.langchain4j.rag.content.Content
 
textSegment(String) - Static method in class dev.langchain4j.data.segment.TextSegment
Creates a new text segment.
textSegment(String, Metadata) - Static method in class dev.langchain4j.data.segment.TextSegment
Creates a new text segment.
TextSegment - Class in dev.langchain4j.data.segment
Represents a semantically meaningful segment (chunk/piece/fragment) of a larger entity such as a document or chat conversation.
TextSegment(String, Metadata) - Constructor for class dev.langchain4j.data.segment.TextSegment
Creates a new text segment.
textSegmentTransformer(TextSegmentTransformer) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the text segment transformer.
TextSegmentTransformer - Interface in dev.langchain4j.data.segment
Defines the interface for transforming a TextSegment.
toAiMessage() - Method in class dev.langchain4j.model.input.Prompt
Convert this prompt to an AiMessage.
toContentRetriever() - Method in interface dev.langchain4j.retriever.Retriever
Deprecated.
 
toInputStream(Object, Class<?>) - Method in interface dev.langchain4j.internal.Json.JsonCodec
Convert the given object to an InputStream.
toInputStream(Object, Class<?>) - Static method in class dev.langchain4j.internal.Json
Convert the given object to an InputStream.
toJson(Object) - Method in interface dev.langchain4j.internal.Json.JsonCodec
Convert the given object to JSON.
toJson(Object) - Static method in class dev.langchain4j.internal.Json
Convert the given object to JSON.
TokenCountEstimator - Interface in dev.langchain4j.model.chat
Represents an interface for estimating the count of tokens in various text types such as a text, message, prompt, text segment, etc.
TokenCountEstimator - Interface in dev.langchain4j.model.embedding
Represents an interface for estimating the count of tokens in various texts, text segments, etc.
TokenCountEstimator - Interface in dev.langchain4j.model.language
Represents an interface for estimating the count of tokens in various text types such as a text, prompt, text segment, etc.
Tokenizer - Interface in dev.langchain4j.model
Represents an interface for estimating the count of tokens in various text types such as a text, prompt, text segment, etc.
tokenUsage() - Method in class dev.langchain4j.model.output.Response
Get the token usage statistics.
TokenUsage - Class in dev.langchain4j.model.output
Represents the token usage of a response.
TokenUsage() - Constructor for class dev.langchain4j.model.output.TokenUsage
Creates a new TokenUsage instance with all fields set to null.
TokenUsage(Integer) - Constructor for class dev.langchain4j.model.output.TokenUsage
Creates a new TokenUsage instance with the given input token count.
TokenUsage(Integer, Integer) - Constructor for class dev.langchain4j.model.output.TokenUsage
Creates a new TokenUsage instance with the given input and output token counts.
TokenUsage(Integer, Integer, Integer) - Constructor for class dev.langchain4j.model.output.TokenUsage
Creates a new TokenUsage instance with the given input, output and total token counts.
toMap() - Method in class dev.langchain4j.data.document.Metadata
Get a copy of the metadata as a map of key-value pairs.
Tool - Annotation Type in dev.langchain4j.agent.tool
Java methods annotated with @Tool are considered tools that language model can use.
TOOL_EXECUTION - Enum constant in enum dev.langchain4j.model.output.FinishReason
The call finished signalling a need for tool execution.
TOOL_EXECUTION_RESULT - Enum constant in enum dev.langchain4j.data.message.ChatMessageType
A message from a tool.
ToolExecutionRequest - Class in dev.langchain4j.agent.tool
Represents a request to execute a tool.
ToolExecutionRequest.Builder - Class in dev.langchain4j.agent.tool
ToolExecutionRequest builder static inner class.
toolExecutionRequests() - Method in class dev.langchain4j.data.message.AiMessage
Get the tool execution requests of the message.
ToolExecutionRequestUtil - Class in dev.langchain4j.agent.tool
Utility class for ToolExecutionRequest.
toolExecutionResultMessage(ToolExecutionRequest, String) - Static method in class dev.langchain4j.data.message.ToolExecutionResultMessage
Creates a ToolExecutionResultMessage from a ToolExecutionRequest and the result of the tool execution.
toolExecutionResultMessage(String, String, String) - Static method in class dev.langchain4j.data.message.ToolExecutionResultMessage
Creates a ToolExecutionResultMessage from a ToolExecutionRequest and the result of the tool execution.
ToolExecutionResultMessage - Class in dev.langchain4j.data.message
Represents the result of a tool execution in response to a ToolExecutionRequest.
ToolExecutionResultMessage(String, String, String) - Constructor for class dev.langchain4j.data.message.ToolExecutionResultMessage
ToolMemoryId - Annotation Type in dev.langchain4j.agent.tool
If a Tool method parameter is annotated with this annotation, memory id (parameter annotated with @MemoryId in AI Service) will be injected automatically.
toolName() - Method in class dev.langchain4j.data.message.ToolExecutionResultMessage
Returns the name of the tool.
ToolParameters - Class in dev.langchain4j.agent.tool
Represents the parameters of a tool.
ToolParameters.Builder - Class in dev.langchain4j.agent.tool
ToolParameters builder static inner class.
ToolSpecification - Class in dev.langchain4j.agent.tool
Describes a Tool.
ToolSpecification.Builder - Class in dev.langchain4j.agent.tool
ToolSpecification builder static inner class.
toolSpecificationFrom(Method) - Static method in class dev.langchain4j.agent.tool.ToolSpecifications
Get the ToolSpecification for the given Tool method.
ToolSpecifications - Class in dev.langchain4j.agent.tool
Utility methods for ToolSpecifications.
toolSpecificationsFrom(Object) - Static method in class dev.langchain4j.agent.tool.ToolSpecifications
Get the ToolSpecifications for each Tool method of the given object.
toPrompt(Object) - Method in class dev.langchain4j.model.input.structured.DefaultStructuredPromptFactory
 
toPrompt(Object) - Static method in class dev.langchain4j.model.input.structured.StructuredPromptProcessor
Converts the given structured prompt to a prompt.
toPrompt(Object) - Method in interface dev.langchain4j.spi.prompt.structured.StructuredPromptFactory
Converts the given structured prompt to a prompt.
toString() - Method in class dev.langchain4j.agent.tool.JsonSchemaProperty
 
toString() - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest
 
toString() - Method in class dev.langchain4j.agent.tool.ToolParameters
 
toString() - Method in class dev.langchain4j.agent.tool.ToolSpecification
 
toString() - Method in class dev.langchain4j.data.document.Document
 
toString() - Method in class dev.langchain4j.data.document.Metadata
 
toString() - Method in class dev.langchain4j.data.embedding.Embedding
 
toString() - Method in class dev.langchain4j.data.image.Image
 
toString() - Method in class dev.langchain4j.data.message.AiMessage
 
toString() - Method in class dev.langchain4j.data.message.ImageContent
 
toString() - Method in class dev.langchain4j.data.message.SystemMessage
 
toString() - Method in class dev.langchain4j.data.message.TextContent
 
toString() - Method in class dev.langchain4j.data.message.ToolExecutionResultMessage
 
toString() - Method in class dev.langchain4j.data.message.UserMessage
 
toString() - Method in class dev.langchain4j.data.segment.TextSegment
 
toString() - Method in class dev.langchain4j.model.input.Prompt
 
toString() - Method in class dev.langchain4j.model.moderation.Moderation
 
toString() - Method in class dev.langchain4j.model.output.Response
 
toString() - Method in class dev.langchain4j.model.output.TokenUsage
 
toString() - Method in class dev.langchain4j.rag.content.Content
 
toString() - Method in class dev.langchain4j.rag.query.Metadata
 
toString() - Method in class dev.langchain4j.rag.query.Query
 
toString() - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
 
toSystemMessage() - Method in class dev.langchain4j.model.input.Prompt
Convert this prompt to a SystemMessage.
totalTokenCount() - Method in class dev.langchain4j.model.output.TokenUsage
Returns the total token count, or null if unknown.
toTextSegment() - Method in class dev.langchain4j.data.document.Document
Builds a TextSegment from this document.
toUserMessage() - Method in class dev.langchain4j.model.input.Prompt
Convert this prompt to a UserMessage.
transform(Document) - Method in interface dev.langchain4j.data.document.DocumentTransformer
Transforms a provided document.
transform(TextSegment) - Method in interface dev.langchain4j.data.segment.TextSegmentTransformer
Transforms a provided segment.
transform(Query) - Method in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
transform(Query) - Method in class dev.langchain4j.rag.query.transformer.DefaultQueryTransformer
 
transform(Query) - Method in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 
transform(Query) - Method in interface dev.langchain4j.rag.query.transformer.QueryTransformer
Transforms the given Query into one or multiple Querys.
transformAll(List<Document>) - Method in interface dev.langchain4j.data.document.DocumentTransformer
Transforms all the provided documents.
transformAll(List<TextSegment>) - Method in interface dev.langchain4j.data.segment.TextSegmentTransformer
Transforms all the provided segments.
type() - Method in class dev.langchain4j.agent.tool.ToolParameters
Returns the type of the tool.
type() - Method in class dev.langchain4j.data.message.AiMessage
 
type() - Method in interface dev.langchain4j.data.message.ChatMessage
The type of the message.
type() - Method in interface dev.langchain4j.data.message.Content
Returns the type of content.
type() - Method in class dev.langchain4j.data.message.ImageContent
 
type() - Method in class dev.langchain4j.data.message.SystemMessage
 
type() - Method in class dev.langchain4j.data.message.TextContent
 
type() - Method in class dev.langchain4j.data.message.ToolExecutionResultMessage
 
type() - Method in class dev.langchain4j.data.message.UserMessage
 
type(String) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "type" and value.
type(String) - Method in class dev.langchain4j.agent.tool.ToolParameters.Builder
Sets the type.

U

updateMessages(Object, List<ChatMessage>) - Method in interface dev.langchain4j.store.memory.chat.ChatMemoryStore
Updates messages for a specified chat memory.
updateMessages(Object, List<ChatMessage>) - Method in class dev.langchain4j.store.memory.chat.InMemoryChatMemoryStore
 
url() - Method in class dev.langchain4j.data.image.Image
Get the url of the image.
url(String) - Method in class dev.langchain4j.data.image.Image.Builder
Set the url of the image.
url(URI) - Method in class dev.langchain4j.data.image.Image.Builder
Set the url of the image.
URL - Static variable in class dev.langchain4j.data.document.Document
Common metadata key for the URL from which the document was loaded.
USER - Enum constant in enum dev.langchain4j.data.message.ChatMessageType
A message from the user.
userMessage() - Method in class dev.langchain4j.rag.query.Metadata
 
userMessage(Content...) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from contents.
userMessage(String) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a text.
userMessage(String, Content...) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and contents.
userMessage(String, String) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and a text.
userMessage(String, List<Content>) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and contents.
userMessage(List<Content>) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from contents.
UserMessage - Class in dev.langchain4j.data.message
Represents a message from a user, typically an end user of the application.
UserMessage(Content...) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from one or multiple Contents.
UserMessage(String) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a text.
UserMessage(String, Content...) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a name and one or multiple Contents.
UserMessage(String, String) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a name and a text.
UserMessage(String, List<Content>) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a name and a list of Contents.
UserMessage(List<Content>) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a list of Contents.
Utils - Class in dev.langchain4j.internal
Utility methods.

V

validateStructuredPrompt(Object) - Static method in class dev.langchain4j.model.input.structured.StructuredPrompt.Util
Validates that the given object is annotated with StructuredPrompt.
ValidationUtils - Class in dev.langchain4j.internal
Utility class for validating method arguments.
value() - Method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Get the value.
value() - Element in annotation type dev.langchain4j.agent.tool.P
Description of a parameter
value() - Element in annotation type dev.langchain4j.agent.tool.Tool
Description of the tool.
value() - Element in annotation type dev.langchain4j.model.input.structured.StructuredPrompt
Prompt template can be defined in one line or multiple lines.
value() - Element in annotation type dev.langchain4j.model.output.structured.Description
The description can be defined in one line or multiple lines.
valueOf(String) - Static method in enum dev.langchain4j.data.message.ChatMessageType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum dev.langchain4j.data.message.ContentType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum dev.langchain4j.data.message.ImageContent.DetailLevel
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum dev.langchain4j.model.output.FinishReason
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum dev.langchain4j.rag.query.router.LanguageModelQueryRouter.FallbackStrategy
Returns the enum constant of this type with the specified name.
values() - Static method in enum dev.langchain4j.data.message.ChatMessageType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum dev.langchain4j.data.message.ContentType
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum dev.langchain4j.data.message.ImageContent.DetailLevel
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum dev.langchain4j.model.output.FinishReason
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum dev.langchain4j.rag.query.router.LanguageModelQueryRouter.FallbackStrategy
Returns an array containing the constants of this enum type, in the order they are declared.
vector() - Method in class dev.langchain4j.data.embedding.Embedding
Returns the vector.
vectorAsList() - Method in class dev.langchain4j.data.embedding.Embedding
Returns a copy of the vector as a list.

W

withRetry(Callable<T>) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy
This method attempts to execute a given action up to a specified number of times with a 1-second delay.
withRetry(Callable<T>) - Static method in class dev.langchain4j.internal.RetryUtils
This method attempts to execute a given action up to a specified number of times with a 1-second delay.
withRetry(Callable<T>, int) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy
This method attempts to execute a given action up to a specified number of times with a 1-second delay.
withRetry(Callable<T>, int) - Static method in class dev.langchain4j.internal.RetryUtils
This method attempts to execute a given action up to a specified number of times with a 1-second delay.
A B C D E F G H I J K L M N O P Q R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form