This directory contains example code demonstrating how to use the Agent Chat SDK.
Before running the examples, you need to:
npm installnpm run buildSet the OPENAI_API_KEY environment variable:
export OPENAI_API_KEY=your-openai-api-key-here
Demonstrates simple chat interaction with OpenAI:
npm run example:basic
This example shows:
Real-time response streaming:
npm run example:streaming
This example demonstrates:
Multi-turn conversations with automatic history:
npm run example:history
This example demonstrates:
File-based storage for conversation persistence:
npm run example:storage
This example demonstrates:
basic-chat.ts - Simple chat interaction with OpenAIstreaming.ts - Real-time streaming responseswith-history.ts - Multi-turn conversations with historywith-storage.ts - Persistent storage across sessionsAdditional examples will be added in future releases: