Updated this to the latest version of develop, got rid of most of the duplication, might be missing some packages in toml, needs testing
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List, Dict
|
||||
from typing import List, Dict, Optional
|
||||
|
||||
|
||||
class ISpeakingService(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_speaking_task(self, task_id: int, topic: str, difficulty: str):
|
||||
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_1_and_2(
|
||||
self, task: int, question: str, answer_firebase_path: str, sound_file_name: str
|
||||
):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def grade_speaking_task_3(self, answers: Dict, task: int = 3):
|
||||
async def grade_speaking_task(self, task: int, answers: List[Dict]) -> Dict:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
@@ -23,35 +19,11 @@ class ISpeakingService(ABC):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_speaking_video(self, original_question: str, topic: str, avatar: str, prompts: List[str]):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_interactive_video(self, questions: List[str], avatar: str, topic: str):
|
||||
pass
|
||||
|
||||
# ==================================================================================================================
|
||||
# Helpers
|
||||
# ==================================================================================================================
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def _zero_rating(comment: str):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def _calculate_overall(response: Dict):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def _get_speaking_corrections(self, text):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def _create_video_per_part(self, exercises: List[Dict], template: Dict, part: int):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def _create_video(self, question: str, avatar: str, error_message: str):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user