

HIL Tool Approval Basic
Chat assistant with human approval workflows for safe tool execution.


HIL Needs Approval
Demonstrate tool approval with async generators. Includes real-time feedback, approval workflows, and interactive management.


Tool Input Lifecycle Hooks
Explore tool input lifecycle hooks: onInputStart, onInputDelta, and onInputAvailable. See how to track tool input generation in real-time during streaming.


Preliminary Tool Results
Return preliminary tool results using async iterables. Stream status updates during tool execution before the final result is available.


Tool API Context
Pass arbitrary context from generateText/streamText to tool execution via experimental_context. Access context in tool execute functions for dynamic behavior.


Tool Call Repair
Repair invalid tool calls using experimental_repairToolCall. Fix schema validation errors without requiring additional steps that pollute message history.


Dynamic Tool
Create dynamic tools with runtime-generated schemas using dynamicTool. Demonstrates unit conversion tools where schema adapts based on conversion type (temperature, length, weight, currency) and supports dynamic model selection.


Search - Exa AI (robust)
Search the web using Exa's semantic API and real-time crawling. Includes URL search, content extraction, Wikipedia, Reddit, and news search tools.


Search - Firecrawl (robust)
Search the web using Firecrawl's API and real-time crawling. Includes URL search, content extraction, Wikipedia, Reddit, and news search tools.


Scrape - Cheerio (lightweight)
Scrape websites using Cheerio's fast HTML parser. Includes URL scraping, website crawling, and content extraction without external API costs.
Explore More
Related Patterns


AI SDK Gemini Flash Text
Generate text and analyze market research using Google's Gemini 2.5 Flash. Includes interactive charts and data visualization.


Generate Text
Generate text from prompts using AI. Simple interface with character counting and response rendering.


OpenAI Structured Output
Generate structured output from AI prompts using OpenAI. Create typed data with generateText and Output.object().


Claude Structured Output
Generate structured output from AI prompts using Anthropic Claude. Create typed data with generateText and Output.object().
More in SDK API
generateText( )
Text and structured data generation with Output.object()
streamText( )
Streaming text and structured data with Output.object()
generateImage( )
Image generation examples
generateSpeech( )
Speech synthesis examples
transcribe( )
Audio transcription examples
Agent( )
AI SDK agent API examples and patterns







