In addition to passing Tools, Prompts, and Workflows
into the Agent constructor, you can also add them after the fact:
Copy
import { Agent, Prompt, Tool, anthropic } from '@ardent-ai/sdk';import { z } from 'zod';const agent = new Agent({ model: anthropic()});const addTwo = new Tool({...});agent.addTool(addTwo);const summarize = new Prompt({...})agent.addPrompt(summarize);
There’s no difference between passing these objects to the Agent constructor, or by calling a method like
addTool(). It’s up to you and your preferred style.