- ProcessManager: observable tool execution with start/stop/status - UI controls protocol: buttons, tables, process cards - Frontend renders controls in chat, clicks route back as actions - Thinker upgraded to gemini-2.5-flash-preview - Auto-detect SQL/python/tool_code blocks for execution - SQL blocks auto-wrapped in Python sqlite3 script - WIP: tool execution path needs tuning, controls not yet triggered Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
"""Test script for cog runtime API. Run with: .venv/Scripts/python.exe test_cog.py"""
|
|
import httpx, sys, time
|
|
|
|
API = "https://cog.loop42.de/api"
|
|
TOKEN = "7Oorb9S3OpwFyWgm4zi_Tq7GeamefbjjTgooPVPWAwPDOf6B4TvgvQlLbhmT4DjsqBS_D1g"
|
|
HEADERS = {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
|
|
|
|
def send(text):
|
|
r = httpx.post(f"{API}/send", json={"text": text}, headers=HEADERS, timeout=30)
|
|
d = r.json()
|
|
return d.get("response", "").strip(), d.get("memorizer", {})
|
|
|
|
def clear():
|
|
httpx.post(f"{API}/clear", headers=HEADERS, timeout=10)
|
|
|
|
tests = [
|
|
("hello!", None),
|
|
("what is 42 * 137?", None),
|
|
("create a sqlite db with 5 customers and show them in a table", None),
|
|
("wie spaet ist es?", None),
|
|
]
|
|
|
|
clear()
|
|
print("=== COG TEST RUN ===\n")
|
|
|
|
for i, (msg, _) in enumerate(tests, 1):
|
|
print(f"--- {i}. USER: {msg}")
|
|
resp, memo = send(msg)
|
|
print(f" COG: {resp}")
|
|
print(f" MEMO: name={memo.get('user_name')} mood={memo.get('user_mood')} topic={memo.get('topic')}")
|
|
print()
|
|
time.sleep(0.5)
|
|
|
|
print("=== DONE ===")
|