AS AgentScopeAPI 手册 / API Reference

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 varargsOption...选项(类型 `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
builderSchemaGeneratorConfigBuilder构建器(类型 `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.

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