system-prompts-and-models-o.../universal-ai-artifacts/README.md
Cursor Agent 8c202f6339 Add Universal AI Agent artifacts: clients, OpenAPI spec, and utilities
Co-authored-by: escapethematrixmate01 <escapethematrixmate01@gmail.com>
2025-08-08 08:17:34 +00:00

47 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Universal AI Agent Artifact Bundle
Contents:
- `openapi/openapi.yaml`: OpenAPI 3.0 spec
- `postman/UniversalAI.postman_collection.json`: Postman collection (variables: `baseUrl`, `token`)
- `clients/node`: Node client (ESM), SSE streaming, WebSocket sample, rate-limited fetch
- `clients/python`: Python client (`requests`), SSE streaming
- `utils`: Rate-limit-safe helpers (`rate_limit.js`, `rate_limit.py`)
- `scripts/curl.sh`: Handy cURL commands
Quickstart:
1) Postman
- Import `postman/UniversalAI.postman_collection.json`
- Set variables `baseUrl`, `token`
2) OpenAPI
- Load `openapi/openapi.yaml` into Swagger UI/Insomnia/Stoplight
3) Node client
```bash
cd clients/node
npm install
BASE_URL=https://your-domain.com TOKEN=YOUR_TOKEN npm start
# WebSocket sample
BASE_URL=https://your-domain.com TOKEN=YOUR_TOKEN npm run ws
```
4) Python client
```bash
cd clients/python
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
BASE_URL=https://your-domain.com TOKEN=YOUR_TOKEN python examples.py
```
5) cURL
```bash
cd scripts
chmod +x curl.sh
BASE_URL=https://your-domain.com TOKEN=YOUR_TOKEN ./curl.sh chat "Hello"
```
Notes:
- Set `BASE_URL` and `TOKEN` environment variables for all samples.
- Streaming responses are SSE (Server-Sent Events) and parsed via `data: ...` lines.
- Retry/backoff on HTTP 429/5xx is implemented in the rate-limit helpers.