docs: add smoke script and auth-aware verification steps
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
"models": {
|
||||
"providers": {
|
||||
"openai": {
|
||||
"apiKey": "sk-xxxx",
|
||||
"apiKey": "<AUTH_TOKEN_OR_PLACEHOLDER>",
|
||||
"baseURL": "http://127.0.0.1:8787/v1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
```bash
|
||||
cd no-reply-api
|
||||
# optional: enforce bearer token checks
|
||||
# export AUTH_TOKEN='replace-with-strong-token'
|
||||
npm start
|
||||
```
|
||||
|
||||
@@ -16,6 +18,14 @@ curl -sS -X POST http://127.0.0.1:8787/v1/chat/completions \
|
||||
-d '{"model":"whispergate-no-reply-v1","messages":[{"role":"user","content":"hi"}]}'
|
||||
```
|
||||
|
||||
Or run bundled smoke check:
|
||||
|
||||
```bash
|
||||
./scripts/smoke-no-reply-api.sh
|
||||
# with auth:
|
||||
# AUTH_TOKEN='replace-with-strong-token' ./scripts/smoke-no-reply-api.sh
|
||||
```
|
||||
|
||||
Expected assistant text: `NO_REPLY`
|
||||
|
||||
## 3) Enable plugin
|
||||
|
||||
32
scripts/smoke-no-reply-api.sh
Executable file
32
scripts/smoke-no-reply-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
BASE_URL="${BASE_URL:-http://127.0.0.1:8787}"
|
||||
AUTH_TOKEN="${AUTH_TOKEN:-}"
|
||||
|
||||
AUTH_HEADER=()
|
||||
if [[ -n "$AUTH_TOKEN" ]]; then
|
||||
AUTH_HEADER=(-H "Authorization: Bearer ${AUTH_TOKEN}")
|
||||
fi
|
||||
|
||||
echo "[1] health"
|
||||
curl -sS "${BASE_URL}/health" | sed -n '1,3p'
|
||||
|
||||
echo "[2] models"
|
||||
curl -sS "${BASE_URL}/v1/models" "${AUTH_HEADER[@]}" | sed -n '1,8p'
|
||||
|
||||
echo "[3] chat/completions"
|
||||
curl -sS -X POST "${BASE_URL}/v1/chat/completions" \
|
||||
-H 'Content-Type: application/json' \
|
||||
"${AUTH_HEADER[@]}" \
|
||||
-d '{"model":"whispergate-no-reply-v1","messages":[{"role":"user","content":"hello"}]}' \
|
||||
| sed -n '1,20p'
|
||||
|
||||
echo "[4] responses"
|
||||
curl -sS -X POST "${BASE_URL}/v1/responses" \
|
||||
-H 'Content-Type: application/json' \
|
||||
"${AUTH_HEADER[@]}" \
|
||||
-d '{"model":"whispergate-no-reply-v1","input":"hello"}' \
|
||||
| sed -n '1,20p'
|
||||
|
||||
echo "smoke ok"
|
||||
Reference in New Issue
Block a user