Interface ToolCallConfirmationPolicy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Decides which tool calls a person must confirm before they run.
DefaultToolCallingManager refuses to run such a call without a decision, and
the tool-calling loop pauses on it; see ToolCallDecisions. A custom
ToolCallingManager has to check it itself.- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Method Summary
Modifier and TypeMethodDescriptionstatic ToolCallConfirmationPolicyThe calls of the named tools.static ToolCallConfirmationPolicyThe calls of tools whose metadata says so (ToolMetadata.requiresConfirmation(),@Tool(requiresConfirmation = true)).static ToolCallConfirmationPolicynone()No call needs confirmation.default ToolCallConfirmationPolicyor(ToolCallConfirmationPolicy other) A call needs confirmation when either policy says so.booleanrequiresConfirmation(AssistantMessage.ToolCall toolCall, @Nullable ToolMetadata toolMetadata) Whether the tool call needs a confirmation before it runs.
-
Method Details
-
requiresConfirmation
boolean requiresConfirmation(AssistantMessage.ToolCall toolCall, @Nullable ToolMetadata toolMetadata) Whether the tool call needs a confirmation before it runs.- Parameters:
toolCall- the call the model asked fortoolMetadata- the metadata of the tool the call names, ornullwhen the manager finds no tool for the call
-
or
A call needs confirmation when either policy says so. -
none
No call needs confirmation. -
fromToolMetadata
The calls of tools whose metadata says so (ToolMetadata.requiresConfirmation(),@Tool(requiresConfirmation = true)). The default ofDefaultToolCallingManager. -
forTools
The calls of the named tools.
-