fix: pass editorial brief to LLM prompt + improve missing API key error

- Add 'brief' field to GenerateContentRequest schema
- Pass brief from router to generate_post_text service
- Inject brief as mandatory instructions in LLM prompt with highest priority
- Return structured error when LLM provider/API key not configured
- Show dedicated warning banner with link to Settings when API key missing

Fixes: content ignoring editorial brief, unhelpful API key error messages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michele
2026-04-03 17:22:15 +02:00
parent 2ca8b957e9
commit 7d1b4857c2
4 changed files with 49 additions and 6 deletions

View File

@@ -108,6 +108,7 @@ class GenerateContentRequest(BaseModel):
platforms: List[str] = [] # new: multi-platform (overrides platform if non-empty)
content_types: List[str] = [] # new: multi-type (overrides content_type if non-empty)
topic_hint: Optional[str] = None
brief: Optional[str] = None # editorial brief: technique + instructions for the LLM
include_affiliates: bool = True
provider: Optional[str] = None
model: Optional[str] = None