fix(local-llm): lokale Antwort nicht in <voice> wickeln (Anzeige war leer)
Qwen imitierte aus dem Kontext den <voice>-TTS-Block, packte aber die GANZE Antwort hinein -> Display strippt <voice> -> leere Bubble (nur TTS klang richtig). Fix: (1) Local-Prompt verbietet <voice>/[FILE:]/<tool_call>/Markup explizit — nur Plain-Text (wird angezeigt UND vorgelesen). (2) Sicherheitsnetz: Voice-Tags aus lokalen Antworten strippen, falls das 8B es doch tut. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1199,6 +1199,12 @@ class Agent:
|
|||||||
return None
|
return None
|
||||||
final = final or "[Lokales LLM: Tool-Loop-Limit erreicht.]"
|
final = final or "[Lokales LLM: Tool-Loop-Limit erreicht.]"
|
||||||
|
|
||||||
|
# Sicherheitsnetz: das lokale Modell wickelt seine Antwort manchmal
|
||||||
|
# faelschlich komplett in <voice>...</voice> (aus dem Kontext imitiert).
|
||||||
|
# Das wuerde die Anzeige leeren (Display strippt <voice>). Tags raus —
|
||||||
|
# der lokale Reply ist kurz, Plain-Text dient Anzeige UND TTS.
|
||||||
|
final = re.sub(r"</?voice>", "", final).strip()
|
||||||
|
|
||||||
if local_only:
|
if local_only:
|
||||||
final = final.replace(router_mod.ESCALATE_MARKER, "").strip()
|
final = final.replace(router_mod.ESCALATE_MARKER, "").strip()
|
||||||
if not final:
|
if not final:
|
||||||
|
|||||||
@@ -124,6 +124,10 @@ def build_local_system_prompt(identity_anchor: str, has_tools: bool = False,
|
|||||||
"## SCHNELL-MODUS",
|
"## SCHNELL-MODUS",
|
||||||
"Du laeufst gerade als schnelles lokales Modell fuer Alltags-Konversation "
|
"Du laeufst gerade als schnelles lokales Modell fuer Alltags-Konversation "
|
||||||
"und einfache Aufgaben. Antworte knapp, freundlich, auf Deutsch, als ARIA.",
|
"und einfache Aufgaben. Antworte knapp, freundlich, auf Deutsch, als ARIA.",
|
||||||
|
"WICHTIG zur Ausgabe: Antworte in ganz NORMALEM Text. Verwende KEINE "
|
||||||
|
"`<voice>`-Tags, kein `[FILE:]`, kein `<tool_call>`, kein HTML/Markup — "
|
||||||
|
"nur ein oder zwei natuerliche Saetze. (Der Text wird direkt angezeigt "
|
||||||
|
"UND vorgelesen.)",
|
||||||
]
|
]
|
||||||
if has_tools:
|
if has_tools:
|
||||||
parts += [
|
parts += [
|
||||||
|
|||||||
Reference in New Issue
Block a user