Async release
This commit is contained in:
19
app/dtos/__init__.py
Normal file
19
app/dtos/__init__.py
Normal 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
12
app/dtos/listening.py
Normal 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
34
app/dtos/speaking.py
Normal 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
8
app/dtos/training.py
Normal 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
6
app/dtos/writing.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class WritingGradeTaskDTO(BaseModel):
|
||||
question: str
|
||||
answer: str
|
||||
Reference in New Issue
Block a user