Uses of Class
dev.langchain4j.data.segment.TextSegment
Package
Description
-
Uses of TextSegment in dev.langchain4j.chain
Modifier and TypeMethodDescriptionConversationalRetrievalChain.Builder.retriever
(Retriever<TextSegment> retriever) Deprecated, for removal: This API element is subject to removal in a future version.ModifierConstructorDescriptionConversationalRetrievalChain
(ChatLanguageModel chatLanguageModel, ChatMemory chatMemory, PromptTemplate promptTemplate, Retriever<TextSegment> retriever) Deprecated, for removal: This API element is subject to removal in a future version.Please use another constructor with a newContentRetriever
instead. -
Uses of TextSegment in dev.langchain4j.classification
Modifier and TypeMethodDescriptionTextClassifier.classify
(TextSegment textSegment) Classifies the givenTextSegment
.default ClassificationResult
<L> TextClassifier.classifyWithScores
(TextSegment textSegment) Classifies the givenTextSegment
and returns labels with scores. -
Uses of TextSegment in dev.langchain4j.data.document
Modifier and TypeMethodDescriptionDocument.toTextSegment()
Builds a TextSegment from this document.Modifier and TypeMethodDescriptionSplits a single Document into a list of TextSegment objects.default List
<TextSegment> Splits a list of Documents into a list of TextSegment objects. -
Uses of TextSegment in dev.langchain4j.data.document.splitter
Modifier and TypeMethodDescription -
Uses of TextSegment in dev.langchain4j.data.segment
Modifier and TypeMethodDescriptionstatic TextSegment
Creates a new text segment.static TextSegment
Creates a new text segment.static TextSegment
TextSegment.textSegment
(String text) Creates a new text segment.static TextSegment
TextSegment.textSegment
(String text, Metadata metadata) Creates a new text segment.TextSegmentTransformer.transform
(TextSegment segment) Transforms a provided segment.Modifier and TypeMethodDescriptiondefault List
<TextSegment> TextSegmentTransformer.transformAll
(List<TextSegment> segments) Transforms all the provided segments.Modifier and TypeMethodDescriptionTextSegmentTransformer.transform
(TextSegment segment) Transforms a provided segment.Modifier and TypeMethodDescriptiondefault List
<TextSegment> TextSegmentTransformer.transformAll
(List<TextSegment> segments) Transforms all the provided segments. -
Uses of TextSegment in dev.langchain4j.model.azure
-
Uses of TextSegment in dev.langchain4j.model.bedrock
Modifier and TypeMethodDescriptionBedrockTitanEmbeddingModel.getRequestParameters
(List<TextSegment> textSegments) -
Uses of TextSegment in dev.langchain4j.model.bedrock.internal
Modifier and TypeMethodDescriptionAbstractBedrockEmbeddingModel.embedAll
(List<TextSegment> textSegments) AbstractBedrockEmbeddingModel.getRequestParameters
(List<TextSegment> textSegments) Get request body -
Uses of TextSegment in dev.langchain4j.model.chat
Modifier and TypeMethodDescriptiondefault int
TokenCountEstimator.estimateTokenCount
(TextSegment textSegment) Estimates the count of tokens in the specified text segment. -
Uses of TextSegment in dev.langchain4j.model.cohere
-
Uses of TextSegment in dev.langchain4j.model.embedding
Modifier and TypeMethodDescriptionDisabledEmbeddingModel.embed
(TextSegment textSegment) EmbeddingModel.embed
(TextSegment textSegment) Embed the text content of a TextSegment.default int
TokenCountEstimator.estimateTokenCount
(TextSegment textSegment) Estimates the count of tokens in the given text segment.Modifier and TypeMethodDescriptionDisabledEmbeddingModel.embedAll
(List<TextSegment> textSegments) EmbeddingModel.embedAll
(List<TextSegment> textSegments) Embeds the text content of a list of TextSegments.default int
TokenCountEstimator.estimateTokenCount
(List<TextSegment> textSegments) Estimates the count of tokens in the given text segments. -
Uses of TextSegment in dev.langchain4j.model.github
-
Uses of TextSegment in dev.langchain4j.model.googleai
-
Uses of TextSegment in dev.langchain4j.model.huggingface
-
Uses of TextSegment in dev.langchain4j.model.jina
-
Uses of TextSegment in dev.langchain4j.model.jlama
-
Uses of TextSegment in dev.langchain4j.model.language
Modifier and TypeMethodDescriptiondefault int
TokenCountEstimator.estimateTokenCount
(TextSegment textSegment) Estimates the count of tokens in the given text segment. -
Uses of TextSegment in dev.langchain4j.model.localai
-
Uses of TextSegment in dev.langchain4j.model.mistralai
-
Uses of TextSegment in dev.langchain4j.model.moderation
Modifier and TypeMethodDescriptionDisabledModerationModel.moderate
(TextSegment textSegment) default Response
<Moderation> ModerationModel.moderate
(TextSegment textSegment) Moderates the given text segment. -
Uses of TextSegment in dev.langchain4j.model.nomic
-
Uses of TextSegment in dev.langchain4j.model.ollama
-
Uses of TextSegment in dev.langchain4j.model.openai
-
Uses of TextSegment in dev.langchain4j.model.ovhai
-
Uses of TextSegment in dev.langchain4j.model.scoring
Modifier and TypeMethodDescriptionScoringModel.score
(TextSegment segment, String query) Scores a givenTextSegment
against a given query.Modifier and TypeMethodDescriptionScoringModel.scoreAll
(List<TextSegment> segments, String query) Scores all providedTextSegment
s against a given query. -
Uses of TextSegment in dev.langchain4j.model.vertexai
Modifier and TypeMethodDescriptionVertexAiEmbeddingModel.calculateTokensCounts
(List<TextSegment> segments) Calculates the number of tokens for each segment in the input list.VertexAiEmbeddingModel.embedAll
(List<TextSegment> segments) VertexAiScoringModel.scoreAll
(List<TextSegment> segments, String query) Scores all providedTextSegment
s against a given query. -
Uses of TextSegment in dev.langchain4j.model.voyageai
-
Uses of TextSegment in dev.langchain4j.model.workersai
Modifier and TypeMethodDescriptionWorkersAiEmbeddingModel.embed
(TextSegment textSegment) Embed the text content of a TextSegment. -
Uses of TextSegment in dev.langchain4j.rag.content
-
Uses of TextSegment in dev.langchain4j.rag.content.retriever
Modifier and TypeMethodDescriptionEmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder.embeddingStore
(EmbeddingStore<TextSegment> embeddingStore) EmbeddingStoreContentRetriever.from
(EmbeddingStore<TextSegment> embeddingStore) Creates an instance of anEmbeddingStoreContentRetriever
from the specifiedEmbeddingStore
andEmbeddingModel
found through SPI (seeEmbeddingModelFactory
).ModifierConstructorDescriptionEmbeddingStoreContentRetriever
(EmbeddingStore<TextSegment> embeddingStore, EmbeddingModel embeddingModel) EmbeddingStoreContentRetriever
(EmbeddingStore<TextSegment> embeddingStore, EmbeddingModel embeddingModel, int maxResults) EmbeddingStoreContentRetriever
(EmbeddingStore<TextSegment> embeddingStore, EmbeddingModel embeddingModel, Integer maxResults, Double minScore) -
Uses of TextSegment in dev.langchain4j.rag.content.retriever.azure.search
Modifier and TypeMethodDescriptionvoid
AzureAiSearchContentRetriever.add
(TextSegment segment) AddTextSegment
to the full text search engine.Modifier and TypeMethodDescriptionvoid
AzureAiSearchContentRetriever.add
(List<TextSegment> segments) Add a list ofTextSegment
s to the full text search engine. -
Uses of TextSegment in dev.langchain4j.retriever
Modifier and TypeMethodDescriptionEmbeddingStoreRetriever.findRelevant
(String text) Deprecated, for removal: This API element is subject to removal in a future version.Modifier and TypeMethodDescriptionstatic EmbeddingStoreRetriever
EmbeddingStoreRetriever.from
(EmbeddingStore<TextSegment> embeddingStore, EmbeddingModel embeddingModel) Deprecated, for removal: This API element is subject to removal in a future version.static EmbeddingStoreRetriever
EmbeddingStoreRetriever.from
(EmbeddingStore<TextSegment> embeddingStore, EmbeddingModel embeddingModel, int maxResults) Deprecated, for removal: This API element is subject to removal in a future version.static EmbeddingStoreRetriever
EmbeddingStoreRetriever.from
(EmbeddingStore<TextSegment> embeddingStore, EmbeddingModel embeddingModel, int maxResults, double minScore) Deprecated, for removal: This API element is subject to removal in a future version.ModifierConstructorDescriptionEmbeddingStoreRetriever
(EmbeddingStore<TextSegment> embeddingStore, EmbeddingModel embeddingModel, int maxResults, Double minScore) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of TextSegment in dev.langchain4j.service
Modifier and TypeMethodDescriptionAiServices.retriever
(Retriever<TextSegment> retriever) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of TextSegment in dev.langchain4j.store.embedding
Modifier and TypeMethodDescriptionEmbeddingStoreIngestor.Builder.embeddingStore
(EmbeddingStore<TextSegment> embeddingStore) Sets the embedding store.static IngestionResult
EmbeddingStoreIngestor.ingest
(Document document, EmbeddingStore<TextSegment> embeddingStore) Ingests a specifiedDocument
into a specifiedEmbeddingStore
.static IngestionResult
EmbeddingStoreIngestor.ingest
(List<Document> documents, EmbeddingStore<TextSegment> embeddingStore) Ingests specifiedDocument
s into a specifiedEmbeddingStore
.ModifierConstructorDescriptionEmbeddingStoreIngestor
(DocumentTransformer documentTransformer, DocumentSplitter documentSplitter, TextSegmentTransformer textSegmentTransformer, EmbeddingModel embeddingModel, EmbeddingStore<TextSegment> embeddingStore) Creates an instance of anEmbeddingStoreIngestor
. -
Uses of TextSegment in dev.langchain4j.store.embedding.astradb
Modifier and TypeMethodDescriptionAstraDbEmbeddingStore.findRelevant
(Embedding referenceEmbedding, int maxResults, double minScore) Finds the most relevant (closest in space) embeddings to the provided reference embedding.AstraDbEmbeddingStore.findRelevant
(Embedding referenceEmbedding, io.stargate.sdk.data.domain.query.Filter metaDatafilter, int maxResults, double minScore) Semantic search with metadata filtering.Modifier and TypeMethodDescriptionAstraDbEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) Adds a given embedding and the corresponding content that has been embedded to the store. -
Uses of TextSegment in dev.langchain4j.store.embedding.azure.cosmos.mongo.vcore
Modifier and TypeMethodDescriptionAzureCosmosDbMongoVCoreEmbeddingStore.findRelevant
(Embedding referenceEmbedding, int maxResults, double minScore) Modifier and TypeMethodDescriptionAzureCosmosDbMongoVCoreEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.azure.cosmos.nosql
Modifier and TypeMethodDescriptionAzureCosmosDbNoSqlEmbeddingStore.findRelevant
(Embedding referenceEmbedding, int maxResults, double minScore) Modifier and TypeMethodDescriptionAzureCosmosDbNoSqlEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.azure.search
Modifier and TypeMethodDescriptionprotected List
<EmbeddingMatch<TextSegment>> AbstractAzureAiSearchEmbeddingStore.getEmbeddingMatches
(com.azure.search.documents.util.SearchPagedIterable searchResults, Double minScore, AzureAiSearchQueryType azureAiSearchQueryType) AbstractAzureAiSearchEmbeddingStore.search
(EmbeddingSearchRequest request) Modifier and TypeMethodDescriptionAbstractAzureAiSearchEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) Add an embedding and the related content to the store. -
Uses of TextSegment in dev.langchain4j.store.embedding.cassandra
Modifier and TypeMethodDescriptionCassandraEmbeddingStore.findRelevant
(Embedding embedding, int maxResults, double minScore) Search for relevant.CassandraEmbeddingStore.findRelevant
(Embedding embedding, int maxResults, double minScore, Metadata metadata) Similarity Search ANN based on the embedding.Modifier and TypeMethodDescriptionCassandraEmbeddingStore.add
(@NonNull Embedding embedding, TextSegment textSegment) Add a new embedding to the store. -
Uses of TextSegment in dev.langchain4j.store.embedding.chroma
Modifier and TypeMethodDescriptionChromaEmbeddingStore.findRelevant
(Embedding referenceEmbedding, int maxResults, double minScore) ChromaEmbeddingStore.search
(EmbeddingSearchRequest request) Modifier and TypeMethodDescriptionChromaEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.coherence
Modifier and TypeMethodDescriptionCoherenceEmbeddingStore.add
(Embedding embedding, TextSegment segment) -
Uses of TextSegment in dev.langchain4j.store.embedding.couchbase
Modifier and TypeMethodDescriptionCouchbaseEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.elasticsearch
Modifier and TypeMethodDescriptionElasticsearchEmbeddingStore.search
(EmbeddingSearchRequest embeddingSearchRequest) Modifier and TypeMethodDescriptionElasticsearchEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.infinispan
Modifier and TypeMethodDescriptionInfinispanEmbeddingStore.search
(EmbeddingSearchRequest request) Modifier and TypeMethodDescriptionInfinispanEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.inmemory
Modifier and TypeMethodDescriptionstatic InMemoryEmbeddingStore
<TextSegment> static InMemoryEmbeddingStore
<TextSegment> static InMemoryEmbeddingStore
<TextSegment> -
Uses of TextSegment in dev.langchain4j.store.embedding.milvus
Modifier and TypeMethodDescriptionMilvusEmbeddingStore.search
(EmbeddingSearchRequest embeddingSearchRequest) Modifier and TypeMethodDescriptionMilvusEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.mongodb
Modifier and TypeMethodDescriptionMongoDbEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.neo4j
Modifier and TypeMethodDescriptionNeo4jEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.opensearch
Modifier and TypeMethodDescriptionOpenSearchEmbeddingStore.search
(EmbeddingSearchRequest request) This implementation uses the exact k-NN with scoring script to calculate See https://opensearch.org/docs/latest/search-plugins/knn/knn-score-script/Modifier and TypeMethodDescriptionOpenSearchEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.oracle
Modifier and TypeMethodDescriptionOracleEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.pgvector
Modifier and TypeMethodDescriptionPgVectorEmbeddingStore.search
(EmbeddingSearchRequest request) Searches for the most similar (closest in the embedding space)Embedding
s.Modifier and TypeMethodDescriptionPgVectorEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) Adds a given embedding and the corresponding content that has been embedded to the store. -
Uses of TextSegment in dev.langchain4j.store.embedding.pinecone
Modifier and TypeMethodDescriptionPineconeEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.qdrant
Modifier and TypeMethodDescriptionQdrantEmbeddingStore.findRelevant
(Embedding referenceEmbedding, int maxResults, double minScore) QdrantEmbeddingStore.search
(EmbeddingSearchRequest request) Modifier and TypeMethodDescriptionQdrantEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.redis
Modifier and TypeMethodDescriptionRedisEmbeddingStore.findRelevant
(Embedding referenceEmbedding, int maxResults, double minScore) Modifier and TypeMethodDescriptionRedisEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.tablestore
Modifier and TypeMethodDescriptionTablestoreEmbeddingStore.search
(EmbeddingSearchRequest request) Modifier and TypeMethodDescriptionTablestoreEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) protected void
TablestoreEmbeddingStore.innerAdd
(String id, Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.vespa
Modifier and TypeMethodDescriptionVespaEmbeddingStore.findRelevant
(Embedding referenceEmbedding, int maxResults, double minScore) Finds the most relevant (closest in space) embeddings to the provided reference embedding.Modifier and TypeMethodDescriptionVespaEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.store.embedding.weaviate
Modifier and TypeMethodDescriptionWeaviateEmbeddingStore.search
(EmbeddingSearchRequest request) Searches for the most similar (closest in the embedding space)Embedding
s.Modifier and TypeMethodDescriptionWeaviateEmbeddingStore.add
(Embedding embedding, TextSegment textSegment) -
Uses of TextSegment in dev.langchain4j.web.search
Modifier and TypeMethodDescriptionWebSearchOrganicResult.toTextSegment()
Converts this WebSearchOrganicResult to a TextSegment.Modifier and TypeMethodDescriptionWebSearchResults.toTextSegments()
Converts the organic search results to a list of text segments.
ConversationalRetrievalChain.Builder.contentRetriever(ContentRetriever)
instead.