AS AgentScopeAPI 手册 / API Reference

FileDownloadResponse

public record FileDownloadResponse(String path, byte[] content, String error)
源码Source io/agentscope/harness/agent/filesystem/model/FileDownloadResponse.java:25–38

承载文件下载响应数据的记录类型。位于 io.agentscope.harness.agent.filesystem.model 包。核心成员包括 path、content、error、success、fail、isSuccess。

Result of a single file download operation.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
pathString
执行路径相关操作。
the file path that was requested
contentbyte[]
执行内容相关操作。
file contents as bytes on success, `null` on failure
errorString
执行错误相关操作。
error description on failure, `null` on success

方法摘要Method Summary

方法Method说明Description
public static FileDownloadResponse success(String path, byte[] content)
static
执行成功相关操作。
Performs the success operation.
public static FileDownloadResponse fail(String path, String error)
static
执行 `fail` 方法。
Performs the fail operation.
public boolean isSuccess()
判断是否成功。
Returns whether the success.

记录组件详情Record Component Detail

path

String path

执行路径相关操作。

the file path that was requested

源码Source io/agentscope/harness/agent/filesystem/model/FileDownloadResponse.java:25–38

content

byte[] content

执行内容相关操作。

file contents as bytes on success, null on failure

源码Source io/agentscope/harness/agent/filesystem/model/FileDownloadResponse.java:25–38

error

String error

执行错误相关操作。

error description on failure, null on success

源码Source io/agentscope/harness/agent/filesystem/model/FileDownloadResponse.java:25–38

方法详情Method Detail

success

public static FileDownloadResponse success(String path, byte[] content)
static

执行成功相关操作。

Performs the success operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
contentbyte[]内容(类型 `byte[]`)。The content.
返回Returns FileDownloadResponse
返回FileDownloadResponse。Returns file download response.
源码Source io/agentscope/harness/agent/filesystem/model/FileDownloadResponse.java:27–29

fail

public static FileDownloadResponse fail(String path, String error)
static

执行 fail 方法。

Performs the fail operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
errorString错误(类型 `String`)。The error.
返回Returns FileDownloadResponse
返回FileDownloadResponse。Returns file download response.
源码Source io/agentscope/harness/agent/filesystem/model/FileDownloadResponse.java:31–33

isSuccess

public boolean isSuccess()

判断是否成功。

Returns whether the success.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/filesystem/model/FileDownloadResponse.java:35–37
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.