Package datadog.trace.api.aiguard
Class AIGuard.ToolCall
java.lang.Object
datadog.trace.api.aiguard.AIGuard.ToolCall
- Enclosing class:
AIGuard
Represents a function call made by an AI assistant. Tool calls contain an identifier and
function details (name and arguments).
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);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the function details within a tool call, including the function name and its arguments. -
Constructor Summary
ConstructorsConstructorDescriptionToolCall(String id, AIGuard.ToolCall.Function function) Creates a new tool call with the specified ID and function. -
Method Summary
Modifier and TypeMethodDescriptionReturns the function details for this tool call.getId()Returns the unique identifier for this tool call.static AIGuard.ToolCallFactory method to create a new tool call with the specified parameters.
-
Constructor Details
-
ToolCall
Creates a new tool call with the specified ID and function.- Parameters:
id- unique identifier for this tool callfunction- the function details (name and arguments)
-
-
Method Details
-
getId
Returns the unique identifier for this tool call.- Returns:
- the tool call ID
-
getFunction
Returns the function details for this tool call.- Returns:
- the Function object containing name and arguments
-
toolCall
Factory method to create a new tool call with the specified parameters.- Parameters:
id- unique identifier for the tool callname- the name of the function to callarguments- the function arguments as a JSON string- Returns:
- a new ToolCall instance
-