类 ToolExecutionContext.Builder
java.lang.Object
io.agentscope.core.tool.ToolExecutionContext.Builder
- 封闭类:
ToolExecutionContext
Builder for ToolExecutionContext.
-
方法概要
修饰符和类型方法说明addStore(ContextStore store) Adds a single store to the store list.build()Builds the ToolExecutionContext.Registers an object with explicit type (e.g., by interface).Registers an object by its runtime type (singleton pattern).Registers an object with key and type (multi-instance pattern).Registers an object with key (type inferred from runtime).
-
方法详细资料
-
register
Registers an object by its runtime type (singleton pattern).- 参数:
object- The object to register- 返回:
- This builder
-
register
Registers an object with explicit type (e.g., by interface).- 类型参数:
T- The object type- 参数:
type- The type keyobject- The object to register- 返回:
- This builder
-
register
Registers an object with key and type (multi-instance pattern).- 类型参数:
T- The object type- 参数:
key- The key identifying this instancetype- The type keyobject- The object to register- 返回:
- This builder
-
register
Registers an object with key (type inferred from runtime).- 参数:
key- The key identifying this instanceobject- The object to register- 返回:
- This builder
-
addStore
Adds a single store to the store list.This allows adding custom
ContextStoreimplementations.- 参数:
store- The context store to add- 返回:
- This builder
-
build
Builds the ToolExecutionContext.- 返回:
- A new ToolExecutionContext
-