RAG Service
← Back to Documentation Center

Testing

This page will describe how to test the API and validate integrations.

  • Example test cases
  • Testing strategies

Unified Test bootstrap JSON

Business impact

Teams validating workflows through the Unified Test UI now see the page paint instantly while data hydrates asynchronously. You can also re-use the bootstrap payload in automated regression tools to mirror the UI defaults without scraping HTML.

Developer details

  • Endpoint: GET /api/v2/unified-test?json=true
  • Includes: active model alias, effective LLM parameter defaults, configured system prompts, prompt source info, and cache metadata (cache_status).
  • Behaviour: The UI calls this after rendering skeleton states; clients should retry gracefully if the cache misses and allow for eventual consistency when prompts update.
  • Migration: Legacy flows require no changes. Adopting the JSON bootstrap is optional but recommended for faster smoke tests.

Examples

curl -X GET "https://yourhost/api/v2/unified-test?json=true" \
    -H "Authorization: Bearer $TOKEN"
import requests

resp = requests.get(
    "https://yourhost/api/v2/unified-test",
    params={"json": "true"},
    headers={"Authorization": f"Bearer {TOKEN}"},
)
resp.raise_for_status()
bootstrap = resp.json()
print("Active model:", bootstrap["active_model"])
print("System prompts:", bootstrap["configured_defaults"]["system_prompts"])
print("LLM params:", bootstrap["llm_params"])

Use the returned defaults to populate smoke tests before executing POST calls to /api/v2/flexible-rag or /api/v2/flexible-chat, ensuring parity with the first-party UI.