from typing import Union, Literal, Optional from pydantic import BaseModel, Field ## File doesn't do anything, its just an outline for the schemas class BaseEntry(BaseModel): title: str = Field(description="The name of the opportunity") org: str = Field(description="The organisation") summary:str = Field(description="A 3 sentence summary of what this is") class Event(BaseEntry): type: Literal["event"] = "event" date_time: str = Field(description="Date and time of the event") end_date: Optional[str] = Field(default=None, description="End date and time if multi-day event") location: str = Field(description="Location of the event") class Opportunity(BaseEntry): type: str = Field(description="The type of opportunity (Open Call, Funding, Residency, etc.)") deadline: str = Field(description="What is the deadline in the format of dd-mm-yy") location: str = Field(description="Location of entry") class Workshop(BaseEntry): type: Literal["workshop"] = "workshop" date_time: str = Field(description="Start date and time of the workshop") end_date: Optional[str] = Field(default=None, description="End date and time if multi-day workshop") location: str = Field(description="Location of the workshop") EntrySchema = Union[Event, Opportunity, Workshop]