Skip navigation links
A B C D E F G H I J K L M N O P Q R S T U V W 

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(String, String) - Method in class dev.langchain4j.data.document.Metadata
Adds a key-value pair to the metadata.
add(String, Object) - Method in class dev.langchain4j.data.document.Metadata
Deprecated.
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(Embedding) - Method in interface dev.langchain4j.store.embedding.EmbeddingStore
Adds a given embedding to the store.
add(String, 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.
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
 
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.
aiMessage(String) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given text.
aiMessage(ToolExecutionRequest...) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
aiMessage(List<ToolExecutionRequest>) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
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.

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() - 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() - 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.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 - Interface in dev.langchain4j.model.chat
Represents a language model that has a chat interface.
ChatMemory - Interface in dev.langchain4j.memory
Represents the memory (history) of a chat conversation.
chatMemory() - Method in class dev.langchain4j.rag.query.Metadata
 
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
A serializer for ChatMessage objects.
ChatMessageType - Enum in dev.langchain4j.data.message
The type of content, e.g.
classify(String) - Method in interface dev.langchain4j.classification.TextClassifier
Classify the given text.
classify(TextSegment) - Method in interface dev.langchain4j.classification.TextClassifier
Classify the given TextSegment.
classify(Document) - Method in interface dev.langchain4j.classification.TextClassifier
Classify the given Document.
clear() - Method in interface dev.langchain4j.memory.ChatMemory
Clears the chat memory.
CodeExecutionEngine - Interface in dev.langchain4j.code
Interface for executing code.
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
 
Content - Interface in dev.langchain4j.data.message
Abstract base interface for message content.
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(String) - Constructor for class dev.langchain4j.rag.content.Content
 
Content(TextSegment) - Constructor for class dev.langchain4j.rag.content.Content
 
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 - Interface in dev.langchain4j.rag.content.retriever
Retrieves Contents from an underlying data source using a given Query.
contentRetriever(ContentRetriever) - Method in class dev.langchain4j.rag.DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder
 
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, String) - Method in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
createPrompt(Query) - Method in class dev.langchain4j.rag.query.transformer.ExpandingQueryTransformer
 

D

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(List<String>) - 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
 
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
 
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() - Method in class dev.langchain4j.agent.tool.ToolSpecification
Returns the description of the tool.
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.memory.chat - package dev.langchain4j.store.memory.chat
 
dimension() - Method in class dev.langchain4j.data.embedding.Embedding
Returns the dimension of the vector.
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.
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.
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 - Interface in dev.langchain4j.data.document
Defines the interface for splitting a document into text segments.
documentSplitter(DocumentSplitter) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the document splitter.
DocumentTransformer - Interface in dev.langchain4j.data.document
Defines the interface for transforming a Document.
documentTransformer(DocumentTransformer) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the document transformer.

E

