Class AbstractAzureCosmosDBNoSqlEmbeddingStore
java.lang.Object
dev.langchain4j.store.embedding.azure.cosmos.nosql.AbstractAzureCosmosDBNoSqlEmbeddingStore
- All Implemented Interfaces:
EmbeddingStore<TextSegment>
- Direct Known Subclasses:
AzureCosmosDBNoSqlContentRetriever, AzureCosmosDbNoSqlEmbeddingStore
public class AbstractAzureCosmosDBNoSqlEmbeddingStore
extends Object
implements EmbeddingStore<TextSegment>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Integerprotected static final Stringprotected static final AzureCosmosDBSearchQueryTypeprotected static final Integerprotected AzureCosmosDBNoSqlFilterMapperprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(Embedding embedding, TextSegment textSegment) add(TextSegment textSegment) voidvoidvoidclose()Closes the CosmosDB client and releases resources.voidfindRelevantWithFullTextRanking(String content, Integer maxResults, double minScore, Filter filter) findRelevantWithFullTextSearch(String content, Integer maxResults, double minScore, Filter filter) findRelevantWithHybridSearch(Embedding referenceEmbedding, String content, Integer maxResults, double minScore, Filter filter) protected voidinitialize(String endpoint, com.azure.core.credential.AzureKeyCredential keyCredential, com.azure.core.credential.TokenCredential tokenCredential, String databaseName, String containerName, String partitionKeyPath, com.azure.cosmos.models.IndexingPolicy indexingPolicy, com.azure.cosmos.models.CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy, com.azure.cosmos.models.CosmosFullTextPolicy cosmosFullTextPolicy, Integer vectorStoreThroughput, AzureCosmosDBSearchQueryType searchQueryType, AzureCosmosDBNoSqlFilterMapper filterMapper) voidvoidremoveAll(Collection<String> ids) search(EmbeddingSearchRequest request) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmbeddingStore
addAll, generateIds, removeAll, removeAll
-
Field Details
-
USER_AGENT
- See Also:
-
DEFAULT_DATABASE_NAME
- See Also:
-
DEFAULT_CONTAINER_NAME
- See Also:
-
DEFAULT_THROUGHPUT
-
DEFAULT_PARTITION_KEY_PATH
- See Also:
-
DEFAULT_SEARCH_QUERY_TYPE
-
DEFAULT_MAX_RESULTS
-
filterMapper
-
-
Constructor Details
-
AbstractAzureCosmosDBNoSqlEmbeddingStore
public AbstractAzureCosmosDBNoSqlEmbeddingStore()
-
-
Method Details
-
initialize
protected void initialize(String endpoint, com.azure.core.credential.AzureKeyCredential keyCredential, com.azure.core.credential.TokenCredential tokenCredential, String databaseName, String containerName, String partitionKeyPath, com.azure.cosmos.models.IndexingPolicy indexingPolicy, com.azure.cosmos.models.CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy, com.azure.cosmos.models.CosmosFullTextPolicy cosmosFullTextPolicy, Integer vectorStoreThroughput, AzureCosmosDBSearchQueryType searchQueryType, AzureCosmosDBNoSqlFilterMapper filterMapper) -
add
- Specified by:
addin interfaceEmbeddingStore<TextSegment>
-
add
- Specified by:
addin interfaceEmbeddingStore<TextSegment>
-
add
- Specified by:
addin interfaceEmbeddingStore<TextSegment>
-
add
-
addAll
- Specified by:
addAllin interfaceEmbeddingStore<TextSegment>
-
addAll
- Specified by:
addAllin interfaceEmbeddingStore<TextSegment>
-
remove
- Specified by:
removein interfaceEmbeddingStore<TextSegment>
-
removeAll
- Specified by:
removeAllin interfaceEmbeddingStore<TextSegment>
-
deleteContainer
public void deleteContainer() -
search
- Specified by:
searchin interfaceEmbeddingStore<TextSegment>
-
findRelevantWithFullTextSearch
public EmbeddingSearchResult<TextSegment> findRelevantWithFullTextSearch(String content, Integer maxResults, double minScore, Filter filter) -
findRelevantWithFullTextRanking
public EmbeddingSearchResult<TextSegment> findRelevantWithFullTextRanking(String content, Integer maxResults, double minScore, Filter filter) -
findRelevantWithHybridSearch
public EmbeddingSearchResult<TextSegment> findRelevantWithHybridSearch(Embedding referenceEmbedding, String content, Integer maxResults, double minScore, Filter filter) -
close
public void close()Closes the CosmosDB client and releases resources. This method should be called when the store is no longer needed to prevent resource leaks.
-