wip: 2026-08-11 工作树快照(docs/memory/h5.py/scripts 等 447 项未评审改动,安全提交到 feat 分支)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Test the approval detect-intent API endpoint."""
|
||||
import json
|
||||
import httpx
|
||||
|
||||
# Test the API endpoint from inside the container
|
||||
url = "https://localhost/api/approval/detect-intent"
|
||||
|
||||
test_messages = [
|
||||
"我要申请VPN",
|
||||
"我的电脑坏了",
|
||||
"我要申请办公用品",
|
||||
"你好,今天天气怎么样?",
|
||||
]
|
||||
|
||||
for msg in test_messages:
|
||||
print(f"\n=== Testing: {msg} ===")
|
||||
try:
|
||||
resp = httpx.post(
|
||||
url,
|
||||
json={"text": msg},
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=30.0,
|
||||
verify=False, # self-signed cert
|
||||
)
|
||||
print(f" HTTP: {resp.status_code}")
|
||||
print(f" Response: {resp.text[:500]}")
|
||||
if resp.status_code == 200:
|
||||
data = resp.json()
|
||||
result = data.get("data", data)
|
||||
print(f" is_approval: {result.get('is_approval_request')}")
|
||||
print(f" confidence: {result.get('confidence')}")
|
||||
print(f" type: {result.get('approval_type')}")
|
||||
print(f" source: {result.get('source')}")
|
||||
except Exception as e:
|
||||
print(f" ERROR: {type(e).__name__}: {e}")
|
||||
Reference in New Issue
Block a user