24 lines
522 B
Python
24 lines
522 B
Python
import requests
|
|
import json
|
|
|
|
base_url = "http://localhost:18789"
|
|
headers = {"Content-Type": "application/json"}
|
|
|
|
# 测试 agent turn
|
|
payload = {
|
|
"message": "你好,测试一下",
|
|
"model": "default"
|
|
}
|
|
|
|
try:
|
|
r = requests.post(
|
|
f"{base_url}/api/v1/agents/turn",
|
|
json=payload,
|
|
headers=headers,
|
|
timeout=30
|
|
)
|
|
print(f"Status: {r.status_code}")
|
|
print(f"Response: {json.dumps(r.json()[:500], indent=2, ensure_ascii=False)}")
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|