develop-ai-functions-example

Installation
Summary

Development and validation scripts for AI SDK functions across multiple providers and capabilities.

  • Organized by AI SDK function category (text generation, streaming, structured output, embeddings, image generation, speech, transcription, reranking, and agents)
  • File naming convention maps provider and feature combinations (e.g., openai-tool-call.ts, amazon-bedrock-anthropic-cache-control.ts) for quick identification
  • Includes shared utility helpers for error handling, environment loading, streaming output formatting, and test fixture generation
  • Templates provided for common patterns: basic generation, streaming, tool calling, and structured output with Zod schemas
SKILL.md

AI Functions Examples

The examples/ai-functions/ directory contains scripts for validating, testing, and iterating on AI SDK functions across providers.

Example Categories

Examples are organized by AI SDK function in examples/ai-functions/src/:

Directory Purpose
generate-text/ Non-streaming text generation with generateText()
stream-text/ Streaming text generation with streamText()
generate-object/ Structured output generation with generateObject()
stream-object/ Streaming structured output with streamObject()
agent/ ToolLoopAgent examples for agentic workflows
embed/ Single embedding generation with embed()
embed-many/ Batch embedding generation with embedMany()
generate-image/ Image generation with generateImage()
generate-speech/ Text-to-speech with generateSpeech()
Related skills

More from vercel/ai

Installs
858
Repository
vercel/ai
GitHub Stars
24.2K
First Seen
Jan 23, 2026