ChatQnA API Smoke Test
Run practical API checks for ChatQnA Core using the documented endpoints in
docs/user-guide/api-reference.md.
Environment setup (run first)
This skill operates on real ChatQnA source files, so the ChatQnA application must be present and commands must run from the app root. Do this before any API validation workflow, whether or not source is already in your workspace.
Run the bundled bootstrap. It searches for an existing ChatQnA checkout by
walking up from the current directory and checking the enclosing git repo, then
reuses it without re-cloning. Only when no checkout is found does it do a
shallow, single-branch, sparse checkout of just
sample-applications/chat-question-and-answer-core from main.
It prints the resolved app root on stdout:
# SKILL_DIR is this skill directory. In-repo it is:
# .github/skills/chatqna-api-smoke-test
SKILL_DIR=".github/skills/chatqna-api-smoke-test"
APP_ROOT="$(bash "$SKILL_DIR/scripts/chatqna-bootstrap.sh")"
cd "$APP_ROOT"
Every command below assumes the working directory is this APP_ROOT.
To use a fork/branch or a specific clone path, override these before running the bootstrap script:
CHATQNA_REPO_URLCHATQNA_REPO_BRANCHCHATQNA_CLONE_DIRCHATQNA_FORCE_CLONE(set to1to force clone)
Codebase root: sample-applications/chat-question-and-answer-core/
What This Skill Produces
- A runtime-aware API validation report for one scope:
- Core health and metadata endpoints
- Chat inference endpoint
- Document ingestion lifecycle endpoints
- Runtime-specific endpoints (OpenVINO device APIs or Ollama model APIs)
- Raw command evidence (
curloutput + HTTP status) for each check. - A concise pass/fail summary with failing endpoint and first actionable next step.
When to Use
- "Smoke test the API"
- "Validate /v1/chatqna endpoints"
- "Check chat endpoint response"
- "Verify Swagger/OpenAPI endpoints"
- "Test runtime-specific endpoints for OpenVINO or Ollama"
Inputs To Confirm
Before running checks, confirm or infer:
- Base host (
HOST_IP, default127.0.0.1) - Port (default
8102) - Runtime (
openvinoorollama, optional but recommended) - Scope (
core,chat,documents,runtime, orall; defaultcore)
Base URL:
http://<HOST_IP>:8102/v1/chatqna
Decision Logic
- If scope is omitted, run
corechecks first (/health,/model, docs/openapi). - If runtime is
openvino, include/deviceschecks. - If runtime is
ollama, include/ollama-modelsand optional/ollama-modelchecks. - If user asks for full validation, run
allchecks. - If user asks for non-destructive tests only, avoid
POST /documentsandDELETE /documents.
Smoke Test Workflow
Run from sample-applications/chat-question-and-answer-core.
1. Ensure Deployment Is Running
If ChatQnA is not already running, start containers before API checks:
# Select runtime profile (choose one)
source scripts/setup_env.sh # OpenVINO CPU (default)
# source scripts/setup_env.sh -d gpu # OpenVINO GPU
# source scripts/setup_env.sh -b ollama # Ollama CPU
# Start services
docker compose -f docker/compose.yaml up -d
# Quick readiness check before API probes
docker compose -f docker/compose.yaml ps
If deployment is already running, continue with API smoke tests.
2. Preflight and URL Setup
HOST_IP=${HOST_IP:-127.0.0.1}
BASE_URL="http://${HOST_IP}:8102/v1/chatqna"
echo "${BASE_URL}"
3. Core Availability
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "${BASE_URL}/health"
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "${BASE_URL}/model"
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "http://${HOST_IP}:8102/v1/chatqna/docs"
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "http://${HOST_IP}:8102/v1/chatqna/openapi.json"
4. Chat API Check
curl -sS -X POST "${BASE_URL}/chat" \
-H "Content-Type: application/json" \
-d '{"input":"What is Retrieval-Augmented Generation?","stream":false}' \
-w "\nHTTP_STATUS:%{http_code}\n"
5. Runtime-Specific Checks
OpenVINO:
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "${BASE_URL}/devices"
# Optional device detail probe
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "${BASE_URL}/devices/CPU"
Ollama:
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "${BASE_URL}/ollama-models"
# Optional named model probe
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "${BASE_URL}/ollama-model?model_id=<model-id>"
6. Document API Checks (Optional)
Non-destructive listing:
curl -sS -w "\nHTTP_STATUS:%{http_code}\n" "${BASE_URL}/documents"
Upload and cleanup (run only when user explicitly requests ingestion testing):
curl -sS -X POST "${BASE_URL}/documents" \
-H "Content-Type: multipart/form-data" \
-F "files=@./doc1.pdf" \
-w "\nHTTP_STATUS:%{http_code}\n"
curl -sS -X DELETE "${BASE_URL}/documents?delete_all=true" \
-w "\nHTTP_STATUS:%{http_code}\n"
Failure Handling
HTTP_STATUSis not 2xx:- report endpoint, status code, and response body snippet
/chatfails:- verify request JSON includes non-empty
input
- verify request JSON includes non-empty
- runtime endpoint mismatch (e.g.,
/deviceson Ollama):- note runtime-specific availability from API reference
- docs/openapi unavailable:
- verify gateway URL and service readiness via
/health
- verify gateway URL and service readiness via
Completion Criteria
- Requested scope is executed against the correct base URL.
- Runtime-specific checks match selected runtime.
- Response includes raw command evidence with HTTP statuses.
- Final summary clearly marks pass/fail by endpoint.
- For failures, provide one actionable next debugging step.