swift15: vision probe reads reasoning_content fallback, 256-token budget

This commit is contained in:
Frank
2026-10-08 04:57:31 -07:00
parent 971e23a25c
commit b175f4afd1
+3 -2
View File
@@ -16,7 +16,7 @@ def png(color):
+ chunk(b"IHDR", struct.pack(">IIBBBBB", w, h, 8, 2, 0, 0, 0)) + chunk(b"IHDR", struct.pack(">IIBBBBB", w, h, 8, 2, 0, 0, 0))
+ chunk(b"IDAT", zlib.compress(raw)) + chunk(b"IEND", b"")) + chunk(b"IDAT", zlib.compress(raw)) + chunk(b"IEND", b""))
b64 = base64.b64encode(png((255, 0, 0))).decode() b64 = base64.b64encode(png((255, 0, 0))).decode()
body = json.dumps({"model": "frank-primary", "max_tokens": 64, "temperature": 0, body = json.dumps({"model": "frank-primary", "max_tokens": 256, "temperature": 0,
"messages": [{"role": "user", "content": [ "messages": [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64," + b64}}, {"type": "image_url", "image_url": {"url": "data:image/png;base64," + b64}},
{"type": "text", "text": "What color is this image? Answer with one word."}]}]}).encode() {"type": "text", "text": "What color is this image? Answer with one word."}]}]}).encode()
@@ -24,7 +24,8 @@ r = urllib.request.Request("http://localhost:7770/v1" + "/chat/completions",
data=body, headers={"Content-Type": "application/json"}) data=body, headers={"Content-Type": "application/json"})
d = json.load(urllib.request.urlopen(r, timeout=300)) d = json.load(urllib.request.urlopen(r, timeout=300))
m = d["choices"][0]["message"] m = d["choices"][0]["message"]
print("VISION ANSWER:", ((m.get("content") or "")[:80]).replace("\n", " ")) ans = (m.get("content") or m.get("reasoning_content") or "")
print("VISION ANSWER:", ans[:80].replace("\n", " "))
PY PY
echo "== tools (expect tool_calls)" echo "== tools (expect tool_calls)"