The monolithic Peptide_News_LLM class mixed HTTP transport, prompt construction, batch orchestration, and AJAX handling. Split into: - class-peptide-news-llm-client.php (199 lines) — OpenRouter HTTP transport with retry logic and response parsing - class-peptide-news-llm-prompt-builder.php (142 lines) — keyword and summary prompt construction, article text fetching - class-peptide-news-llm-ajax.php (87 lines) — bulk-generate AJAX handler - class-peptide-news-llm.php (300 lines) — orchestrator with backward-compatible proxies for is_valid_model(), call_openrouter(), and call_openrouter_with_usage() Extracted run_llm_task() helper to deduplicate the keyword/summary processing blocks. All public API preserved — no test changes needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
12 KiB
Executable File
12 KiB
Executable File