Class DefaultToolCallingManager.Builder
java.lang.Object
org.springframework.ai.model.tool.DefaultToolCallingManager.Builder
- Enclosing class:
- DefaultToolCallingManager
-
Method Summary
Modifier and TypeMethodDescriptionbuild()excludeToolFromLimit(String toolName) Exempt the named tool from the per-tool call limit, so it can be called an unlimited number of times regardless ofmaxCallsPerTool(int)or a priormaxCallsPerTool(String, int)override for that tool.maxCallsPerTool(int maxCallsPerTool) Default maximum number of times any single tool can be called within a turn, unless overridden for a specific tool name viamaxCallsPerTool(String, int)or exempted viaexcludeToolFromLimit(String).maxCallsPerTool(String toolName, int maxCallsPerTool) Maximum number of times the named tool can be called within a turn, overriding the default set viamaxCallsPerTool(int)for that tool only.maxTotalToolCalls(int maxTotalToolCalls) Maximum number of tool calls, across all tools combined, allowed within a turn.observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) onLimitExceeded(ToolCallLimitBehavior onLimitExceeded) What to do when a configured limit is exceeded.resolutionFallbackEnabled(boolean resolutionFallbackEnabled) Whether a call to a tool that is not part of the request's tool callbacks may still be executed by resolving it through theToolCallbackResolver.toolCallbackResolver(ToolCallbackResolver toolCallbackResolver) toolExecutionExceptionProcessor(ToolExecutionExceptionProcessor toolExecutionExceptionProcessor) Disable the per-tool call limit entirely, undoingmaxCallsPerTool(int)(or theDefaultToolCallingManager.DEFAULT_MAX_CALLS_PER_TOOLdefault), so that, absent a specificmaxCallsPerTool(String, int)override, any tool can be called an unlimited number of times.Disable the total tool call limit entirely, undoingmaxTotalToolCalls(int)(or theDefaultToolCallingManager.DEFAULT_MAX_TOTAL_TOOL_CALLSdefault).
-
Method Details
-
observationRegistry
public DefaultToolCallingManager.Builder observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) -
toolCallbackResolver
public DefaultToolCallingManager.Builder toolCallbackResolver(ToolCallbackResolver toolCallbackResolver) -
toolExecutionExceptionProcessor
public DefaultToolCallingManager.Builder toolExecutionExceptionProcessor(ToolExecutionExceptionProcessor toolExecutionExceptionProcessor) -
maxCallsPerTool
Default maximum number of times any single tool can be called within a turn, unless overridden for a specific tool name viamaxCallsPerTool(String, int)or exempted viaexcludeToolFromLimit(String). Defaults toDefaultToolCallingManager.DEFAULT_MAX_CALLS_PER_TOOL; callunlimitedCallsPerTool()to disable this limit entirely. -
unlimitedCallsPerTool
Disable the per-tool call limit entirely, undoingmaxCallsPerTool(int)(or theDefaultToolCallingManager.DEFAULT_MAX_CALLS_PER_TOOLdefault), so that, absent a specificmaxCallsPerTool(String, int)override, any tool can be called an unlimited number of times. -
maxCallsPerTool
Maximum number of times the named tool can be called within a turn, overriding the default set viamaxCallsPerTool(int)for that tool only. -
excludeToolFromLimit
Exempt the named tool from the per-tool call limit, so it can be called an unlimited number of times regardless ofmaxCallsPerTool(int)or a priormaxCallsPerTool(String, int)override for that tool. Calls to this tool still count towardmaxTotalToolCalls(int). -
maxTotalToolCalls
Maximum number of tool calls, across all tools combined, allowed within a turn. Defaults toDefaultToolCallingManager.DEFAULT_MAX_TOTAL_TOOL_CALLS; callunlimitedTotalToolCalls()to disable this limit entirely. -
unlimitedTotalToolCalls
Disable the total tool call limit entirely, undoingmaxTotalToolCalls(int)(or theDefaultToolCallingManager.DEFAULT_MAX_TOTAL_TOOL_CALLSdefault). -
onLimitExceeded
What to do when a configured limit is exceeded. Defaults toToolCallLimitBehavior.THROW. -
resolutionFallbackEnabled
public DefaultToolCallingManager.Builder resolutionFallbackEnabled(boolean resolutionFallbackEnabled) Whether a call to a tool that is not part of the request's tool callbacks may still be executed by resolving it through theToolCallbackResolver. Defaults tofalse, so that the tools attached to a request bound what can be executed for that request.- Parameters:
resolutionFallbackEnabled-trueto allow name-based resolution of tools absent from the request via the resolver- Since:
- 2.0.1
-
build
-