This commit is contained in:
team3
2026-07-13 01:45:45 +02:00
parent 8cedcc87ec
commit 698bba6ccf
8 changed files with 82 additions and 31 deletions

View File

@@ -134,6 +134,11 @@ async def call(ctx: Kontext, *, stage: str, template: str, werte: dict,
status = "ok"
return res.text
daten = jsonx.parse(res.text)
# Modelle lassen bei EINEM Element die Array-Klammern gern weg —
# ein valides Einzel-Dict zählt als 1-elementige Liste (sonst
# brannte jeder 1-Item-Chunk 3 Neuversuche durch).
if erwartet is list and isinstance(daten, dict) and daten:
daten = [daten] # leeres {} bleibt „falscher Typ" (= Ausfall)
if daten is not None and isinstance(daten, erwartet):
status = "ok"
return daten