const agent1 = new Agent("AGENT_1", scoopika);
const agent2 = new Agent("AGENT_2", scoopika);

// agent1 will call agent2 if it needs to
await agent1.addAgentAsTool(agent2);

Allows you to add an agent as a tool to another agent. What are tools

By adding an agent as a tool, you empower the primary agent to communicate and potentially exchange data with the tool agent during conversation execution.

This method is not recommended, instead you should add a companion to your agent from the platform.

Arguments

agent
Agent
required

The agent instance that you want to add as a tool.

Reference to Agent

const agent1 = new Agent("AGENT_1", scoopika);
const agent2 = new Agent("AGENT_2", scoopika);

// agent1 will call agent2 if it needs to
await agent1.addAgentAsTool(agent2);