Integrate external tools and data sources into your Generative UI applications
Define a tool for the agent to use
zod
, zod-to-json-schema
, and @tavily/core
. You can install them using npm:Instruct the agent to use the tool
web_search
tool whenever it needs current information to answer a question about a company.Pass the tool to the agent
tools
and systemPrompt
to your route.ts
file.create
call in your route.ts
file with a convenient runTools
call that takes the list of tools available to the agent.route.ts
code, you can expand the following codeblock:Test it out!