Class AIGuard.ToolCall

java.lang.Object
datadog.trace.api.aiguard.AIGuard.ToolCall
Enclosing class:
AIGuard

public static class AIGuard.ToolCall extends Object
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);
 
  • Constructor Details

    • ToolCall

      public ToolCall(String id, AIGuard.ToolCall.Function function)
      Creates a new tool call with the specified ID and function.
      Parameters:
      id - unique identifier for this tool call
      function - the function details (name and arguments)
  • Method Details

    • getId

      public String getId()
      Returns the unique identifier for this tool call.
      Returns:
      the tool call ID
    • getFunction

      public AIGuard.ToolCall.Function getFunction()
      Returns the function details for this tool call.
      Returns:
      the Function object containing name and arguments
    • toolCall

      public static AIGuard.ToolCall toolCall(String id, String name, String arguments)
      Factory method to create a new tool call with the specified parameters.
      Parameters:
      id - unique identifier for the tool call
      name - the name of the function to call
      arguments - the function arguments as a JSON string
      Returns:
      a new ToolCall instance