feat(pipeline): output_language pro Org durch die Pipeline reichen

- OUTPUT_LANGUAGE Konstante aus config.py entfernt (jetzt pro Org in
  organization_settings).
- Orchestrator laedt output_language einmal pro Refresh aus der Org-Sprache.
- researcher.search(), analyzer.analyze/.analyze_incremental/.generate_latest_developments,
  factchecker.check/.check_incremental/.check_incremental_twophase bekommen
  output_language als Parameter (Default Deutsch).
- LANG_INTERNATIONAL / LANG_GERMAN_ONLY (+ Deep-Varianten) sind Funktionen,
  die je nach output_language die Sprachanweisung erzeugen (Deutsch | English
  | Fallback).
- Sprachfilter in researcher.search ist org-relativ: bei nicht-international
  werden Artikel mit Sprache != output_language_iso gefiltert.

Phase 2 von 8 (eng_demo / Org-Sprache). Bestandsorgs unveraendert, weil
Default-Setting weiterhin de (siehe Phase-1-Migration).
Dieser Commit ist enthalten in:
Claude Code
2026-05-13 20:54:28 +00:00
Ursprung d27d586003
Commit f68d25dbce
5 geänderte Dateien mit 68 neuen und 32 gelöschten Zeilen

Datei anzeigen

@@ -462,19 +462,18 @@ class FactCheckerAgent:
lines.append(line)
return "\n".join(lines)
async def check(self, title: str, articles: list[dict], incident_type: str = "adhoc") -> tuple[list[dict], ClaudeUsage | None]:
async def check(self, title: str, articles: list[dict], incident_type: str = "adhoc", output_language: str = "Deutsch") -> tuple[list[dict], ClaudeUsage | None]:
"""Führt vollständigen Faktencheck durch (erster Refresh)."""
if not articles:
return [], None
articles_text = self._format_articles_text(articles)
from config import OUTPUT_LANGUAGE
template = RESEARCH_FACTCHECK_PROMPT_TEMPLATE if incident_type == "research" else FACTCHECK_PROMPT_TEMPLATE
prompt = template.format(
title=title,
articles_text=articles_text,
output_language=OUTPUT_LANGUAGE,
output_language=output_language,
)
try:
@@ -494,6 +493,7 @@ class FactCheckerAgent:
new_articles: list[dict],
existing_facts: list[dict],
incident_type: str = "adhoc",
output_language: str = "Deutsch",
) -> tuple[list[dict], ClaudeUsage | None]:
"""Inkrementeller Faktencheck: Prüft nur neue Artikel gegen bestehende Fakten.
@@ -506,7 +506,6 @@ class FactCheckerAgent:
articles_text = self._format_articles_text(new_articles, max_articles=15)
existing_facts_text = self._format_existing_facts(existing_facts)
from config import OUTPUT_LANGUAGE
if incident_type == "research":
template = INCREMENTAL_RESEARCH_FACTCHECK_PROMPT_TEMPLATE
else:
@@ -516,7 +515,7 @@ class FactCheckerAgent:
title=title,
articles_text=articles_text,
existing_facts_text=existing_facts_text,
output_language=OUTPUT_LANGUAGE,
output_language=output_language,
)
try:
@@ -536,6 +535,7 @@ class FactCheckerAgent:
new_articles: list[dict],
existing_facts: list[dict],
incident_type: str = "adhoc",
output_language: str = "Deutsch",
) -> tuple[list[dict], ClaudeUsage | None]:
"""Zwei-Phasen inkrementeller Faktencheck: Haiku-Triage + parallele Opus-Verifikation.
@@ -556,9 +556,9 @@ class FactCheckerAgent:
triage_facts_text = self._format_facts_for_triage(existing_facts)
articles_text = self._format_articles_text(new_articles, max_articles=15)
from config import OUTPUT_LANGUAGE, CLAUDE_MODEL_FAST
from config import CLAUDE_MODEL_FAST
triage_prompt = TRIAGE_PROMPT_TEMPLATE.format(
output_language=OUTPUT_LANGUAGE,
output_language=output_language,
fact_count=len(existing_facts),
existing_facts_text=triage_facts_text,
article_count=len(new_articles),
@@ -619,7 +619,7 @@ class FactCheckerAgent:
template = VERIFY_GROUP_PROMPT_TEMPLATE
prompt = template.format(
output_language=OUTPUT_LANGUAGE,
output_language=output_language,
theme=theme,
facts_text=facts_text,
new_claims_text=new_claims_text,