read.markets/app
Giorgio Gilestro 4adc8dfe82 openrouter: split into llm_prompts (prompt engineering) + transport
openrouter.py was 790 lines mixing two orthogonal concerns:
- Prompt engineering (build_system_prompt, build_summary_*,
  build_chat_*, build_daily_digest_*, etc.) — ~400 lines, changes
  weekly as PROMPT_VERSION bumps
- LLM transport (call_llm, _provider_chain, _call_provider, retry
  + fallback machinery) — ~250 lines, rarely changes

Extracted the prompt-engineering surface to app/services/llm_prompts.py.
Transport stays in openrouter.py (consistent with the filename — the
OpenRouter URL is the transport's anchor).

All import sites (jobs, routers, services, tests) split their
multi-import lines into two: prompt-things from llm_prompts, transport
from openrouter. PROMPT_VERSION constant, _TONE_ALIASES, _resolve_tone,
and SYSTEM_PROMPT moved with the prompt functions.

No behaviour change — pure relocation. Function signatures, body, and
naming all preserved.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:27:23 +02:00
..
jobs openrouter: split into llm_prompts (prompt engineering) + transport 2026-05-27 21:27:23 +02:00
routers openrouter: split into llm_prompts (prompt engineering) + transport 2026-05-27 21:27:23 +02:00
services openrouter: split into llm_prompts (prompt engineering) + transport 2026-05-27 21:27:23 +02:00
static settings: extract sync + import widget JS to static files 2026-05-27 20:55:49 +02:00
templates i18n: instant lang switch via HTMX trigger + refresh paid-plans terms 2026-05-27 21:02:03 +02:00
__init__.py
auth.py public: landing + pricing + legal pages, apex-ready, lawyer-reviewed 2026-05-24 00:08:02 +02:00
branding.py public: landing + pricing + legal pages, apex-ready, lawyer-reviewed 2026-05-24 00:08:02 +02:00
cli.py docs: drop Phase D.x markers now that the referral loop is closed 2026-05-26 23:09:39 +02:00
config.py cleanup: drop stale tombstones and dead config fields 2026-05-27 19:25:33 +02:00
db.py
logging.py
main.py ticker-validate: mount router at /api/ticker/* 2026-05-27 14:48:00 +02:00
models.py models: align translation column naming + add token counts 2026-05-27 21:18:29 +02:00
redis_client.py
scheduler_main.py scheduler: register email_digest_job at 06:30 UTC 2026-05-25 23:20:06 +02:00
schemas.py
templates_env.py beta: header chip flagged by BETA_MODE config (default on) 2026-05-25 22:42:19 +02:00