read.markets/app/jobs
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
..
__init__.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
_helpers.py test+fix: make the suite run cleanly in the test container 2026-05-26 00:11:18 +02:00
_market_context.py backend: dedupe shared logic (indicator_summary_job, CHAT_REFERENCE_LINE, call_openrouter alias) 2026-05-27 19:30:11 +02:00
ai_log_job.py openrouter: split into llm_prompts (prompt engineering) + transport 2026-05-27 21:27:23 +02:00
email_digest_job.py openrouter: split into llm_prompts (prompt engineering) + transport 2026-05-27 21:27:23 +02:00
indicator_summary_job.py openrouter: split into llm_prompts (prompt engineering) + transport 2026-05-27 21:27:23 +02:00
market_job.py phase G: data minimisation + passwordless auth + DeepSeek-first LLM 2026-05-18 14:16:57 +01:00
news_job.py news: auto-tag headlines + market-aware cadence + filter UI 2026-05-21 23:25:03 +01:00
rollup_job.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
universe_flush_job.py phase G: data minimisation + passwordless auth + DeepSeek-first LLM 2026-05-18 14:16:57 +01:00