ToolSchemaModule
public class ToolSchemaModule implements Module
源码Source
io/agentscope/core/tool/ToolSchemaModule.java:34–123工具模式 Module,让智能体以受控方式调用外部能力。位于 io.agentscope.core.tool 包,实现 Module。核心成员包括 applyToConfigBuilder、ToolSchemaModule。
A victools JSON Schema Module that reads ToolParam annotations
to populate "description" and "required" in the generated schema.
By default, un-annotated fields are treated as required. Pass
Option#PROPERTY_REQUIRED_FALSE_BY_DEFAULT to invert this.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Option | 枚举enum | 定义选项相关取值的枚举。 Options for customizing module behavior. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ToolSchemaModule(Option... options) | 初始化 `ToolSchemaModule` 实例。 Creates a module with the given options. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void applyToConfigBuilder(SchemaGeneratorConfigBuilder builder) | 应用到配置构建器。 Performs the apply to config builder operation. |
构造器详情Constructor Detail
ToolSchemaModule
public ToolSchemaModule(Option... options)
初始化 ToolSchemaModule 实例。
Creates a module with the given options.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
options varargs | Option... | 选项(类型 `Option...`)。pass `Option#PROPERTY_REQUIRED_FALSE_BY_DEFAULT` to treat un-annotated fields as optional |
源码Source
io/agentscope/core/tool/ToolSchemaModule.java:44–48方法详情Method Detail
applyToConfigBuilder
public void applyToConfigBuilder(SchemaGeneratorConfigBuilder builder)
应用到配置构建器。
Performs the apply to config builder operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
builder | SchemaGeneratorConfigBuilder | 构建器(类型 `SchemaGeneratorConfigBuilder`)。The builder. |
源码Source
io/agentscope/core/tool/ToolSchemaModule.java:50–53嵌套类详情Nested Class Detail
Option
public enum Option定义选项相关取值的枚举。位于 io.agentscope.core.tool 包。核心成员包括 PROPERTY_REQUIRED_FALSE_BY_DEFAULT。
Options for customizing module behavior.