-
Notifications
You must be signed in to change notification settings - Fork 105
/
test.sh
36 lines (33 loc) · 898 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# 设置请求的 URL
URL="http://127.0.0.1:8001/backend-api/conversation"
# 设置token
TOKEN="ba2bd26d-2ac9-42f1-8f76-4b2b2eb5b0ce"
# 设置请求体数据
DATA='{
"action": "next",
"messages": [
{
"id": "08e897bc-c610-4ac4-ac30-7be96e17331e",
"author": {
"role": "user"
},
"content": {
"content_type": "text",
"parts": [
"讲个故事吧\n"
]
}
}
],
"parent_message_id": "1d46d519-c4a5-4676-a62f-a531dc1e81dd",
"model": "text-davinci-002-render-sha",
"timezone_offset_min": -480
}'
# 发起 POST 请求,并指定请求体为 JSON 格式
curl -X POST \
-H "Content-Type: application/json" \
-H "authkey: 123456" \
-H "Authorization: Bearer $TOKEN" \
-d "$DATA" \
"$URL"