Files
task-69dd4221f309a98be0006b2e/models.py
T
2026-05-27 13:54:50 +00:00

45 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
Pydantic model representing a structured assignment card.
Fields:
- title: short title of the task (string)
- subject: main topic or subject area (string, optional)
- deadline_hint: freeform hint about due date (string, optional)
- deliverable_type: what is expected to be submitted (string, optional)
- grading_hints: list of strings describing evaluation criteria (list[str], optional)
"""
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel, Field
class AssignmentCard(BaseModel):
"""Structured representation of an informal assignment description."""
title: str = Field(..., description="Short title or main action of the task")
subject: Optional[str] = Field(None, description="Primary subject or topic of the task")
deadline_hint: Optional[str] = Field(
None,
description="Freeform hint about when the task is due (e.g., 'к пятнице')",
)
deliverable_type: Optional[str] = Field(
None, description="What should be submitted: report, code, presentation, etc."
)
grading_hints: List[str] = Field(
default_factory=list,
description="List of evaluation criteria mentioned in the text",
)
class Config:
arbitrary_types_allowed = True
json_schema_extra = {
"example": {
"title": "Мини‑отчёт по LangChain",
"subject": "LangChain",
"deadline_hint": "к пятнице",
"deliverable_type": "отчёт",
"grading_hints": ["полнота", "пример кода"],
}
}