Remove unnecessary section id's from reading and listening to retrieve questions since context is already on the post dto
This commit is contained in:
@@ -92,6 +92,7 @@ class ListeningService(IListeningService):
|
||||
async def generate_listening_dialog(self, section: int, topic: str, difficulty: str):
|
||||
return await self._sections[f'section_{section}']["generate_dialogue"](section, topic)
|
||||
|
||||
# TODO: When mp3 editor
|
||||
async def get_dialog_from_audio(self, upload: UploadFile):
|
||||
ext, path_id = await FileHelper.save_upload(upload)
|
||||
dialog = await self._stt.speech_to_text(f'./tmp/{path_id}/upload.{ext}')
|
||||
@@ -100,8 +101,7 @@ class ListeningService(IListeningService):
|
||||
async def generate_mp3(self, dto: Dialog) -> bytes:
|
||||
return await self._tts.text_to_speech(dto)
|
||||
|
||||
async def get_listening_question(self, section: int, dto: GenerateListeningExercises):
|
||||
dialog_type = self._sections[f'section_{section}']["type"]
|
||||
async def get_listening_question(self, dto: GenerateListeningExercises):
|
||||
start_id = 1
|
||||
exercise_tasks = []
|
||||
|
||||
@@ -109,7 +109,7 @@ class ListeningService(IListeningService):
|
||||
exercise_tasks.append(
|
||||
self._generate_exercise(
|
||||
req_exercise,
|
||||
dialog_type,
|
||||
"dialog or monologue",
|
||||
dto.text,
|
||||
start_id,
|
||||
dto.difficulty
|
||||
|
||||
Reference in New Issue
Block a user