edit(Image, String) - Method in interface dev.langchain4j.model.image.ImageModel
Given an existing image, edit this image following the given prompt.
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.
embed(String) - Method in interface dev.langchain4j.model.embedding.EmbeddingModel
Embed a text.
embed(TextSegment) - Method in interface dev.langchain4j.model.embedding.EmbeddingModel
Embed the text content of a TextSegment.
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 - 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.
embedding() - Method in class dev.langchain4j.store.embedding.EmbeddingMatch
Returns the embedding that has been matched.
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 - Interface in dev.langchain4j.model.embedding
Represents a model that can convert a given text into an embedding (vector representation of the text).
embeddingModel(EmbeddingModel) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the embedding model.
EmbeddingStore<Embedded> - Interface in dev.langchain4j.store.embedding
Represents a store for embeddings, also known as a vector database.
embeddingStore(EmbeddingStore<TextSegment>) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the embedding store.
EmbeddingStoreContentRetriever - Class in dev.langchain4j.rag.content.retriever
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
 
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(T, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given collection is not null and not empty.
ensureNotEmpty(Map<K, V>, String) - Static method in class dev.langchain4j.internal.ValidationUtils
Ensures that the given map 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(String...) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "enum" and value enumValues.
enums(Object...) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "enum" and value enumValues.
enums(Class<?>) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key "enum" and values taken from enumClass.
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(String) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified text.
estimateTokenCount(UserMessage) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified message.
estimateTokenCount(Prompt) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified prompt.
estimateTokenCount(TextSegment) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified text segment.
estimateTokenCount(List<ChatMessage>) - Method in interface dev.langchain4j.model.chat.TokenCountEstimator
Estimates the count of tokens in the specified list of messages.
estimateTokenCount(String) - Method in interface dev.langchain4j.model.embedding.TokenCountEstimator
Estimates the count of tokens in the given text.
estimateTokenCount(TextSegment) - Method in interface dev.langchain4j.model.embedding.TokenCountEstimator
Estimates the count of tokens in the given text segment.
estimateTokenCount(List<TextSegment>) - Method in interface dev.langchain4j.model.embedding.TokenCountEstimator
Estimates the count of tokens in the given text segments.
estimateTokenCount(String) - Method in interface dev.langchain4j.model.language.TokenCountEstimator
Estimates the count of tokens in the given text.
estimateTokenCount(Prompt) - Method in interface dev.langchain4j.model.language.TokenCountEstimator
Estimates the count of tokens in the given prompt.
estimateTokenCount(TextSegment) - Method in interface dev.langchain4j.model.language.TokenCountEstimator
Estimates the count of tokens in the given text segment.
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(Object) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in Tool annotations of the given object.
estimateTokenCountInTools(Iterable<Object>) - Method in interface dev.langchain4j.model.Tokenizer
Estimates the count of tokens in Tool annotations of the given objects.
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
 

F

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.
findRelevant(String) - Method in interface dev.langchain4j.retriever.Retriever
Deprecated.
Find relevant items for the given text.
findRelevant(Object, String) - Method in interface dev.langchain4j.retriever.Retriever
Deprecated.
Find relevant items for the given text and memoryId.
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.
FinishReason - Enum in dev.langchain4j.model.output
The reason why a model call finished.
finishReason() - Method in class dev.langchain4j.model.output.Response
Get the finish reason.
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(List<Content>) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
format(Content) - Method in class dev.langchain4j.rag.content.injector.DefaultContentInjector
 
format(Metadata) - 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(ChatMessage) - Method in class dev.langchain4j.rag.query.transformer.CompressingQueryTransformer
 
formatInstructions() - Method in interface dev.langchain4j.model.output.OutputParser
Description of the text format.
from(String, Object) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key and value.
from(String) - 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.document.Document
Creates a new Document from the given text.
from(String, String) - Static method in class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a single key-value pair.
from(String, Object) - Static method in class dev.langchain4j.data.document.Metadata
Deprecated.
from(Map<String, String>) - Static method in class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a map of key-value pairs.
from(float[]) - Static method in class dev.langchain4j.data.embedding.Embedding
Creates a new Embedding from the given vector.
from(List<Float>) - Static method in class dev.langchain4j.data.embedding.Embedding
Creates a new Embedding from the given vector.
from(String) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given text.
from(ToolExecutionRequest...) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
from(List<ToolExecutionRequest>) - Static method in class dev.langchain4j.data.message.AiMessage
Create a new AiMessage with the given tool execution requests.
from(URI) - 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.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(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, 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, ImageContent.DetailLevel) - Static method in class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given base64 data and mime type.
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(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(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(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) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a text.
from(String, String) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and a text.
from(Content...) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from contents.
from(String, Content...) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and contents.
from(List<Content>) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from contents.
from(String, List<Content>) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and contents.
from(String) - Static method in class dev.langchain4j.data.segment.TextSegment
Creates a new text segment.
from(String, Metadata) - 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(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.
from(String) - Static method in class dev.langchain4j.rag.content.Content
 
from(TextSegment) - Static method in class dev.langchain4j.rag.content.Content
 
from(UserMessage, Object, List<ChatMessage>) - Static method in class dev.langchain4j.rag.query.Metadata
 
from(String) - Static method in class dev.langchain4j.rag.query.Query
 
from(String, Metadata) - Static method in class dev.langchain4j.rag.query.Query
 
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(Map<Query, Collection<List<Content>>>) - Method in class dev.langchain4j.rag.content.aggregator.DefaultContentAggregator
 
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.ReRankingContentAggregator
 

G

generate(String) - Method in interface dev.langchain4j.model.chat.ChatLanguageModel
Generates a response from the model based on a message from a user.
generate(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 interface dev.langchain4j.model.chat.ChatLanguageModel
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>, 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(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(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>, 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.
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(String) - Method in interface dev.langchain4j.model.image.ImageModel
Given a prompt, generate an image.
generate(String, int) - Method in interface dev.langchain4j.model.image.ImageModel
Given a prompt, generate n images.
generate(String) - Method in interface dev.langchain4j.model.language.LanguageModel
Generate a response to the given prompt.
generate(Prompt) - Method in interface dev.langchain4j.model.language.LanguageModel
Generate a response to the given prompt.
generate(String, StreamingResponseHandler<String>) - Method in interface dev.langchain4j.model.language.StreamingLanguageModel
Generates a response from the model based on a prompt.
generate(Prompt, StreamingResponseHandler<String>) - Method in interface dev.langchain4j.model.language.StreamingLanguageModel
Generates a response from the model based on a prompt.
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.
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, T) - Static method in class dev.langchain4j.internal.Utils
Returns the given value if it is not null, otherwise returns the given default value.
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.
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 has a single text content.
hasToolExecutionRequests() - Method in class dev.langchain4j.data.message.AiMessage
Check if the message has ToolExecutionRequests.

I

id(String) - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest.Builder
Sets the id.
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.
illegalArgument(String, Object...) - Static method in class dev.langchain4j.internal.Exceptions
Constructs an IllegalArgumentException with the given formatted result.
Image - Class in dev.langchain4j.data.image
Represents an image.
image() - Method in class dev.langchain4j.data.message.ImageContent
Get the Image.
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(URI) - Constructor for class dev.langchain4j.data.message.ImageContent
Create a new ImageContent from the given url.
ImageContent(String) - 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(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(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.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".
isCollectionEmpty(Collection<?>) - Static method in class dev.langchain4j.internal.Utils
Deprecated.
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.

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) - Constructor for class dev.langchain4j.rag.query.router.LanguageModelQueryRouter
 
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.
loadFactoryService(Class<F>, Function<F, T>, Supplier<T>) - Static method in class dev.langchain4j.spi.ServiceHelper
Load a service provided by a service factory.
loadFactoryService(Class<F>, Supplier<T>) - Static method in class dev.langchain4j.spi.ServiceHelper
Load a service provided by a service factory where the factory is itself a Supplier.
loadService(Class<F>, Supplier<F>) - Static method in class dev.langchain4j.spi.ServiceHelper
Load a service.

M

MAP_TYPE - Static variable in class dev.langchain4j.agent.tool.ToolExecutionRequestUtil
Utility TypeToken describing Map<String, Object>.
maxAttempts(int) - Method in class dev.langchain4j.internal.RetryUtils.RetryPolicy.Builder
Sets the default maximum number of attempts.
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(String) - Method in class dev.langchain4j.data.document.Document
Looks up the metadata value for the given key.
metadata() - Method in interface dev.langchain4j.data.document.DocumentSource
Returns the metadata associated with the source of the document.
Metadata - Class in dev.langchain4j.data.document
Represents metadata of a Document or a TextSegment.
Metadata() - Constructor for class dev.langchain4j.data.document.Metadata
Construct a Metadata object with an empty map of key-value pairs.
Metadata(Map<String, String>) - Constructor for class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a map of key-value pairs.
metadata(String, String) - Static method in class dev.langchain4j.data.document.Metadata
Constructs a Metadata object from a single key-value pair.
metadata(String, Object) - Static method in class dev.langchain4j.data.document.Metadata
Deprecated.
metadata() - Method in class dev.langchain4j.data.segment.TextSegment
Returns the metadata.
metadata(String) - Method in class dev.langchain4j.data.segment.TextSegment
Returns the metadata value for the given key.
Metadata - Class in dev.langchain4j.rag.query
Represents metadata that may be useful or necessary for retrieval or augmentation purposes.
Metadata(UserMessage, Object, List<ChatMessage>) - Constructor for class dev.langchain4j.rag.query.Metadata
 
metadata() - Method in class dev.langchain4j.rag.query.Query
 
MightChangeInTheFuture - Annotation Type in dev.langchain4j
Indicates that a class/constructor/method is experimental and might change in the future.
mimeType(String) - Method in class dev.langchain4j.data.image.Image.Builder
Set the mime type of the image.
mimeType() - Method in class dev.langchain4j.data.image.Image
Get the mime type of the image.
moderate(String) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given text.
moderate(Prompt) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given prompt.
moderate(ChatMessage) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given chat message.
moderate(List<ChatMessage>) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given list of chat messages.
moderate(TextSegment) - Method in interface dev.langchain4j.model.moderation.ModerationModel
Moderates the given text segment.
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

name(String) - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest.Builder
Sets the name.
name() - Method in class dev.langchain4j.agent.tool.ToolExecutionRequest
Returns the name of the tool.
name(String) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Sets the name.
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.
normalize() - Method in class dev.langchain4j.data.embedding.Embedding
Normalize vector
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.
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(ToolParameters) - Method in class dev.langchain4j.agent.tool.ToolSpecification.Builder
Sets the parameters.
parameters() - Method in class dev.langchain4j.agent.tool.ToolSpecification
Returns the parameters of the tool.
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
 
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 - 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(Map<String, Map<String, Object>>) - Method in class dev.langchain4j.agent.tool.ToolParameters.Builder
Sets the properties.
properties() - Method in class dev.langchain4j.agent.tool.ToolParameters
Returns the properties of the tool.
property(String, Object) - Static method in class dev.langchain4j.agent.tool.JsonSchemaProperty
Construct a property with key and value.

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
 
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(List<String>) - Method in class dev.langchain4j.agent.tool.ToolParameters.Builder
Sets the required.
required() - Method in class dev.langchain4j.agent.tool.ToolParameters
Returns the required properties of the tool.
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(String) - Method in class dev.langchain4j.data.image.Image.Builder
Set the revised prompt of the image.
revisedPrompt() - Method in class dev.langchain4j.data.image.Image
Get the revised prompt of the image.
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.
runtime(String, Object...) - Static method in class dev.langchain4j.internal.Exceptions
Constructs an RuntimeException with the given formatted result.

S

score(String, String) - Method in interface dev.langchain4j.model.scoring.ScoringModel
Scores a given text against a given query.
score(TextSegment, String) - Method in interface dev.langchain4j.model.scoring.ScoringModel
Scores a given TextSegment against a given query.
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.
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.
ServiceHelper - Class in dev.langchain4j.spi
Utility wrapper around ServiceLoader.load().
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.
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.
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.
systemMessage(String) - Static method in class dev.langchain4j.data.message.SystemMessage
Creates a new system message.

T

template() - Method in class dev.langchain4j.model.input.PromptTemplate
 
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
Deprecated.
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
 
TextClassifier<E extends Enum<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 - 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.
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() - Method in class dev.langchain4j.rag.content.Content
 
TextSegmentTransformer - Interface in dev.langchain4j.data.segment
Defines the interface for transforming a TextSegment.
textSegmentTransformer(TextSegmentTransformer) - Method in class dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
Sets the text segment transformer.
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.
Tool - Annotation Type in dev.langchain4j.agent.tool
Java methods annotated with @Tool are considered tools that language model can use.
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 - 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
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.
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(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.
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
 

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 - Static variable in class dev.langchain4j.data.document.Document
Common metadata key for the URL from which the document was loaded.
url(URI) - Method in class dev.langchain4j.data.image.Image.Builder
Set the url of the image.
url(String) - Method in class dev.langchain4j.data.image.Image.Builder
Set the url of the image.
url() - Method in class dev.langchain4j.data.image.Image
Get the url of the image.
UserMessage - Class in dev.langchain4j.data.message
Represents a message from a user, typically an end user of the application.
UserMessage(String) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a text.
UserMessage(String, String) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a name and a text.
UserMessage(Content...) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from contents.
UserMessage(String, Content...) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a name and contents.
UserMessage(List<Content>) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from contents.
UserMessage(String, List<Content>) - Constructor for class dev.langchain4j.data.message.UserMessage
Creates a UserMessage from a name and contents.
userMessage(String) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a text.
userMessage(String, String) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and a text.
userMessage(Content...) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from contents.
userMessage(String, 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(String, List<Content>) - Static method in class dev.langchain4j.data.message.UserMessage
Create a UserMessage from a name and contents.
userMessage() - Method in class dev.langchain4j.rag.query.Metadata
 
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.
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.
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.
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

WillChangeSoon - Annotation Type in dev.langchain4j
Indicates that a class/constructor/method is planned to change soon.
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>, 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.
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.
A B C D E F G H I J K L M N O P Q R S T U V W 
Skip navigation links

Copyright © 2024. All rights reserved.