feat: enrich insights cards, add AI chatbot
Add 3 new data-driven insight cards (daily cases, district risk comparison, weather impact) with real parquet data. Fix season card to use current date instead of data date. Expand to 11 cards. Add POST /api/chat endpoint proxying to ai.2890.ltd with JWT auth. Create ChatBot frontend component with collapsible chat panel, message bubbles, and auto-scroll. Chat API key stored in .env only. Clean up duplicate typing imports in insights.py, export cachedPost.
This commit is contained in:
@@ -2,8 +2,13 @@
|
||||
Centralized configuration and named constants for CBPOA backend.
|
||||
Eliminates magic numbers scattered across routers.
|
||||
"""
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# ============================================================================
|
||||
# Paths
|
||||
# ============================================================================
|
||||
@@ -78,3 +83,11 @@ TREND_SLOPE_THRESHOLD = 0.05
|
||||
|
||||
DATE_FORMAT_GEOJSON = "%Y%m%d"
|
||||
DATE_FORMAT_ISO = "%Y-%m-%d"
|
||||
|
||||
# ============================================================================
|
||||
# Chat Proxy Configuration
|
||||
# ============================================================================
|
||||
|
||||
CHAT_API_KEY = os.getenv("CHAT_API_KEY", "")
|
||||
CHAT_API_BASE = os.getenv("CHAT_API_BASE", "https://ai.2890.ltd/v1")
|
||||
CHAT_MODEL = os.getenv("CHAT_MODEL", "gpt-4o-mini")
|
||||
|
||||
Reference in New Issue
Block a user