Improve REST API
This commit is contained in:
parent
6acfb6819e
commit
72e4950cd1
1 changed files with 344 additions and 1678907 deletions
34
great_ai/src/great_ai/great_ai/tracing/tracing_database.py
Normal file
34
great_ai/src/great_ai/great_ai/tracing/tracing_database.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from abc import ABC, abstractmethod
|
||||
from typing import List, Optional
|
||||
|
||||
from ..views import Filter, SortBy, Trace
|
||||
|
||||
|
||||
class TracingDatabase(ABC):
|
||||
is_threadsafe: bool
|
||||
|
||||
@abstractmethod
|
||||
def save(self, document: Trace) -> str:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get(self, id: str) -> Optional[Trace]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def query(
|
||||
self,
|
||||
skip: int = 0,
|
||||
take: Optional[int] = None,
|
||||
conjunctive_filters: List[Filter] = [],
|
||||
sort_by: List[SortBy] = [],
|
||||
) -> List[Trace]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def update(self, id: str, new_version: Trace) -> None:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def delete(self, id: str) -> None:
|
||||
pass
|
||||
Loading…
Reference in a new issue