Brushed up the backend, added writing task 1 academic prompt gen and grading ENCOA-274

This commit is contained in:
Carlos-Mesquita
2024-12-10 22:24:40 +00:00
parent 68cab80851
commit 6982068864
167 changed files with 1411 additions and 1229 deletions

View File

@@ -0,0 +1,7 @@
from .file_storage import IFileStorage
from .document_store import IDocumentStore
__all__ = [
"IFileStorage",
"IDocumentStore"
]

View File

@@ -0,0 +1,18 @@
from abc import ABC
from typing import Dict, Optional, List
class IDocumentStore(ABC):
async def save_to_db(self, collection: str, item: Dict, doc_id: Optional[str] = None) -> Optional[str]:
pass
async def get_doc_by_id(self, collection: str, doc_id: str) -> Optional[Dict]:
pass
async def find(self, collection: str, query: Optional[Dict]) -> List[Dict]:
pass
async def update(self, collection: str, filter_query: Dict, update: Dict) -> Optional[str]:
pass

View File

@@ -0,0 +1,16 @@
from abc import ABC, abstractmethod
class IFileStorage(ABC):
@abstractmethod
async def download_firebase_file(self, source_blob_name, destination_file_name):
pass
@abstractmethod
async def upload_file_firebase_get_url(self, destination_blob_name, source_file_name):
pass
@abstractmethod
async def make_public(self, blob_name: str):
pass