Spaces:
Runtime error
Runtime error
from abc import ABC, abstractmethod | |
from typing import List | |
from phi.document import Document | |
class VectorDb(ABC): | |
"""Base class for managing Vector Databases""" | |
def create(self) -> None: | |
raise NotImplementedError | |
def doc_exists(self, document: Document) -> bool: | |
raise NotImplementedError | |
def name_exists(self, name: str) -> bool: | |
raise NotImplementedError | |
def insert(self, documents: List[Document]) -> None: | |
raise NotImplementedError | |
def upsert_available(self) -> bool: | |
return False | |
def upsert(self, documents: List[Document]) -> None: | |
raise NotImplementedError | |
def search(self, query: str, limit: int = 5) -> List[Document]: | |
raise NotImplementedError | |
def delete(self) -> None: | |
raise NotImplementedError | |
def exists(self) -> bool: | |
raise NotImplementedError | |
def optimize(self) -> None: | |
raise NotImplementedError | |
def clear(self) -> bool: | |
raise NotImplementedError | |