Class ToolCallResponse
java.lang.Object
com.alibaba.cloud.ai.graph.agent.interceptor.ToolCallResponse
Response object for tool calls.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ToolCallResponse.Builderbuilder()static ToolCallResponseCreates an error response for a failed tool execution.static ToolCallResponseCreates an error response for a failed tool execution from a Throwable.booleanisError()Checks if this response represents an error.static ToolCallResponseorg.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse
-
Constructor Details
-
ToolCallResponse
-
ToolCallResponse
-
-
Method Details
-
of
-
error
Creates an error response for a failed tool execution.- Parameters:
toolCallId- the tool call IDtoolName- the tool nameerrorMessage- the error message- Returns:
- a new error ToolCallResponse
-
error
Creates an error response for a failed tool execution from a Throwable. Preserves the exception class name when message is null.- Parameters:
toolCallId- the tool call IDtoolName- the tool namecause- the exception that caused the failure- Returns:
- a new error ToolCallResponse
-
builder
-
getResult
-
getToolName
-
getToolCallId
-
getStatus
-
getMetadata
-
isError
public boolean isError()Checks if this response represents an error.- Returns:
- true if this is an error response
-
toToolResponse
public org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse toToolResponse()
-