feat(M3): modèles de données Pydantic (22 modèles, 10 modules)
Modèles créés : - models/agenda.py : Status, LessonStatus, HomeworkBlock, Lesson (frozen), SchoolEventKind, SchoolEvent (frozen), TheoreticalLesson (frozen) - models/homework.py : Homework (frozen) - models/message.py : MessageType, Message (frozen) - models/blog.py : BlogArticle (frozen), ExternalInfo (mutable) - models/diff.py : AgendaChangeType, AgendaChange (frozen), AgendaDiff (frozen) - models/pronote.py : PronoteData (mutable) - models/sync.py : CalDAVSyncStatus, CalDAVSyncPlan, CalDAVSyncResult (mutable) - models/synthesis.py : SynthesisInput, SynthesisResult (mutable) - models/xmpp.py : XmppMessage (frozen, external_info: ExternalInfo | None) - models/__init__.py : ré-export des 22 modèles via __all__ Conventions appliquées : - Pydantic v2 : model_config = ConfigDict(frozen=True), pas de json_encoders - StrEnum au lieu de (str, Enum) (ruff UP042) - Alias _date/_time pour éviter collision champ date/type date - Sphinx/reST docstrings sur toutes les classes - TODO.md : 11 items M3 cochés Validations (@verifier) : - ruff check : PASS (0 error) - ruff format --check : PASS (10 fichiers) - mypy strict : PASS (10 fichiers) - bandit : PASS (0 issue) - import 22 modèles : OK - sérialisation JSON (frozen + mutable) : OK - frozen immuable, PronoteData/CalDAVSyncResult mutable : OK - StrEnum isinstance str : OK - pytest : 0 test (infrastructure OK) Co-authored-by: OpenCode/orchestrator <opencode-orchestrator@agents.invalid>
This commit is contained in:
28
pronote_sync/models/synthesis.py
Normal file
28
pronote_sync/models/synthesis.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Modèles de données pour la synthèse IA."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from pronote_sync.models.agenda import SchoolEvent
|
||||
from pronote_sync.models.diff import AgendaDiff
|
||||
from pronote_sync.models.message import Message
|
||||
|
||||
|
||||
class SynthesisInput(BaseModel):
|
||||
"""Entrée pour la synthèse IA."""
|
||||
|
||||
agenda_diff: AgendaDiff | None = Field(None, description="Différences d'agenda")
|
||||
messages: list[Message] = Field(default_factory=list, description="Messages importants")
|
||||
school_events: list[SchoolEvent] = Field(
|
||||
default_factory=list, description="Événements scolaires"
|
||||
)
|
||||
target_date: date = Field(..., description="Date cible")
|
||||
|
||||
|
||||
class SynthesisResult(BaseModel):
|
||||
"""Résultat de la synthèse IA."""
|
||||
|
||||
text: str | None = Field(None, description="Texte de la synthèse IA")
|
||||
Reference in New Issue
Block a user