import { generateText, isStepCount } from 'ai';
import { AgentMailToolkit } from 'agentmail-toolkit/ai-sdk';
const { text } = await generateText({
model: 'anthropic/claude-sonnet-4-5',
tools: new AgentMailToolkit().getTools(),
stopWhen: isStepCount(5),
prompt:
'Create an inbox for yourself, then check it for new messages and reply to anything urgent.',
});
console.log(text);