Files
null-bot/schemas.py
2026-05-10 13:14:14 +01:00

21 lines
900 B
Python

from typing import Union, Literal
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")
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")
EntrySchema = Union[Event, Opportunity]