Files
2026-05-28 18:08:33 +00:00

47 lines
1.5 KiB
Python
Raw Permalink 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 are defined:
1. PersonInfo information about a person.
2. MeetingNotes notes from a meeting.
Both models use `Field(description=...)` to provide clear field descriptions that LangChain can expose in the prompt.
"""
from __future__ import annotations
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 the person possesses",
)
class MeetingNotes(BaseModel):
"""Structured notes from a meeting extracted from free text."""
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 followup tasks after the meeting"
)
__all__ = ["PersonInfo", "MeetingNotes"]