提示:后续新增的 API 接口都会在此页面补充调用示例。
curl -i https://你的域名/api/health
curl -X POST https://你的域名/api/chat/en \
-H "Content-Type: application/json" \
-d '{
"my_nick":"my_account",
"peer_nick":"peer_user",
"persona_id":"1",
"message_history":[
{"role":"user","content":"Hey"},
{"role":"assistant","content":"Hi 😊 How’s your day going?"}
]
}'
{
"reply": "....",
"session_id": "...",
"ended": false,
"end_reason": ""
}
curl -X POST https://你的域名/api/leads/check_or_add \
-H "Content-Type: application/json" \
-d '{
"uid":"6980795100092138502"
}'
{
"success": true,
"status": "duplicate",
"message": "重复"
}
{
"success": true,
"status": "new",
"message": "未重复"
}
curl -X POST https://你的域名/api/sessions/followup \
-H "Content-Type: application/json" \
-d '{
"idle_seconds": 3600,
"limit": 20
}'
{"uid":"...","my_nick":"my_account","peer_nick":"peer_user","reply":"...","delay_seconds":3,"ended":false,"success":true}
{"uid":"...","my_nick":"my_account","peer_nick":"peer_user","reply":"...","delay_seconds":2,"ended":false,"success":true}
curl -X POST https://你的域名/api/sessions/followup \
-H "Content-Type: application/json" \
-d '{
"idle_seconds": 3600,
"limit": 20,
"format": "json"
}'
{
"success": true,
"count": 2,
"items": [
{"uid":"...","my_nick":"my_account","peer_nick":"peer_user","reply":"...","delay_seconds":3,"ended":false,"success":true}
]
}