Replace counter-arguments with possible answers and unify search inputs.
Models, AI assistant, and UI now show diskussionsfertige Antworten without titles; shared search partial fixes aria-label rendering. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,6 +20,7 @@ Regeln:
|
||||
- Quellen müssen echte, nachvollziehbare Referenzen sein (URL aus Eingabe bevorzugen).
|
||||
- Wähle eine passende bestehende Kategorie (use_existing_slug) ODER schlage eine neue vor.
|
||||
- Icons für neue Kategorien: Bootstrap Icons Klassen wie bi-thermometer-half, bi-virus, bi-lightning-charge.
|
||||
- Unter possible_answers: 2–4 kurze, diskussionsfertige Antworten auf die Behauptung formulieren.
|
||||
|
||||
Antworte ausschließlich als gültiges JSON mit dieser Struktur:
|
||||
{
|
||||
@@ -46,10 +47,9 @@ Antworte ausschließlich als gültiges JSON mit dieser Struktur:
|
||||
"description": "Kurzbeschreibung"
|
||||
}
|
||||
],
|
||||
"counter_arguments": [
|
||||
"possible_answers": [
|
||||
{
|
||||
"argument": "Häufiges Gegenargument",
|
||||
"response": "Sachliche Antwort"
|
||||
"answer": "Kurze, sachliche Antwort auf die Behauptung für die Diskussion"
|
||||
}
|
||||
],
|
||||
"assistant_summary": "Kurze Zusammenfassung für den Admin (1-2 Sätze)"
|
||||
@@ -229,6 +229,18 @@ def generate_draft_payload(
|
||||
return _validate_payload(payload)
|
||||
|
||||
|
||||
def _normalize_possible_answers(items):
|
||||
answers = []
|
||||
for item in items or []:
|
||||
if isinstance(item, str):
|
||||
text = item.strip()
|
||||
else:
|
||||
text = (item.get('answer') or item.get('response') or '').strip()
|
||||
if text:
|
||||
answers.append({'answer': text})
|
||||
return answers
|
||||
|
||||
|
||||
def apply_payload_to_draft(draft, payload):
|
||||
category = payload.get('category') or {}
|
||||
claim = payload.get('claim') or {}
|
||||
@@ -245,7 +257,9 @@ def apply_payload_to_draft(draft, payload):
|
||||
draft.detailed_explanation = claim.get('detailed_explanation', '')
|
||||
draft.tags = payload.get('tags') or []
|
||||
draft.sources = payload.get('sources') or []
|
||||
draft.counter_arguments = payload.get('counter_arguments') or []
|
||||
draft.possible_answers = _normalize_possible_answers(
|
||||
payload.get('possible_answers', payload.get('counter_arguments'))
|
||||
)
|
||||
draft.ai_raw_response = payload
|
||||
summary = payload.get('assistant_summary', 'Entwurf wurde erstellt.')
|
||||
draft.add_message('assistant', summary)
|
||||
|
||||
Reference in New Issue
Block a user