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

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!"}]
}'