upload_file_stream
Streams file chunks to the bot's local storage and returns a sendable local file path. Supports resumable stream state, chunk verification, and SHA256 checks.
Instructions
以流式分块方式上传文件到机器人本地(返回可用于发送的本地路径) 第 1 步:每次上传生成新的 stream_id;这里上传 hello 的唯一分块。通过 invoke_action 调用,分块确认不等于整文件完成。 Returns: 流式帧:分块确认 type=stream、完成 type=response(含 file_path/file_name/file_size/sha256)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"stream_id": "<stream_id>"
},
"name": "upload_file_stream"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reset | No | 重置并丢弃该流 | |
| filename | No | 文件名 | |
| file_size | No | 文件总大小(字节) | |
| stream_id | Yes | 流 ID(客户端生成的 UUID,限 [A-Za-z0-9_-]) | |
| chunk_data | No | 分块数据(Base64) | |
| chunk_index | No | 分块索引(从 0 开始) | |
| is_complete | No | 是否为最后一个分块/触发合并 | |
| verify_only | No | 仅查询当前流状态 | |
| total_chunks | No | 总分块数(新流必填) | |
| file_retention | No | 合并文件保留毫秒(0=不回收) | |
| expected_sha256 | No | 期望的整文件 SHA256(校验) |