c59c3069c4
Drop oracle UI, API endpoint, scheduled generation, and related docs. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
782 B
Python
30 lines
782 B
Python
#!/usr/bin/env python3
|
|
"""Regenerate cached AI texts (motivation)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import asyncio
|
|
|
|
from server.ai import generate_daily_motivation
|
|
from server.config_loader import load_meds_config
|
|
from server.db import get_db
|
|
|
|
|
|
async def main() -> None:
|
|
parser = argparse.ArgumentParser(description="Regenerate cached AI texts")
|
|
parser.add_argument("--force", action="store_true", help="Regenerate even if cache exists")
|
|
args = parser.parse_args()
|
|
|
|
config = load_meds_config()
|
|
db = await get_db()
|
|
try:
|
|
result = await generate_daily_motivation(db, config.timezone, force=args.force)
|
|
print("motivation:", result)
|
|
finally:
|
|
await db.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|