AS AgentScopeAPI 手册 / API Reference

ExecResult

public record ExecResult(int exitCode, String stdout, String stderr, boolean truncated)
源码Source io/agentscope/harness/agent/sandbox/ExecResult.java:26–49

沙箱命令执行的结果。位于 io.agentscope.harness.agent.sandbox 包。核心成员包括 exitCode、stdout、stderr、truncated、ok、combinedOutput。

Result of a sandbox command execution.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
exitCodeint
执行 `exitCode` 方法。
process exit code (0 indicates success)
stdoutString
执行 `stdout` 方法。
captured standard output
stderrString
执行 `stderr` 方法。
captured standard error
truncatedboolean
执行 `truncated` 方法。
whether output was truncated due to exceeding the maximum capture size

方法摘要Method Summary

方法Method说明Description
public boolean ok()
返回ok。
Returns `true` if the command exited with code 0.
public String combinedOutput()
返回 `combinedOutput` 结果。
Returns combined stdout and stderr, with stderr prefixed with "[stderr]" if non-empty.

记录组件详情Record Component Detail

exitCode

int exitCode

执行 exitCode 方法。

process exit code (0 indicates success)

源码Source io/agentscope/harness/agent/sandbox/ExecResult.java:26–49

stdout

String stdout

执行 stdout 方法。

captured standard output

源码Source io/agentscope/harness/agent/sandbox/ExecResult.java:26–49

stderr

String stderr

执行 stderr 方法。

captured standard error

源码Source io/agentscope/harness/agent/sandbox/ExecResult.java:26–49

truncated

boolean truncated

执行 truncated 方法。

whether output was truncated due to exceeding the maximum capture size

源码Source io/agentscope/harness/agent/sandbox/ExecResult.java:26–49

方法详情Method Detail

ok

public boolean ok()

返回ok。

Returns true if the command exited with code 0.

返回Returns boolean
返回布尔值,表示判断结果。true if exit code is 0
源码Source io/agentscope/harness/agent/sandbox/ExecResult.java:33–35

combinedOutput

public String combinedOutput()

返回 combinedOutput 结果。

Returns combined stdout and stderr, with stderr prefixed with "[stderr]" if non-empty.

返回Returns String
返回字符串结果。combined output string
源码Source io/agentscope/harness/agent/sandbox/ExecResult.java:42–48
基于官方固定版本源码静态生成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.