Remove ambiguous evidence level field from claims and the AI assistant.
Drops Evidenzlevel from models, admin, public UI, and draft workflow while keeping Nachweise file uploads unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,7 +8,6 @@ from django.conf import settings
|
||||
from claims.models import Category, Claim
|
||||
|
||||
VALID_CLAIM_STATUSES = {choice[0] for choice in Claim.Status.choices}
|
||||
VALID_EVIDENCE_LEVELS = {choice[0] for choice in Claim.EvidenceLevel.choices}
|
||||
|
||||
SYSTEM_PROMPT = """Du bist ein sachlicher Fakten-Assistent für die Plattform „Faktenkompass“.
|
||||
Deine Aufgabe: Aus Artikeln, Bildern und Nutzereingaben einen überprüfbaren Fakteneintrag erstellen.
|
||||
@@ -36,8 +35,7 @@ Antworte ausschließlich als gültiges JSON mit dieser Struktur:
|
||||
"title": "Die zu prüfende Behauptung",
|
||||
"status": "falsch|irrefuehrend|teilweise_richtig|unbelegt|wissenschaftlicher_konsens|offene_frage",
|
||||
"short_answer": "Kurze Einordnung",
|
||||
"detailed_explanation": "Ausführlichere Erklärung",
|
||||
"evidence_level": "sehr_stark|stark|mittel|schwach"
|
||||
"detailed_explanation": "Ausführlichere Erklärung"
|
||||
},
|
||||
"tags": ["Schlagwort1", "Schlagwort2"],
|
||||
"sources": [
|
||||
@@ -180,11 +178,8 @@ def _call_openai(messages, *, has_image=False):
|
||||
def _validate_payload(payload):
|
||||
claim = payload.get('claim') or {}
|
||||
status = claim.get('status', '')
|
||||
evidence = claim.get('evidence_level', '')
|
||||
if status and status not in VALID_CLAIM_STATUSES:
|
||||
raise AIAssistantError(f'Ungültiger Status von der KI: {status}')
|
||||
if evidence and evidence not in VALID_EVIDENCE_LEVELS:
|
||||
raise AIAssistantError(f'Ungültiges Evidenzlevel von der KI: {evidence}')
|
||||
return payload
|
||||
|
||||
|
||||
@@ -248,7 +243,6 @@ def apply_payload_to_draft(draft, payload):
|
||||
draft.claim_status = claim.get('status', Claim.Status.UNBELEGT)
|
||||
draft.short_answer = claim.get('short_answer', '')
|
||||
draft.detailed_explanation = claim.get('detailed_explanation', '')
|
||||
draft.evidence_level = claim.get('evidence_level', Claim.EvidenceLevel.MITTEL)
|
||||
draft.tags = payload.get('tags') or []
|
||||
draft.sources = payload.get('sources') or []
|
||||
draft.counter_arguments = payload.get('counter_arguments') or []
|
||||
|
||||
Reference in New Issue
Block a user