05/31 Phase 1: initial codes

This commit is contained in:
2026-05-31 10:03:28 -04:00
parent b0a5ce5399
commit b0c0bd363b
35 changed files with 2871 additions and 164 deletions
+22
View File
@@ -0,0 +1,22 @@
from app.extensions import db
from datetime import datetime
class AiInsight(db.Model):
__tablename__ = 'ai_insights'
id = db.Column(db.Integer, primary_key=True)
insight_date = db.Column(db.Date, nullable=False, index=True)
insight_type = db.Column(
db.Enum('daily_summary', 'weekly_summary', 'chat_response', 'alert'),
nullable=False,
default='daily_summary'
)
prompt_summary = db.Column(db.Text, nullable=True) # what context was sent
content = db.Column(db.Text, nullable=False) # AI response
model_used = db.Column(db.String(64), nullable=True)
tokens_used = db.Column(db.Integer, nullable=True)
created_at = db.Column(db.DateTime, default=datetime.utcnow)
def __repr__(self):
return f'<AiInsight {self.insight_type} {self.insight_date}>'