fix: markdown→HTML rendering in engine + harden thinking fallback
- Engine now converts content_md to HTML at render time (was dumping raw markdown, causing articles to show literal #/**/- symbols and collapse into wall of text) - /api/publish accepts 'content' key and converts markdown→HTML for API consumers - Added md Jinja filter + md_to_html helper (markdown lib, extra+sane_lists) - orchestrator: log warning when falling back to 'thinking' field (CoT, not prose) - content_pipeline now generates formatted articles via LLM instead of raw scraped HTML
This commit is contained in:
@@ -205,9 +205,14 @@ def llm_chat(prompt: str, model: str = "qwen3.5:4b-mlx", host: str = OLLAMA_MACB
|
||||
result = r.json()
|
||||
if "message" in result:
|
||||
content = result["message"].get("content", "")
|
||||
# ornith puts output in 'thinking' when content is empty
|
||||
# ornith puts output in 'thinking' when content is empty.
|
||||
# WARNING: 'thinking' is chain-of-thought reasoning, NOT article text.
|
||||
# Only fall back to it for JSON/short tasks, never long-form prose.
|
||||
if not content:
|
||||
content = result["message"].get("thinking", "")
|
||||
if content:
|
||||
log.warning(f"LLM {model} returned empty content — fell back to 'thinking' field ({len(content)} chars). "
|
||||
f"Verify this is real output, not chain-of-thought.")
|
||||
if content:
|
||||
return content
|
||||
if "error" in result:
|
||||
|
||||
Reference in New Issue
Block a user