#!/usr/bin/env python3
"""Test Qwen via Docker exec - writes payload to temp file, runs worker."""
import subprocess, json
key = ""
with open("/etc/graphiti/graphiti.env") as f:
for line in f:
if line.startswith("OPENROUTER_API_KEY="):
key = line.split("=", 1)[1].strip()
break
payload = {
"model": "qwen/qwen3.7-flash",
"messages": [{"role": "user", "content": 'Test mit reasoning none'}],
"effective_timeout": 60,
"api_key": key,
"base_url": "https://openrouter.ai/api/v1",
}
# Write payload to tmp on VPS
with open('/tmp/test_payload.json', 'w') as f:
json.dump(payload, f)
print(f"Payload written to /tmp/test_payload.json (key length: {len(key)} chars)")