Brushed up the backend, added writing task 1 academic prompt gen and grading ENCOA-274
This commit is contained in:
17
ielts_be/dtos/reading.py
Normal file
17
ielts_be/dtos/reading.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import random
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ielts_be.configs.constants import ReadingExerciseType, EducationalContent
|
||||
|
||||
class ReadingExercise(BaseModel):
|
||||
type: ReadingExerciseType
|
||||
quantity: int
|
||||
num_random_words: Optional[int] = Field(1)
|
||||
max_words: Optional[int] = Field(3)
|
||||
|
||||
class ReadingDTO(BaseModel):
|
||||
text: str = Field(...)
|
||||
exercises: List[ReadingExercise] = Field(...)
|
||||
difficulty: str = Field(random.choice(EducationalContent.DIFFICULTIES))
|
||||
Reference in New Issue
Block a user