Files
task-6a1865008a94f887e50d471c/models.py
T
2026-05-28 17:44:38 +00:00

35 lines
1.3 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 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