Embedded - The class of the object that has been embedded. Typically, this is TextSegment.public interface EmbeddingStore<Embedded>
| Modifier and Type | Method and Description |
|---|---|
String |
add(Embedding embedding)
Adds a given embedding to the store.
|
String |
add(Embedding embedding,
Embedded embedded)
Adds a given embedding and the corresponding content that has been embedded to the store.
|
void |
add(String id,
Embedding embedding)
Adds a given embedding to the store.
|
List<String> |
addAll(List<Embedding> embeddings)
Adds multiple embeddings to the store.
|
List<String> |
addAll(List<Embedding> embeddings,
List<Embedded> embedded)
Adds multiple embeddings and their corresponding contents that have been embedded to the store.
|
default List<EmbeddingMatch<Embedded>> |
findRelevant(Embedding referenceEmbedding,
int maxResults)
Finds the most relevant (closest in space) embeddings to the provided reference embedding.
|
List<EmbeddingMatch<Embedded>> |
findRelevant(Embedding referenceEmbedding,
int maxResults,
double minScore)
Finds the most relevant (closest in space) embeddings to the provided reference embedding.
|
String add(Embedding embedding)
embedding - The embedding to be added to the store.void add(String id, Embedding embedding)
id - The unique identifier for the embedding to be added.embedding - The embedding to be added to the store.String add(Embedding embedding, Embedded embedded)
embedding - The embedding to be added to the store.embedded - Original content that was embedded.List<String> addAll(List<Embedding> embeddings)
embeddings - A list of embeddings to be added to the store.List<String> addAll(List<Embedding> embeddings, List<Embedded> embedded)
embeddings - A list of embeddings to be added to the store.embedded - A list of original contents that were embedded.default List<EmbeddingMatch<Embedded>> findRelevant(Embedding referenceEmbedding, int maxResults)
referenceEmbedding - The embedding used as a reference. Returned embeddings should be relevant (closest) to this one.maxResults - The maximum number of embeddings to be returned.List<EmbeddingMatch<Embedded>> findRelevant(Embedding referenceEmbedding, int maxResults, double minScore)
referenceEmbedding - The embedding used as a reference. Returned embeddings should be relevant (closest) to this one.maxResults - The maximum number of embeddings to be returned.minScore - The minimum relevance score, ranging from 0 to 1 (inclusive).
Only embeddings with a score of this value or higher will be returned.Copyright © 2023. All rights reserved.