AS AgentScopeAPI 手册 / API Reference

PermissionDecision

@JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({"behavior", "message", "decision_reason", "updated_input", "suggested_rules"}) public final class PermissionDecision
源码Source io/agentscope/core/permission/PermissionDecision.java:34–206

权限决策,驱动智能体的推理、工具调用与会话执行。位于 io.agentscope.core.permission 包。核心成员包括 getBehavior、getMessage、getDecisionReason、getUpdatedInput、getSuggestedRules、allow。

Decision returned by a permission rule match or a tool self-check.

A decision carries the PermissionBehavior together with a human-readable message and optional fields used by the engine (rewritten inputs, suggested follow-up rules).

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.core.permission that drives agent reasoning, tool calls and conversation execution.

方法摘要Method Summary

方法Method说明Description
public PermissionBehavior getBehavior()
获取行为。
Returns the behavior.
public String getMessage()
获取消息。
Returns the message.
public String getDecisionReason()
获取决策推理。
Returns the decision reason.
public Map<String, Object> getUpdatedInput()
获取已更新输入。
Returns the updated input.
public List<PermissionRule> getSuggestedRules()
获取 `getSuggestedRules`。
Returns the suggested rules.
public static PermissionDecision allow(String message)
static
设置该参数。
Performs the allow operation.
public static PermissionDecision deny(String message)
static
设置拒绝。
Performs the deny operation.
public static PermissionDecision ask(String message)
static
设置该参数。
Performs the ask operation.
public static PermissionDecision passthrough(String message)
static
设置该参数。
Performs the passthrough operation.
public PermissionDecision withSuggestedRules(List<PermissionRule> suggestedRules)
执行 `withSuggestedRules` 方法。
Returns a copy of this decision with the given suggested rules attached.
public static Builder builder()
static
返回构建器实例。
Returns the builder.
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
public int hashCode()
返回 `hashCode` 结果。
Returns the hash code.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

getBehavior

public PermissionBehavior getBehavior()

获取行为。

Returns the behavior.

返回Returns PermissionBehavior
返回PermissionBehavior。Returns permission behavior.
源码Source io/agentscope/core/permission/PermissionDecision.java:72–75

getMessage

public String getMessage()

获取消息。

Returns the message.

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

getDecisionReason

public String getDecisionReason()

获取决策推理。

Returns the decision reason.

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

getUpdatedInput

public Map<String, Object> getUpdatedInput()

获取已更新输入。

Returns the updated input.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/core/permission/PermissionDecision.java:87–90

getSuggestedRules

public List<PermissionRule> getSuggestedRules()

获取 getSuggestedRules。

Returns the suggested rules.

返回Returns List<PermissionRule>
返回列出。Returns list.
源码Source io/agentscope/core/permission/PermissionDecision.java:92–95

allow

public static PermissionDecision allow(String message)
static

设置该参数。

Performs the allow operation.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
返回Returns PermissionDecision
返回PermissionDecision。Returns permission decision.
源码Source io/agentscope/core/permission/PermissionDecision.java:97–99

deny

public static PermissionDecision deny(String message)
static

设置拒绝。

Performs the deny operation.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
返回Returns PermissionDecision
返回PermissionDecision。Returns permission decision.
源码Source io/agentscope/core/permission/PermissionDecision.java:101–103

ask

public static PermissionDecision ask(String message)
static

设置该参数。

Performs the ask operation.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
返回Returns PermissionDecision
返回PermissionDecision。Returns permission decision.
源码Source io/agentscope/core/permission/PermissionDecision.java:105–107

passthrough

public static PermissionDecision passthrough(String message)
static

设置该参数。

Performs the passthrough operation.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
返回Returns PermissionDecision
返回PermissionDecision。Returns permission decision.
源码Source io/agentscope/core/permission/PermissionDecision.java:109–111

withSuggestedRules

public PermissionDecision withSuggestedRules(List<PermissionRule> suggestedRules)

执行 withSuggestedRules 方法。

Returns a copy of this decision with the given suggested rules attached.

参数Parameters
名称Name类型Type说明Description
suggestedRulesList<PermissionRule>suggested 规则(类型 `List`)。the rules to attach; may be null to clear
返回Returns PermissionDecision
返回PermissionDecision。a new `PermissionDecision` with all other fields preserved
源码Source io/agentscope/core/permission/PermissionDecision.java:119–127

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/permission/PermissionDecision.java:129–131

equals

public boolean equals(Object o)

设置该参数。

Performs the equals operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/permission/PermissionDecision.java:133–146

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/permission/PermissionDecision.java:148–151

toString

public String toString()

返回 toString 结果。

Returns the to string.

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

嵌套类详情Nested Class Detail

Builder

public static final class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.core.permission 包。核心成员包括 behavior、message、decisionReason、updatedInput、suggestedRules、build。

A class in io.agentscope.core.permission that drives agent reasoning, tool calls and conversation execution. Declared in io.agentscope.core.permission.

基于官方固定版本源码静态生成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.