AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/tool/ToolCallParam.java:161–258

ToolCallParam的构建器。位于 io.agentscope.core.tool 包。核心成员包括 toolUseBlock、input、agent、runtimeContext、context、emitter。

Builder for ToolCallParam.

方法摘要Method Summary

方法Method说明Description
public Builder toolUseBlock(ToolUseBlock toolUseBlock)
设置工具使用块。
Sets the tool use block.
public Builder input(Map<String, Object> input)
设置输入参数。
Sets the input parameters.
public Builder agent(Agent agent)
设置智能体。
Sets the calling agent.
public Builder runtimeContext(RuntimeContext runtimeContext)
设置运行时上下文用于工具调用。
Sets the runtime context for the tool call.
public Builder context(ToolExecutionContext context)
deprecated
设置工具执行上下文。
Sets the tool execution context.
public Builder emitter(ToolEmitter emitter)
设置ToolEmitter 用于流式工具输出。
Sets the ToolEmitter for streaming tool output.
public ToolCallParam build()
构建ToolCallParam 实例。
Builds the ToolCallParam instance.

方法详情Method Detail

toolUseBlock

public Builder toolUseBlock(ToolUseBlock toolUseBlock)

设置工具使用块。

Sets the tool use block.

参数Parameters
名称Name类型Type说明Description
toolUseBlockToolUseBlock工具使用块。The tool use block
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/tool/ToolCallParam.java:184–187

input

public Builder input(Map<String, Object> input)

设置输入参数。

Sets the input parameters.

参数Parameters
名称Name类型Type说明Description
inputMap<String, Object>输入参数。The input parameters
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/tool/ToolCallParam.java:195–198

agent

public Builder agent(Agent agent)

设置智能体。

Sets the calling agent.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体。The agent
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/tool/ToolCallParam.java:206–209

runtimeContext

public Builder runtimeContext(RuntimeContext runtimeContext)

设置运行时上下文用于工具调用。

Sets the runtime context for the tool call.

参数Parameters
名称Name类型Type说明Description
runtimeContextRuntimeContext运行时上下文。The runtime context
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/tool/ToolCallParam.java:217–220

context

public Builder context(ToolExecutionContext context)
deprecated

设置工具执行上下文。

Sets the tool execution context.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。Use `#runtimeContext(RuntimeContext)` instead.
参数Parameters
名称Name类型Type说明Description
contextToolExecutionContext执行上下文。The execution context
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/tool/ToolCallParam.java:229–237

emitter

public Builder emitter(ToolEmitter emitter)

设置ToolEmitter 用于流式工具输出。

Sets the ToolEmitter for streaming tool output.

参数Parameters
名称Name类型Type说明Description
emitterToolEmitteremitter(类型 `ToolEmitter`)。The ToolEmitter
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/tool/ToolCallParam.java:245–248

build

public ToolCallParam build()

构建ToolCallParam 实例。

Builds the ToolCallParam instance.

返回Returns ToolCallParam
一种新的ToolCallParam。A new ToolCallParam
源码Source io/agentscope/core/tool/ToolCallParam.java:255–257
基于官方固定版本源码静态生成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.