fix: Beschreibung generieren gibt jetzt reinen Fließtext aus
Neuer raw_text Parameter in call_claude() umgeht den JSON-System-Prompt. Haiku gibt direkt lesbaren Text zurück statt JSON-Objekte. Gesamtes JSON-Parsing (_json_to_text, Markdown-Strip) entfernt.
Dieser Commit ist enthalten in:
@@ -43,7 +43,7 @@ def _sanitize_mdash(text: str) -> str:
|
||||
"""Entfernt Gedankenstriche aus LLM-Output (KI-Indikator)."""
|
||||
return text.replace("\u2014", ", ").replace("\u2013", ", ")
|
||||
|
||||
async def call_claude(prompt: str, tools: str | None = "WebSearch,WebFetch", model: str | None = None) -> tuple[str, ClaudeUsage]:
|
||||
async def call_claude(prompt: str, tools: str | None = "WebSearch,WebFetch", model: str | None = None, raw_text: bool = False) -> tuple[str, ClaudeUsage]:
|
||||
"""Ruft Claude CLI auf. Gibt (result_text, usage) zurück.
|
||||
|
||||
Prompt wird via stdin uebergeben um OS ARG_MAX Limits zu vermeiden.
|
||||
@@ -60,11 +60,12 @@ async def call_claude(prompt: str, tools: str | None = "WebSearch,WebFetch", mod
|
||||
cmd.extend(["--allowedTools", tools])
|
||||
else:
|
||||
cmd.extend(["--max-turns", "1", "--allowedTools", ""])
|
||||
cmd.extend(["--append-system-prompt",
|
||||
"CRITICAL: You are a JSON-only output agent. "
|
||||
"Output EXCLUSIVELY a single valid JSON object. "
|
||||
"No explanatory text, no markdown fences, no continuation of previous responses. "
|
||||
"Start your response with { and end with }."])
|
||||
if not raw_text:
|
||||
cmd.extend(["--append-system-prompt",
|
||||
"CRITICAL: You are a JSON-only output agent. "
|
||||
"Output EXCLUSIVELY a single valid JSON object. "
|
||||
"No explanatory text, no markdown fences, no continuation of previous responses. "
|
||||
"Start your response with { and end with }."])
|
||||
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
*cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE,
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren