Async release

This commit is contained in:
Carlos Mesquita
2024-07-23 08:40:35 +01:00
parent a4caecdb4f
commit 3cf9fa5cba
116 changed files with 5609 additions and 30630 deletions

19
app/dtos/__init__.py Normal file
View File

@@ -0,0 +1,19 @@
from .listening import SaveListeningDTO
from .speaking import (
SaveSpeakingDTO, SpeakingGradeTask1And2DTO,
SpeakingGradeTask3DTO, SpeakingGenerateVideoDTO,
SpeakingGenerateInteractiveVideoDTO
)
from .training import TipsDTO
from .writing import WritingGradeTaskDTO
__all__ = [
"SaveListeningDTO",
"SaveSpeakingDTO",
"SpeakingGradeTask1And2DTO",
"SpeakingGradeTask3DTO",
"SpeakingGenerateVideoDTO",
"SpeakingGenerateInteractiveVideoDTO",
"TipsDTO",
"WritingGradeTaskDTO"
]

12
app/dtos/listening.py Normal file
View File

@@ -0,0 +1,12 @@
import random
from typing import List, Dict
from pydantic import BaseModel
from app.configs.constants import MinTimers, EducationalContent
class SaveListeningDTO(BaseModel):
parts: List[Dict]
minTimer: int = MinTimers.LISTENING_MIN_TIMER_DEFAULT
difficulty: str = random.choice(EducationalContent.DIFFICULTIES)

34
app/dtos/speaking.py Normal file
View File

@@ -0,0 +1,34 @@
import random
from typing import List, Dict
from pydantic import BaseModel
from app.configs.constants import MinTimers, AvatarEnum
class SaveSpeakingDTO(BaseModel):
exercises: List[Dict]
minTimer: int = MinTimers.SPEAKING_MIN_TIMER_DEFAULT
class SpeakingGradeTask1And2DTO(BaseModel):
question: str
answer: str
class SpeakingGradeTask3DTO(BaseModel):
answers: Dict
class SpeakingGenerateVideoDTO(BaseModel):
avatar: str = (random.choice(list(AvatarEnum))).value
prompts: List[str] = []
question: str
topic: str
class SpeakingGenerateInteractiveVideoDTO(BaseModel):
avatar: str = (random.choice(list(AvatarEnum))).value
questions: List[str]
topic: str

8
app/dtos/training.py Normal file
View File

@@ -0,0 +1,8 @@
from pydantic import BaseModel
class TipsDTO(BaseModel):
context: str
question: str
answer: str
correct_answer: str

6
app/dtos/writing.py Normal file
View File

@@ -0,0 +1,6 @@
from pydantic import BaseModel
class WritingGradeTaskDTO(BaseModel):
question: str
answer: str