-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-api.sh
More file actions
executable file
·30 lines (24 loc) · 826 Bytes
/
Copy pathtest-api.sh
File metadata and controls
executable file
·30 lines (24 loc) · 826 Bytes
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
#!/bin/bash
# --------------------------------------------------
API_HOST_URL="http://127.0.0.1:3000"
TEXT_GENERATION_WEBUI_API_HOST_URL="http://127.0.0.1:5000/api/v1"
# --------------------------------------------------
while true; do
echo -n "User Prompt: "
read user_input
# curl -X POST ${API_HOST_URL}/speech \
# curl -X POST ${API_HOST_URL}/chat \
# -H "Content-Type: application/json" \
# -d '{"userInput": "'"${user_input}"'"}' |
# sed 's/['\'']/_/g' |
# sed 's/['\"']/\\&/g' |
# sed 's/.*/"&"/' |
# jq .
curl -X POST ${TEXT_GENERATION_WEBUI_API_HOST_URL}/chat \
-H "Content-Type: application/json" \
-d '{"user_input": "'"${user_input}"'", "character": "sigma", "mode": "chat"}' |
sed 's/['\'']/_/g' |
sed 's/['\"']/\\&/g' |
sed 's/.*/"&"/' |
jq .
done