AS AgentScopeAPI 手册 / API Reference

EditResult

public record EditResult(String path, String error, Integer occurrences)
源码Source io/agentscope/harness/agent/filesystem/model/EditResult.java:25–38

承载 Edit 结果数据的记录类型。位于 io.agentscope.harness.agent.filesystem.model 包。核心成员包括 path、error、occurrences、ok、fail、isSuccess。

Result of a file edit (string replacement) operation.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
pathString
执行路径相关操作。
absolute path of edited file, `null` on failure
errorString
执行错误相关操作。
error message on failure, `null` on success
occurrencesInteger
执行 `occurrences` 方法。
number of replacements made, `null` on failure

方法摘要Method Summary

方法Method说明Description
public static EditResult ok(String path, int occurrences)
static
执行 `ok` 方法。
Performs the ok operation.
public static EditResult fail(String error)
static
设置该参数。
Performs the fail operation.
public boolean isSuccess()
判断是否成功。
Returns whether the success.

记录组件详情Record Component Detail

path

String path

执行路径相关操作。

absolute path of edited file, null on failure

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

error

String error

执行错误相关操作。

error message on failure, null on success

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

occurrences

Integer occurrences

执行 occurrences 方法。

number of replacements made, null on failure

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

方法详情Method Detail

ok

public static EditResult ok(String path, int occurrences)
static

执行 ok 方法。

Performs the ok operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
occurrencesintoccurrences(类型 `int`)。The occurrences.
返回Returns EditResult
返回EditResult。Returns edit result.
源码Source io/agentscope/harness/agent/filesystem/model/EditResult.java:27–29

fail

public static EditResult fail(String error)
static

设置该参数。

Performs the fail operation.

参数Parameters
名称Name类型Type说明Description
errorString错误(类型 `String`)。The error.
返回Returns EditResult
返回EditResult。Returns edit result.
源码Source io/agentscope/harness/agent/filesystem/model/EditResult.java:31–33

isSuccess

public boolean isSuccess()

判断是否成功。

Returns whether the success.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/filesystem/model/EditResult.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.