feat: 实现 AgentScope tool call context,支持 runtime 上下文续接
This commit is contained in:
@@ -122,7 +122,7 @@ Base URL: `/api/v1/agent`
|
||||
}
|
||||
```
|
||||
|
||||
tool 消息在存储层用于运行时上下文续接,不在 `/history` 对外返回。
|
||||
tool 消息在存储层用于运行时上下文续接,不在 `/history` 对外返回。续接时以 `metadata.tool_agent_output` 作为主信源(`content` 为轻量摘要)。
|
||||
|
||||
### 说明
|
||||
|
||||
|
||||
@@ -165,6 +165,12 @@ data: <json>
|
||||
|
||||
说明:`TOOL_CALL_RESULT` 不再携带 `ui_schema`。tool 结果通过 `result` 字段提供紧凑、结构化、可执行的信息(优先包含 id/status/count 等关键事实),用于 agent 后续推理与工具编排。
|
||||
|
||||
补充约束:
|
||||
|
||||
- `tool_call_id` 必须与同次调用的 `TOOL_CALL_START/ARGS/END.toolCallId` 一致,并在每次工具调用中保持唯一。
|
||||
- `tool_call_args` 仅表示输入参数快照。
|
||||
- `result` 仅表示执行输出事实,不重复 `tool_call_args` 已包含的输入参数。
|
||||
|
||||
### 3.4 文本完成事件
|
||||
|
||||
#### `TEXT_MESSAGE_END`
|
||||
|
||||
@@ -98,7 +98,11 @@ data: <json>
|
||||
- events:在 runtime 发送事件前编译,字段名为 `ui_schema`
|
||||
- history:在历史转换时编译,字段名为 `ui_schema`
|
||||
|
||||
tool 结果不再走 UI 编译链路:`TOOL_CALL_RESULT` 仅提供 `result`,并在持久化时写入 message `content`。
|
||||
tool 结果不再走 UI 编译链路:`TOOL_CALL_RESULT` 提供 `tool_call_args` + `result` 组合。
|
||||
|
||||
- `metadata.tool_agent_output` 是 tool 消息的完整信源(用于 runtime observation 与 history replay)。
|
||||
- `message.content` 保持轻量摘要(当前等于 `result`)。
|
||||
- `tool_call_args` 记录输入参数,`result` 记录输出事实,二者不做冗余重复。
|
||||
|
||||
### 5.3 当前命名差异(实现现状)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user