Package com.github.copilot.sdk.json
Class ToolInvocation
java.lang.Object
com.github.copilot.sdk.json.ToolInvocation
Represents a tool invocation request from the AI assistant.
When the assistant invokes a tool, this object contains the context including the session ID, tool call ID, tool name, and arguments parsed from the assistant's request.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the arguments passed to the tool.Gets the session ID where the tool was invoked.Gets the unique identifier for this tool call.Gets the name of the tool being invoked.setArguments(Object arguments) Sets the tool arguments.setSessionId(String sessionId) Sets the session ID.setToolCallId(String toolCallId) Sets the tool call ID.setToolName(String toolName) Sets the tool name.
-
Constructor Details
-
ToolInvocation
public ToolInvocation()
-
-
Method Details
-
getSessionId
Gets the session ID where the tool was invoked.- Returns:
- the session ID
-
setSessionId
Sets the session ID.- Parameters:
sessionId- the session ID- Returns:
- this invocation for method chaining
-
getToolCallId
Gets the unique identifier for this tool call.This ID correlates the tool invocation with its response.
- Returns:
- the tool call ID
-
setToolCallId
Sets the tool call ID.- Parameters:
toolCallId- the tool call ID- Returns:
- this invocation for method chaining
-
getToolName
Gets the name of the tool being invoked.- Returns:
- the tool name
-
setToolName
Sets the tool name.- Parameters:
toolName- the tool name- Returns:
- this invocation for method chaining
-
getArguments
Gets the arguments passed to the tool.This is typically a
Map<String, Object>matching the parameter schema defined in the tool'sToolDefinition.- Returns:
- the arguments object
-
setArguments
Sets the tool arguments.- Parameters:
arguments- the arguments object- Returns:
- this invocation for method chaining
-