public static class AIGuard.ToolCall extends Object
Example usage:
// Create a tool call
var toolCall = AIGuard.ToolCall.toolCall("call_123", "get_weather", "{\"location\": \"NYC\"}");
// Use in an assistant message
var assistantMessage = AIGuard.Message.assistant(toolCall);
| Modifier and Type | Class and Description |
|---|---|
static class |
AIGuard.ToolCall.Function
Represents the function details within a tool call, including the function name and its
arguments.
|
| Constructor and Description |
|---|
ToolCall(String id,
AIGuard.ToolCall.Function function)
Creates a new tool call with the specified ID and function.
|
| Modifier and Type | Method and Description |
|---|---|
AIGuard.ToolCall.Function |
getFunction()
Returns the function details for this tool call.
|
String |
getId()
Returns the unique identifier for this tool call.
|
static AIGuard.ToolCall |
toolCall(String id,
String name,
String arguments)
Factory method to create a new tool call with the specified parameters.
|
public ToolCall(String id, AIGuard.ToolCall.Function function)
id - unique identifier for this tool callfunction - the function details (name and arguments)public String getId()
public AIGuard.ToolCall.Function getFunction()
public static AIGuard.ToolCall toolCall(String id, String name, String arguments)
id - unique identifier for the tool callname - the name of the function to callarguments - the function arguments as a JSON string