Skip to content

Commit ccc914d

Browse files
committed
Updated documentation
1 parent 469cc40 commit ccc914d

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

eval-server/nodejs/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,59 @@ curl -X POST http://localhost:8081/v1/responses \
350350
-d '{"input": "What is 2+2?"}'
351351
```
352352

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+
353406
## CLI Usage
354407

355408
Interactive command-line interface for server management:

0 commit comments

Comments
 (0)