This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
import logging | |
import inspect | |
from typing import Type, TypeVar | |
from dspy import Assert, Module, ChainOfThought, Signature, InputField, OutputField | |
from pydantic import BaseModel, ValidationError | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.ERROR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
import logging | |
import inspect | |
from typing import Type, TypeVar | |
from dspy import Assert, Module, ChainOfThought, Signature, InputField, OutputField | |
from pydantic import BaseModel, ValidationError | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.ERROR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydantic import BaseModel, Field, validator, root_validator, EmailStr, UrlStr | |
from typing import List, Optional | |
from datetime import datetime | |
class VAVAILABILITYModel(BaseModel): | |
"""A Pydantic model for RFC 5545 compliance.""" | |
dtstart: datetime = Field(default=None, title="", description="The start date and time of the event.", required) | |
dtend: datetime = Field(default=None, title="", description="The end date and time of the event.", required) | |
summary: str = Field(default=None, title="", description="A brief summary or title of the event.", max_length=255) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from pydantic import BaseModel, Field, validator, root_validator, EmailStr, UrlStr | |
class ContactModel(BaseModel): | |
"""A Pydantic model representing a contact in the friend of a friend ontology.""" | |
name: str = Field(default=None, title="", description="The name of the contact.", min_length=2, max_length=50) | |
email: EmailStr = Field(default=None, title="", description="The email address of the contact.", min_length=5, max_length=50) | |
phone_number: str = Field(default=None, title="", description="The phone number of the contact.", min_length=10, max_length=15) | |
address: str = Field(default=None, title="", description="The address of the contact.", min_length=10, max_length=100) |