Stufe Lektorat: Sprache glätten, Abschnitt für Abschnitt
Nach der Prüfung glättet ein Lektor ohne Werkzeuge jeden Abschnitt (Satzbau, Zusammenhang, Wortwahl, Begriffe erinnern). Eingebaute Verlustprüfung: Bezeichner, Zahlen, Überschriften, Code, Diagramme, Querverweise, Umfang ±20 % – sonst bleibt das Original. Alte Zustände bekommen die Stufe beim Laden nachgetragen. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -74,3 +74,20 @@ async def laufen(name: str, agent_id: str, stufe_id: str, titel: str, prompt: st
|
||||
state.ereignis(name, agent_id, "ende" if status == "fertig" else "fehler",
|
||||
f"{status} · {kosten:.2f} USD · {a['werkzeuge']} Werkzeugaufrufe" + (f" · {fehler}" if fehler else ""))
|
||||
return {"status": status, "bericht": bericht, "kosten": kosten, "tokens": tokens}
|
||||
|
||||
|
||||
async def fragen(prompt: str, *, system: str, effort: str = "medium") -> tuple[str, float, int]:
|
||||
"""Eine einzelne Modellantwort ohne Werkzeuge (für das Lektorat). → (Text, Kosten, Tokens)"""
|
||||
options = ClaudeAgentOptions(model=config.MODELL, effort=effort, max_turns=1, allowed_tools=[], system_prompt=system)
|
||||
text, kosten, tokens = [], 0.0, 0
|
||||
async for m in query(prompt=prompt, options=options):
|
||||
if isinstance(m, AssistantMessage):
|
||||
for b in m.content:
|
||||
if isinstance(b, TextBlock):
|
||||
text.append(b.text)
|
||||
elif isinstance(m, ResultMessage):
|
||||
kosten = m.total_cost_usd or 0.0
|
||||
u = m.usage or {}
|
||||
tokens = sum(int(u.get(k) or 0) for k in
|
||||
("input_tokens", "output_tokens", "cache_creation_input_tokens", "cache_read_input_tokens"))
|
||||
return "".join(text).strip(), kosten, tokens
|
||||
|
||||
Reference in New Issue
Block a user