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
启动 HTTP API 服务器。
```bash
recursive http [选项]
```
启动基于 axum 的 HTTP 服务器,提供带会话和 SSE 流式输出的 REST API。默认配置为无状态;添加 Redis 和 S3 可支持水平扩展。
```bash
recursive http --addr 127.0.0.1:3000
```
另开终端:
```bash
curl http://localhost:3000/health
SESSION=$(curl -sX POST http://localhost:3000/sessions \
-H 'Content-Type: application/json' \
-d '{"system_prompt":"你是一个有用的助手。"}' | jq -r .session_id)
curl -N http://localhost:3000/sessions/$SESSION/run \
-H 'Content-Type: application/json' \
-d '{"message":"列出 /workspace 中的文件"}'
```
- -