Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.27 KB

File metadata and controls

47 lines (32 loc) · 1.27 KB

AI SDK Examples

This directory contains practical examples showing how to use the AI SDK for Go in real applications.

Prerequisites

Set your API keys as environment variables:

export OPENAI_API_KEY="your-openai-key-here"
export ANTHROPIC_API_KEY="your-anthropic-key-here"

Get your API keys from:

Examples

Example Description
simple-text Generate text from a simple string prompt
streaming-text Stream text responses in real-time

More Examples Coming Soon

  • Conversation - Multi-message conversations with context
  • Multi-modal - Working with images and files
  • Tools - Function calling and tool usage
  • Advanced - Production patterns and error handling
  • Real-world - Complete application examples

How to Run

Each example is a standalone Go program:

cd basic/simple-text
go run main.go

Need Help?