You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: eval-server/nodejs/README.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -350,6 +350,59 @@ curl -X POST http://localhost:8081/v1/responses \
350
350
-d '{"input": "What is 2+2?"}'
351
351
```
352
352
353
+
#### `/v1/responses` Endpoint Details
354
+
355
+
The `/v1/responses` endpoint provides an OpenAI-compatible interface for chat requests. **Each request automatically creates a new browser tab** to isolate the chat session.
356
+
357
+
**Behavior:**
358
+
1. Finds a client with existing tabs (skips dummy clients with 0 tabs)
359
+
2. Opens a new browser tab via Chrome DevTools Protocol (CDP)
360
+
3. Waits for the tab's DevTools to connect (up to 10 seconds)
361
+
4. Executes the chat request in the isolated new tab
362
+
5. Returns the response in OpenAI Responses API format
363
+
364
+
**Request Format:**
365
+
```json
366
+
{
367
+
"input": "Your question or prompt here",
368
+
"model": {
369
+
"main_model": {
370
+
"provider": "openai",
371
+
"model": "gpt-4",
372
+
"api_key": "sk-..."
373
+
}
374
+
}
375
+
}
376
+
```
377
+
378
+
**Response Format:**
379
+
```json
380
+
[
381
+
{
382
+
"id": "msg_...",
383
+
"type": "message",
384
+
"role": "assistant",
385
+
"content": [
386
+
{
387
+
"type": "output_text",
388
+
"text": "Response text here",
389
+
"annotations": []
390
+
}
391
+
]
392
+
}
393
+
]
394
+
```
395
+
396
+
**Requirements:**
397
+
- At least one DevTools client must have a connected tab
398
+
- Chrome must be running with remote debugging enabled (port 9223)
399
+
400
+
**Benefits:**
401
+
- Each chat request runs in isolation
402
+
- Supports parallel requests in different tabs
403
+
- Better tracking and debugging per request
404
+
- Automatic cleanup via browser tab management
405
+
353
406
## CLI Usage
354
407
355
408
Interactive command-line interface for server management:
0 commit comments