This commit is contained in:
Zheng Kai
2023-08-01 15:08:01 +08:00
parent e18c1db55e
commit 71ec1811e1
13 changed files with 110 additions and 17 deletions

View File

@@ -21,8 +21,6 @@ COPY --from=builder /project/server/dist/prod/orca-server-next /orca-server
COPY ./misc/docker/http-ca.crt /etc/ssl/certs/elastic-http-ca.crt
RUN apk add --no-cache gzip brotli
ENV TZ="Asia/Shanghai"
ENV ORCA_WEB=":80"

View File

@@ -2,9 +2,9 @@
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl "${BASE}/chat/completions" \
curl -v "${BASE}/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY} no-cache" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]

14
misc/test/direct.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash -ex
OPENAI_API_KEY="sk-rhjeVT1fkcuarBKnQR6ST$(cat ~/.config/openai)"
export OPENAI_API_KEY
BASE="https://api.openai.com/v1"
curl -v "${BASE}/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
}'

3
misc/test/local-chat.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
OPENAI_API_BASE=http://localhost:22035/v1 ./chat.sh

9
misc/test/moderations.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl -v "${BASE}/moderations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{"input": "你媽逼啊"}' \
| jq . -