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 Detail
mode
public Builder mode(PermissionMode mode)
设置模式。
Performs the mode operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mode | PermissionMode | 模式(类型 `PermissionMode`)。The mode. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/permission/PermissionContextState.java:211–214addWorkingDirectory
public Builder addWorkingDirectory(String key, AdditionalWorkingDirectory directory)
添加 addWorkingDirectory。
Adds the working directory.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
directory | AdditionalWorkingDirectory | 目录(类型 `AdditionalWorkingDirectory`)。The directory. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/permission/PermissionContextState.java:216–221addAllowRule
public Builder addAllowRule(String toolName, PermissionRule rule)
添加 addAllowRule。
Adds the allow rule.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolName | String | 工具名称(类型 `String`)。The tool name. |
rule | PermissionRule | 规则(类型 `PermissionRule`)。The rule. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/permission/PermissionContextState.java:223–226addDenyRule
public Builder addDenyRule(String toolName, PermissionRule rule)
添加拒绝规则。
Adds the deny rule.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolName | String | 工具名称(类型 `String`)。The tool name. |
rule | PermissionRule | 规则(类型 `PermissionRule`)。The rule. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/permission/PermissionContextState.java:228–231addAskRule
public Builder addAskRule(String toolName, PermissionRule rule)
添加 addAskRule。
Adds the ask rule.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolName | String | 工具名称(类型 `String`)。The tool name. |
rule | PermissionRule | 规则(类型 `PermissionRule`)。The rule. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/permission/PermissionContextState.java:233–236build
public PermissionContextState build()
构建并返回最终实例。
Creates and returns an instance.
PermissionContextState返回PermissionContextState。Returns permission context state.
源码Source
io/agentscope/core/permission/PermissionContextState.java:245–247