vercel-ai adapter provides tools formatted for use with generateText, streamText, and other AI SDK functions.
Installation
Quick Start
Available Tools
The Vercel AI adapter provides three tools:Using with generateText
Using with streamText
Direct Tool Usage
You can also call tools directly without using an LLM:Next.js API Route
Next.js with useChat
Tool Parameters
memvid_put
memvid_find
memvid_ask
Best Practices
- Set maxSteps to allow the model to make multiple tool calls when needed
- Use streaming for better user experience with
streamText - Handle tool results by checking
result.stepsfor tool call history - Close the memory when done with
mem.seal()
Next Steps
OpenAI SDK
OpenAI function calling
LangChain
LangChain integration