AS AgentScopeAPI 手册 / API Reference

Builder

public static final class Builder
源码Source io/agentscope/core/permission/PermissionContextState.java:201–248

构建器,用于构建并配置目标实例。位于 io.agentscope.core.permission 包。核心成员包括 mode、addWorkingDirectory、addAllowRule、addDenyRule、addAskRule、build。

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

方法摘要Method Summary

方法Method说明Description
public Builder mode(PermissionMode mode)
设置模式。
Performs the mode operation.
public Builder addWorkingDirectory(String key, AdditionalWorkingDirectory directory)
添加 `addWorkingDirectory`。
Adds the working directory.
public Builder addAllowRule(String toolName, PermissionRule rule)
添加 `addAllowRule`。
Adds the allow rule.
public Builder addDenyRule(String toolName, PermissionRule rule)
添加拒绝规则。
Adds the deny rule.
public Builder addAskRule(String toolName, PermissionRule rule)
添加 `addAskRule`。
Adds the ask rule.
public PermissionContextState build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

mode

public Builder mode(PermissionMode mode)

设置模式。

Performs the mode operation.

参数Parameters
名称Name类型Type说明Description
modePermissionMode模式(类型 `PermissionMode`)。The mode.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/permission/PermissionContextState.java:211–214

addWorkingDirectory

public Builder addWorkingDirectory(String key, AdditionalWorkingDirectory directory)

添加 addWorkingDirectory。

Adds the working directory.

参数Parameters
名称Name类型Type说明Description
keyString键(类型 `String`)。The key.
directoryAdditionalWorkingDirectory目录(类型 `AdditionalWorkingDirectory`)。The directory.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/permission/PermissionContextState.java:216–221

addAllowRule

public Builder addAllowRule(String toolName, PermissionRule rule)

添加 addAllowRule。

Adds the allow rule.

参数Parameters
名称Name类型Type说明Description
toolNameString工具名称(类型 `String`)。The tool name.
rulePermissionRule规则(类型 `PermissionRule`)。The rule.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/permission/PermissionContextState.java:223–226

addDenyRule

public Builder addDenyRule(String toolName, PermissionRule rule)

添加拒绝规则。

Adds the deny rule.

参数Parameters
名称Name类型Type说明Description
toolNameString工具名称(类型 `String`)。The tool name.
rulePermissionRule规则(类型 `PermissionRule`)。The rule.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/permission/PermissionContextState.java:228–231

addAskRule

public Builder addAskRule(String toolName, PermissionRule rule)

添加 addAskRule。

Adds the ask rule.

参数Parameters
名称Name类型Type说明Description
toolNameString工具名称(类型 `String`)。The tool name.
rulePermissionRule规则(类型 `PermissionRule`)。The rule.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/permission/PermissionContextState.java:233–236

build

public PermissionContextState build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns PermissionContextState
返回PermissionContextState。Returns permission context state.
源码Source io/agentscope/core/permission/PermissionContextState.java:245–247
基于官方固定版本源码静态生成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.