- Split backend/app/core into weather/, discord/, memory_kb/, search/ subpackages by responsibility, keeping config.py and llm.py as the shared foundation; updated all import sites accordingly. - Add local Markdown knowledge base support (local_knowledge.py, knowledge_base/fgo.md, LOCAL_KB_* settings) that embeds and injects relevant docs into the system prompt by topic similarity. - Add ruff and pyright as backend dev dependencies with basic config in pyproject.toml for linting and type checking. - Document local machine quirks in CLAUDE.md (Postgres on port 8080, SSLKEYLOGFILE breaking litellm/pyright via OPENSSL_Uplink crashes). - Add backend/run_dev.ps1 dev launcher and docs/discord-bot.md.
20 lines
496 B
Python
20 lines
496 B
Python
"""直近で取得した「明日の天気」データをメモリ上にキャッシュする。"""
|
|
from datetime import datetime
|
|
|
|
_latest: dict | None = None
|
|
|
|
|
|
def set_latest(weather: str, pop: int | None, judgement: str, reason: str) -> None:
|
|
global _latest
|
|
_latest = {
|
|
"weather": weather,
|
|
"pop": pop,
|
|
"judgement": judgement,
|
|
"reason": reason,
|
|
"fetched_at": datetime.now().isoformat(),
|
|
}
|
|
|
|
|
|
def get_latest() -> dict | None:
|
|
return _latest
|