AS AgentScopeAPI 手册 / API Reference

PermissionBehavior

public enum PermissionBehavior
源码Source io/agentscope/core/permission/PermissionBehavior.java:32–69

定义权限行为相关取值的枚举。位于 io.agentscope.core.permission 包。核心成员包括 getValue、fromString、ALLOW、DENY、ASK、PASSTHROUGH。

Outcome of a permission rule or tool self-check.

  • #ALLOW: proceed without further checks.

  • #DENY: reject the tool invocation.

  • #ASK: defer to the user for a confirmation.

  • #PASSTHROUGH: tool defers decision back to the engine for rule matching.

枚举常量摘要Enum Constant Summary

常量Constant说明Description
ALLOW
执行 `ALLOW` 方法。
Performs the ALLOW operation.
DENY
执行拒绝相关操作。
Performs the DENY operation.
ASK
执行 `ASK` 方法。
Performs the ASK operation.
PASSTHROUGH
执行 `PASSTHROUGH` 方法。
Performs the PASSTHROUGH operation.

方法摘要Method Summary

方法Method说明Description
public String getValue()
获取值。
Returns the value.
public static PermissionBehavior fromString(String value)
static
设置该参数。
Resolves a string (case-insensitive) to a `PermissionBehavior`.

枚举常量详情Enum Constant Detail

ALLOW

ALLOW("allow")
staticfinal

执行 ALLOW 方法。

Performs the ALLOW operation.

源码Source io/agentscope/core/permission/PermissionBehavior.java:33

DENY

DENY("deny")
staticfinal

执行拒绝相关操作。

Performs the DENY operation.

源码Source io/agentscope/core/permission/PermissionBehavior.java:34

ASK

ASK("ask")
staticfinal

执行 ASK 方法。

Performs the ASK operation.

源码Source io/agentscope/core/permission/PermissionBehavior.java:35

PASSTHROUGH

PASSTHROUGH("passthrough")
staticfinal

执行 PASSTHROUGH 方法。

Performs the PASSTHROUGH operation.

源码Source io/agentscope/core/permission/PermissionBehavior.java:36

方法详情Method Detail

getValue

public String getValue()

获取值。

Returns the value.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/permission/PermissionBehavior.java:44–47

fromString

public static PermissionBehavior fromString(String value)
static

设置该参数。

Resolves a string (case-insensitive) to a PermissionBehavior.

参数Parameters
名称Name类型Type说明Description
valueString值(类型 `String`)。JSON / config string representation
返回Returns PermissionBehavior
返回PermissionBehavior。matching behavior
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if no enum value matches
源码Source io/agentscope/core/permission/PermissionBehavior.java:56–68
基于官方固定版本源码静态生成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.