This commit is contained in:
Zheng Kai
2023-06-13 17:44:37 +08:00
parent b1f64df227
commit 5393e78e3e
4 changed files with 15 additions and 23 deletions

View File

@@ -1,11 +0,0 @@
#!/bin/bash -ex
API_HOST="http://10.0.84.49:22035"
curl "${API_HOST}/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
}'

View File

@@ -1,10 +1,10 @@
#!/bin/bash -ex
API_HOST="http://localhost:22035"
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl "${API_HOST}/v1/chat/completions" \
curl "${BASE}/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]

12
misc/test/completion.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash -ex
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl "${BASE}/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{
"model": "text-davinci-003",
"prompt": "Say this is a test",
"max_tokens": 7,
"temperature": 0
}'

View File

@@ -1,9 +0,0 @@
#!/bin/bash -ex
# API_HOST="http://10.0.84.49:22035"
API_HOST="http://localhost:22035"
curl "${API_HOST}/v1/engines/text-embedding-ada-002/embeddings" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{"input":[ "\u80fd\u91cf\u793c\u7269\u662f\u600e\u4e48\u56de\u4e8b\uff1f\u7528\u4e2d\u6587"], "encoding_format": "base64"}'