30 lines
863 B
Python
30 lines
863 B
Python
from abc import ABC, abstractmethod
|
|
from typing import List, Dict, Optional
|
|
|
|
|
|
class ISpeakingService(ABC):
|
|
|
|
@abstractmethod
|
|
async def get_speaking_part(
|
|
self, part: int, topic: str, difficulty: str, second_topic: Optional[str] = None
|
|
) -> Dict:
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def grade_speaking_task(self, task: int, answers: List[Dict]) -> Dict:
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def create_videos_and_save_to_db(self, exercises: List[Dict], template: Dict, req_id: str):
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def generate_video(
|
|
self, part: int, avatar: str, topic: str, questions: list[str],
|
|
*,
|
|
second_topic: Optional[str] = None,
|
|
prompts: Optional[list[str]] = None,
|
|
suffix: Optional[str] = None,
|
|
):
|
|
pass
|