Class ToolCallConfirmationRequiredException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.ai.model.tool.ToolCallConfirmationRequiredException
- All Implemented Interfaces:
Serializable
Thrown by a
ToolCallingManager when a tool call of the batch needs a person's
confirmation before it runs (see ToolCallConfirmationPolicy) and no
ToolCallDecisions were given. None of the batch's tool calls ran.
A tool-calling loop pauses on it: it returns the reply to the caller as the model gave
it, listing the keys of the calls that wait for a decision under
ToolCallDecisions.AWAITING_DECISION_METADATA_KEY. The caller collects the
decisions and runs the batch with
ToolCallingManager.executeToolCalls(org.springframework.ai.chat.prompt.Prompt, org.springframework.ai.chat.model.ChatResponse, ToolCallDecisions).
- Since:
- 2.1.0
- Author:
- Christian Tzolov
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionToolCallConfirmationRequiredException(List<String> toolCallIds) Create the exception for the calls that wait for a decision. -
Method Summary
Modifier and TypeMethodDescriptionThe keys of the tool calls that need a confirmation (seeToolCallDecisions.toolCallKeys(org.springframework.ai.chat.messages.AssistantMessage)), in the order the model asked for them.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ToolCallConfirmationRequiredException
Create the exception for the calls that wait for a decision.- Parameters:
toolCallIds- the keys of the tool calls that need a confirmation (seeToolCallDecisions.toolCallKeys(org.springframework.ai.chat.messages.AssistantMessage)), in the order the model asked for them
-
-
Method Details
-
getToolCallIds
The keys of the tool calls that need a confirmation (seeToolCallDecisions.toolCallKeys(org.springframework.ai.chat.messages.AssistantMessage)), in the order the model asked for them.
-