From 660114cca7135c5ad5db5afc895a0be2e806bb51 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 18:08:33 +0000 Subject: [PATCH] add models.py --- models.py | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/models.py b/models.py index a657d2e..9633fdf 100644 --- a/models.py +++ b/models.py @@ -1,15 +1,15 @@ """ Pydantic models for structured output extraction. -Two schemas: -1. PersonInfo – name, optional age, profession, skills list. -2. MeetingNotes – date, participants, topics, decisions, next_steps. +Two schemas are defined: +1. PersonInfo – information about a person. +2. MeetingNotes – notes from a meeting. -All fields have Field(description=...). +Both models use `Field(description=...)` to provide clear field descriptions that LangChain can expose in the prompt. """ + from __future__ import annotations -from datetime import date from typing import List, Optional from pydantic import BaseModel, Field @@ -20,15 +20,27 @@ class PersonInfo(BaseModel): 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") + skills: List[str] = Field( + ..., + description="List of technical or soft skills the person possesses", + ) 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") + date: str = Field(..., description="Date of the meeting in ISO format (YYYY-MM-DD)") + participants: List[str] = Field( + ..., description="Names of people who attended the meeting" + ) + topics: List[str] = Field( + ..., + description="Main discussion topics covered during the meeting" + ) + decisions: List[str] = Field( + ..., description="Decisions made during the meeting" + ) + next_steps: List[str] = Field( + ..., description="Action items or follow‑up tasks after the meeting" + ) -# End of models.py +__all__ = ["PersonInfo", "MeetingNotes"]