Documentation

Tool Calling Agent

The Tool Calling Agent is a specialized component that manages tool execution and interaction through natural language processing.

Tool Calling Agent Component

Tool Calling Agent interface and configuration options

Configuration Parameters

Required Parameters

  • Tool: Available tools configuration
  • Language Model: The AI model for processing
  • Agent Description: Description of agent capabilities (Deprecated)
  • System Prompt: Base prompt for the agent
  • Chat History: Conversation context

Output Format

{
  "agentId": string,
  "toolsUsed": array,
  "response": {
    "result": any,
    "metadata": {
      "processingTime": string,
      "toolCalls": number
    }
  }
}

Example Usage

const toolCallingAgent = new ToolCallingAgent({
  tool: ["calculator", "web-search", "file-reader"],
  languageModel: "gpt-4",
  agentDescription: "A helpful assistant that can use various tools",
  systemPrompt: "You are a helpful assistant that can use various tools...",
  chatHistory: []
});

const result = await toolCallingAgent.process({
  input: "Calculate the square root of 16 and search for its history"
});

Best Practices

  • Configure appropriate tools for the task
  • Maintain clear system prompts
  • Monitor tool usage and performance
  • Handle tool errors gracefully
  • Regular validation of tool responses