From 344a618237c615f7515aae46ba8e451f45e7c381 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Thu, 8 Oct 2026 18:16:47 -0600 Subject: [PATCH] fix: align AI check with OmniRoute validation --- lib/jeannie/commands.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/jeannie/commands.sh b/lib/jeannie/commands.sh index 1a802ac..ae66ff2 100644 --- a/lib/jeannie/commands.sh +++ b/lib/jeannie/commands.sh @@ -2895,8 +2895,7 @@ payload = { "model": model, "messages": [{"role": "user", "content": "Return only: ok"}], "stream": False, - "max_tokens": 8, - "temperature": 0, + "max_tokens": 64, } headers = {"Content-Type": "application/json", "Accept": "application/json"} if api_key: @@ -2919,7 +2918,19 @@ except Exception as exc: choices = data.get("choices") or [] content = "" if choices: - content = ((choices[0].get("message") or {}).get("content") or "").strip() + value = (choices[0].get("message") or {}).get("content") + if isinstance(value, str): + content = value.strip() + elif isinstance(value, list): + parts = [] + for item in value: + if isinstance(item, str): + parts.append(item) + elif isinstance(item, dict): + text = item.get("text") or item.get("content") + if isinstance(text, str): + parts.append(text) + content = " ".join(parts).strip() raise SystemExit(0 if content else 1) PY then