cognee/cognitive_architecture/infrastructure/databases/relational/relational_db_interface.py
Boris Arzentar 769d6b5080 feat: add create-memory and remember API endpoints
Add possibility to create a new Vector memory and store text data points using openai embeddings.
2024-02-25 23:56:50 +01:00

26 lines
1,006 B
Python

from abc import abstractmethod
from typing import Protocol, TypeVar, Type, List
RowDataType = TypeVar('RowDataType')
class RelationalDBInterface(Protocol):
@abstractmethod
async def create_database(self, database_name: str, database_path: str): raise NotImplementedError
@abstractmethod
async def create_table(self, table_name: str, table_config: object): raise NotImplementedError
@abstractmethod
async def add_row(self, table_name: str, row_data: Type[RowDataType]): raise NotImplementedError
@abstractmethod
async def add_rows(self, table_name: str, rows_data: List[Type[RowDataType]]): raise NotImplementedError
@abstractmethod
async def get_row(self, table_name: str, row_id: str): raise NotImplementedError
@abstractmethod
async def update_row(self, table_name: str, row_id: str, row_data: Type[RowDataType]): raise NotImplementedError
@abstractmethod
async def delete_row(self, table_name: str, row_id: str): raise NotImplementedError