import { ToolLoopAgent } from 'ai';
const agent = new ToolLoopAgent({
model: 'openai/gpt-5.5',
instructions: '你是一个旅行助手,帮助用户规划行程',
tools: {
searchFlights: tool({ /* ... */ }),
bookHotel: tool({ /* ... */ }),
},
});
const result = await agent.generate({
prompt: '帮我规划一次从北京到上海的三天旅行',
});