Spaces:
Sleeping
Sleeping
# src/vectorstores/base_vectorstore.py | |
from abc import ABC, abstractmethod | |
from typing import List, Callable, Any | |
class BaseVectorStore(ABC): | |
def add_documents( | |
self, | |
documents: List[str], | |
embeddings: List[List[float]] | |
) -> None: | |
""" | |
Add documents to the vector store | |
Args: | |
documents (List[str]): List of document texts | |
embeddings (List[List[float]]): Corresponding embeddings | |
""" | |
pass | |
def similarity_search( | |
self, | |
query_embedding: List[float], | |
top_k: int = 3 | |
) -> List[str]: | |
""" | |
Perform similarity search | |
Args: | |
query_embedding (List[float]): Embedding of the query | |
top_k (int): Number of top similar documents to retrieve | |
Returns: | |
List[str]: List of most similar documents | |
""" | |
pass |