agent-runtime/test_assay.py
Nico bf11312b4b Rename cog -> assay across codebase
- Rename files: cog_cli.py, test_cog.py, k8s/cog-*.yaml
- Update all Python tool names: cog_* -> assay_*
- Update FastAPI titles, MCP server names, URLs
- Update K8s manifests: deployments, services, secrets, ingress
- Update Docker env vars: COG_API -> ASSAY_API
- Domain: cog.loop42.de -> assay.loop42.de
- SQLite path: /tmp/cog_db.sqlite -> /tmp/assay_db.sqlite

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 01:39:05 +02:00

35 lines
1.1 KiB
Python

"""Test script for assay runtime API. Run with: .venv/Scripts/python.exe test_assay.py"""
import httpx, sys, time
API = "https://assay.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("=== ASSAY TEST RUN ===\n")
for i, (msg, _) in enumerate(tests, 1):
print(f"--- {i}. USER: {msg}")
resp, memo = send(msg)
print(f" ASSAY: {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 ===")