From 2c8e2de80d919ae696dd43c10c7ce8fb1db18a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=9A=D1=83=D1=82?= =?UTF-8?q?=D0=BB=D0=B0=D1=85=D0=BC=D0=B5=D1=82=D0=BE=D0=B2?= Date: Thu, 28 May 2026 17:44:38 +0000 Subject: [PATCH] add models.py --- models.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 models.py diff --git a/models.py b/models.py new file mode 100644 index 0000000..a657d2e --- /dev/null +++ b/models.py @@ -0,0 +1,34 @@ +""" +Pydantic models for structured output extraction. + +Two schemas: +1. PersonInfo – name, optional age, profession, skills list. +2. MeetingNotes – date, participants, topics, decisions, next_steps. + +All fields have Field(description=...). +""" +from __future__ import annotations + +from datetime import date +from typing import List, Optional + +from pydantic import BaseModel, Field + +class PersonInfo(BaseModel): + """Information about a person extracted from free text.""" + + name: str = Field(..., description="Full name of the person") + age: Optional[int] = Field(None, description="Age in years; optional if not mentioned") + profession: str = Field(..., description="Primary occupation or role") + skills: List[str] = Field(..., description="List of technical or soft skills") + +class MeetingNotes(BaseModel): + """Structured notes from a meeting extracted from free text.""" + + date: date = Field(..., description="Date of the meeting in ISO format (YYYY-MM-DD)") + participants: List[str] = Field(..., description="Names of attendees") + topics: List[str] = Field(..., description="Discussion topics covered during the meeting") + decisions: List[str] = Field(..., description="Decisions made during the meeting") + next_steps: List[str] = Field(..., description="Action items to be performed after the meeting") + +# End of models.py