Automated Action ef749e4878 Implement WhatsApp Message Analytics Service
- Set up FastAPI application structure
- Implement SQLite database with SQLAlchemy
- Create WhatsApp webhook endpoints
- Implement message storage and analysis
- Integrate Gemini 2.5 Pro for message analysis
- Add email delivery of insights
- Configure APScheduler for weekend analysis
- Add linting with Ruff
2025-05-22 13:29:12 +00:00

37 lines
784 B
Python

"""
Pydantic schemas for message analyses.
"""
from datetime import datetime
from pydantic import BaseModel, Field
class AnalysisBase(BaseModel):
"""
Base schema for message analyses.
"""
analysis_text: str = Field(..., description="Text of the analysis")
start_date: datetime = Field(..., description="Start date of the analysis period")
end_date: datetime = Field(..., description="End date of the analysis period")
class AnalysisCreate(AnalysisBase):
"""
Schema for creating a new analysis.
"""
pass
class Analysis(AnalysisBase):
"""
Schema for an analysis.
"""
id: int
created_at: datetime
class Config:
"""
Pydantic config for the Analysis schema.
"""
from_attributes = True