Package io.quarkiverse.langchain4j.redis
Class RedisEmbeddingStore
java.lang.Object
io.quarkiverse.langchain4j.redis.RedisEmbeddingStore
- All Implemented Interfaces:
dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
public class RedisEmbeddingStore
extends Object
implements dev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRedisEmbeddingStore
(io.quarkus.redis.datasource.ReactiveRedisDataSource ds, RedisSchema schema) -
Method Summary
Modifier and TypeMethodDescriptionadd
(dev.langchain4j.data.embedding.Embedding embedding) add
(dev.langchain4j.data.embedding.Embedding embedding, dev.langchain4j.data.segment.TextSegment textSegment) void
addAll
(List<dev.langchain4j.data.embedding.Embedding> embeddings, List<dev.langchain4j.data.segment.TextSegment> embedded) static RedisEmbeddingStore.Builder
builder()
void
Deletes all keys with the prefix that is used by this embedding store.List<dev.langchain4j.store.embedding.EmbeddingMatch<dev.langchain4j.data.segment.TextSegment>>
findRelevant
(dev.langchain4j.data.embedding.Embedding referenceEmbedding, int maxResults, double minScore) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.store.embedding.EmbeddingStore
findRelevant, findRelevant, findRelevant, search
-
Field Details
-
EXTRA_ATTRIBUTES
- See Also:
-
ID
- See Also:
-
-
Constructor Details
-
RedisEmbeddingStore
public RedisEmbeddingStore(io.quarkus.redis.datasource.ReactiveRedisDataSource ds, RedisSchema schema)
-
-
Method Details
-
builder
-
add
- Specified by:
add
in interfacedev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
-
add
- Specified by:
add
in interfacedev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
-
add
public String add(dev.langchain4j.data.embedding.Embedding embedding, dev.langchain4j.data.segment.TextSegment textSegment) - Specified by:
add
in interfacedev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
-
addAll
- Specified by:
addAll
in interfacedev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
-
addAll
public List<String> addAll(List<dev.langchain4j.data.embedding.Embedding> embeddings, List<dev.langchain4j.data.segment.TextSegment> embedded) - Specified by:
addAll
in interfacedev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
-
findRelevant
public List<dev.langchain4j.store.embedding.EmbeddingMatch<dev.langchain4j.data.segment.TextSegment>> findRelevant(dev.langchain4j.data.embedding.Embedding referenceEmbedding, int maxResults, double minScore) - Specified by:
findRelevant
in interfacedev.langchain4j.store.embedding.EmbeddingStore<dev.langchain4j.data.segment.TextSegment>
-
deleteAll
public void deleteAll()Deletes all keys with the prefix that is used by this embedding store.
-