feat(agent): complete closed-loop runtime and pricing fallback
This commit is contained in:
@@ -786,6 +786,86 @@
|
||||
|
||||
---
|
||||
|
||||
## Agent Runtime
|
||||
|
||||
### POST /agent/runs
|
||||
|
||||
创建一次 Agent 异步运行任务(需要认证)。
|
||||
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
"session_id": "string? (optional, 为空时自动创建会话)",
|
||||
"prompt": "string (1-5000 chars)"
|
||||
}
|
||||
```
|
||||
|
||||
**Response:** 202 Accepted
|
||||
```json
|
||||
{
|
||||
"task_id": "string",
|
||||
"session_id": "string",
|
||||
"created": true
|
||||
}
|
||||
```
|
||||
|
||||
**Errors:**
|
||||
- 401: 未认证
|
||||
- 403: 非会话 owner
|
||||
- 422: 请求参数无效
|
||||
|
||||
---
|
||||
|
||||
### POST /agent/runs/{session_id}/resume
|
||||
|
||||
恢复一次等待工具结果的 Agent 运行(需要认证)。
|
||||
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
"tool_call_id": "string"
|
||||
}
|
||||
```
|
||||
|
||||
**Response:** 202 Accepted
|
||||
```json
|
||||
{
|
||||
"task_id": "string",
|
||||
"session_id": "string",
|
||||
"created": false
|
||||
}
|
||||
```
|
||||
|
||||
**Errors:**
|
||||
- 401: 未认证
|
||||
- 403: 非会话 owner
|
||||
- 422: 请求参数无效
|
||||
|
||||
---
|
||||
|
||||
### GET /agent/runs/{session_id}/events
|
||||
|
||||
订阅 Agent SSE 事件流(需要认证)。
|
||||
|
||||
**Headers:**
|
||||
- `Last-Event-ID` (optional): 断点续传游标
|
||||
|
||||
**Response:** 200 OK
|
||||
`Content-Type: text/event-stream`
|
||||
|
||||
```text
|
||||
id: 2-0
|
||||
event: RUN_STARTED
|
||||
data: {"session_id":"..."}
|
||||
|
||||
```
|
||||
|
||||
**Errors:**
|
||||
- 401: 未认证
|
||||
- 403: 非会话 owner
|
||||
|
||||
---
|
||||
|
||||
## Infra
|
||||
|
||||
### GET /infra/health
|
||||
|
||||
Reference in New Issue
Block a user