AS AgentScopeAPI 手册 / API Reference

ValidationResult

class ValidationResult
源码Source io/agentscope/core/tool/coding/CommandValidator.java:154–184

命令校验的结果。位于 io.agentscope.core.tool.coding 包。核心成员包括 isAllowed、getReason、getExecutable、allowed、rejected、ValidationResult。

Result of command validation.

构造器摘要Constructor Summary

构造器Constructor说明Description
public ValidationResult(boolean allowed, String reason, String executable)
初始化 `ValidationResult` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public boolean isAllowed()
判断是否已允许。
Returns whether the allowed.
public String getReason()
获取推理。
Returns the reason.
public String getExecutable()
获取 `getExecutable`。
Returns the executable.
public static ValidationResult allowed(String executable)
static
设置已允许。
Performs the allowed operation.
public static ValidationResult rejected(String reason, String executable)
static
执行已拒绝相关操作。
Performs the rejected operation.

构造器详情Constructor Detail

ValidationResult

public ValidationResult(boolean allowed, String reason, String executable)

初始化 ValidationResult 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
allowedboolean已允许(类型 `boolean`)。The allowed.
reasonString原因(类型 `String`)。The reason.
executableStringexecutable(类型 `String`)。The executable.
源码Source io/agentscope/core/tool/coding/CommandValidator.java:159–163

方法详情Method Detail

isAllowed

public boolean isAllowed()

判断是否已允许。

Returns whether the allowed.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/tool/coding/CommandValidator.java:165–167

getReason

public String getReason()

获取推理。

Returns the reason.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/tool/coding/CommandValidator.java:169–171

getExecutable

public String getExecutable()

获取 getExecutable。

Returns the executable.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/tool/coding/CommandValidator.java:173–175

allowed

public static ValidationResult allowed(String executable)
static

设置已允许。

Performs the allowed operation.

参数Parameters
名称Name类型Type说明Description
executableStringexecutable(类型 `String`)。The executable.
返回Returns ValidationResult
返回ValidationResult。Returns validation result.
源码Source io/agentscope/core/tool/coding/CommandValidator.java:177–179

rejected

public static ValidationResult rejected(String reason, String executable)
static

执行已拒绝相关操作。

Performs the rejected operation.

参数Parameters
名称Name类型Type说明Description
reasonString原因(类型 `String`)。The reason.
executableStringexecutable(类型 `String`)。The executable.
返回Returns ValidationResult
返回ValidationResult。Returns validation result.
源码Source io/agentscope/core/tool/coding/CommandValidator.java:181–183
基于官方固定版本源码静态生成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.