diff options
Diffstat (limited to 'scripts/ask_fugu.py')
| -rw-r--r-- | scripts/ask_fugu.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/ask_fugu.py b/scripts/ask_fugu.py new file mode 100644 index 0000000..b3ffa99 --- /dev/null +++ b/scripts/ask_fugu.py @@ -0,0 +1,24 @@ +import json, urllib.request, urllib.error, os, sys +key = open(os.path.expanduser("~/.codex/sakana.key")).read().strip() +brief = open("/home/yurenh2/ept/PHYSICS_QUESTIONS_FOR_DEEP_REASONING.md").read() +prompt = brief + "\n\n---\nAnswer Q1 through Q7. For each: (a) is it a FUNDAMENTAL obstruction (cite/sketch the no-go) or an ENGINEERING gap (sketch the construction); (b) the physical-realizability verdict (local, forward-only, no backward pass?); (c) the cheapest experiment on our simulator that would falsify your proposed mechanism. Be rigorous, specific, and decisive." +payload = {"model": "fugu-ultra", "input": prompt, "reasoning": {"effort": "xhigh"}} +req = urllib.request.Request("https://api.sakana.ai/v1/responses", + data=json.dumps(payload).encode(), + headers={"Content-Type": "application/json", "Authorization": "Bearer " + key}) +try: + data = json.load(urllib.request.urlopen(req, timeout=3000)) +except urllib.error.HTTPError as e: + print("HTTPError", e.code); print(e.read().decode()[:3000]); sys.exit(1) +except Exception as e: + print("ERR", repr(e)); sys.exit(1) +texts = [] +for item in data.get("output", []): + if item.get("type") == "message": + for c in item.get("content", []): + if c.get("type") in ("output_text", "text"): texts.append(c.get("text", "")) +out = "\n".join(t for t in texts if t) or data.get("output_text", "") or ("RAW:\n" + json.dumps(data)[:4000]) +open("/home/yurenh2/ept/FUGU_PHYSICS_ANSWER.md", "w").write(out) +print("=== USAGE ===", json.dumps(data.get("usage", {}))) +print("=== FUGU-ULTRA ANSWER (saved to FUGU_PHYSICS_ANSWER.md) ===") +print(out) |
