MoltBotMKX / test_api.py
asemxin
fix: image_daemon 接管飞书交互,禁用 OpenClaw 飞书插件
19bb594
raw
history blame contribute delete
652 Bytes
import requests
import json
try:
# 尝试 OpenAI 格式
resp = requests.post("http://127.0.0.1:18789/v1/chat/completions",
json={
"model": "default",
"messages": [{"role": "user", "content": "hello"}]
}, timeout=5)
print(f"POST /v1/chat/completions: {resp.status_code}")
print(resp.text[:200])
except Exception as e:
print(f"POST /v1/chat/completions error: {e}")
try:
# 尝试 OpenClaw 原生格式 (如果有)
resp = requests.get("http://127.0.0.1:18789/health", timeout=5)
print(f"GET /health: {resp.status_code}")
except Exception as e:
print(f"GET /health error: {e}")