Spaces:
Sleeping
Sleeping
| from abc import ABC, abstractmethod | |
| from typing import Optional, List | |
| from phi.memory.row import MemoryRow | |
| class MemoryDb(ABC): | |
| """Base class for the Memory Database.""" | |
| def create(self) -> None: | |
| raise NotImplementedError | |
| def memory_exists(self, memory: MemoryRow) -> bool: | |
| raise NotImplementedError | |
| def read_memories( | |
| self, user_id: Optional[str] = None, limit: Optional[int] = None, sort: Optional[str] = None | |
| ) -> List[MemoryRow]: | |
| raise NotImplementedError | |
| def upsert_memory(self, memory: MemoryRow) -> Optional[MemoryRow]: | |
| raise NotImplementedError | |
| def delete_memory(self, id: str) -> None: | |
| raise NotImplementedError | |
| def drop_table(self) -> None: | |
| raise NotImplementedError | |
| def table_exists(self) -> bool: | |
| raise NotImplementedError | |
| def clear(self) -> bool: | |
| raise NotImplementedError | |