added chat client documentation

This commit is contained in:
Storme-bit
2026-04-06 05:00:12 -07:00
parent f6cdc65464
commit 0aea052311
5 changed files with 200 additions and 7 deletions

View File

@@ -14,10 +14,11 @@ or inference services — all traffic flows through orchestration.
## Dependencies
- `express` HTTP API
- `node-fetch` — inter-service HTTP communication (memory service client only)
- `dotenv` — environment variable loading
- `@nexusai/shared` — shared utilities
- `express` : HTTP API
- `cors` : cross-origin resource sharing middleware
- `node-fetch` : inter-service HTTP communication (memory service client only)
- `dotenv` : environment variable loading
- `@nexusai/shared` : shared utilities
> `memory.js` uses `node-fetch` v2 (pinned) because it is CommonJS. All other
> service clients use Node.js built-in `fetch`.
@@ -31,6 +32,7 @@ or inference services — all traffic flows through orchestration.
| EMBEDDING_SERVICE_URL | No | http://localhost:3003 | Embedding service URL |
| INFERENCE_SERVICE_URL | No | http://localhost:3001 | Inference service URL |
| QDRANT_URL | No | http://localhost:6333 | Qdrant URL for semantic search |
| CORS_ORIGIN | No | http://localhost:5173 | Allowed origin for CORS requests |
## Internal Structure
```
@@ -138,6 +140,7 @@ the `{"done":true}` event.
| Method | Path | Description |
|---|---|---|
| GET | /sessions | Get paginated list of all sessions |
| GET | /sessions/:sessionId/history | Get paginated episode history for a session |
---
@@ -215,4 +218,30 @@ Response:
}
```
---
**GET /sessions**
Returns a paginated list of all sessions, ordered by most recently active.
Query parameters:
| Parameter | Default | Description |
|---|---|---|
| limit | 20 | Maximum number of sessions to return |
| offset | 0 | Number of sessions to skip (for pagination) |
Response:
```json
[
{
"id": 1,
"external_id": "test-semantic",
"metadata": null,
"created_at": 1712345678,
"updated_at": 1712345999
}
]
```
Episodes are ordered newest first. Returns `404` if the session does not exist.