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:33DENY
DENY("deny")
staticfinal
执行拒绝相关操作。
Performs the DENY operation.
源码Source
io/agentscope/core/permission/PermissionBehavior.java:34ASK
ASK("ask")
staticfinal
执行 ASK 方法。
Performs the ASK operation.
源码Source
io/agentscope/core/permission/PermissionBehavior.java:35PASSTHROUGH
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.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/core/permission/PermissionBehavior.java:44–47fromString
public static PermissionBehavior fromString(String value)
static
设置该参数。
Resolves a string (case-insensitive) to a PermissionBehavior.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
value | String | 值(类型 `String`)。JSON / config string representation |
PermissionBehavior返回PermissionBehavior。matching behavior
IllegalArgumentException可能抛出 `IllegalArgumentException`。if no enum value matches
源码Source
io/agentscope/core/permission/PermissionBehavior.java:56–68