Repository navigation
Expand file tree
/
Copy pathserver.http
More file actions
76 lines (58 loc) · 2.44 KB
/
Copy pathserver.http
File metadata and controls
76 lines (58 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Every route of server.py, for the REST Client extension (humao.rest-client).
# Start the server first: uv run uvicorn server:app --port 8000
# Click "Send Request" above a request.
#
# Create a session, copy the "id" from the response, and replace SESSION_ID in the URLs below.
# Copy ARTIFACT_ID from the artifacts list.
#
# This extension cannot show a stream, so subscribe to events in a terminal instead:
# curl -N http://127.0.0.1:8000/sessions/SESSION_ID/events
### Create a session (POST /sessions)
POST http://127.0.0.1:8000/sessions
Content-Type: application/json
{
"message": "Use get_customer to tell me customer 123's plan."
}
### List sessions (GET /sessions)
GET http://127.0.0.1:8000/sessions?limit=5
### Get one session: status and pending actions (GET /sessions/{id})
GET http://127.0.0.1:8000/sessions/SESSION_ID
### Update reasoning effort: low, medium or high (PATCH /sessions/{id})
PATCH http://127.0.0.1:8000/sessions/SESSION_ID
Content-Type: application/json
{
"effort": "low"
}
### Saved history (GET /sessions/{id}/items)
GET http://127.0.0.1:8000/sessions/SESSION_ID/items
### Send a message (POST /sessions/{id}/messages)
# Sending again with the same Idempotency-Key is treated as a retry, not a new message.
POST http://127.0.0.1:8000/sessions/SESSION_ID/messages
Content-Type: application/json
Idempotency-Key: my-first-message
{
"text": "Tell me customer 123's plan."
}
### Cancel the running turn (POST /sessions/{id}/cancel)
POST http://127.0.0.1:8000/sessions/SESSION_ID/cancel
### Stream events (GET /sessions/{id}/events)
# Not sent from here. Run in a terminal: curl -N http://127.0.0.1:8000/sessions/SESSION_ID/events
### Delete the session (DELETE /sessions/{id})
DELETE http://127.0.0.1:8000/sessions/SESSION_ID
### Upload a file into the hosted workspace (POST /sessions/{id}/files)
POST http://127.0.0.1:8000/sessions/SESSION_ID/files
Content-Type: application/json
{
"path": "/workspace/notes.txt",
"text": "Course verified\n"
}
### Ask the agent to write a file that becomes an artifact
POST http://127.0.0.1:8000/sessions/SESSION_ID/messages
Content-Type: application/json
{
"text": "Copy /workspace/notes.txt to /workspace/outputs/notes.txt."
}
### List artifacts and copy an artifact "id" (GET /sessions/{id}/artifacts)
GET http://127.0.0.1:8000/sessions/SESSION_ID/artifacts
### Download an artifact (GET /sessions/{id}/artifacts/{artifact_id})
GET http://127.0.0.1:8000/sessions/SESSION_ID/artifacts/ARTIFACT_ID