meloqui

Examples

This directory contains example code demonstrating how to use the Agent Chat SDK.

Prerequisites

Before running the examples, you need to:

  1. Install dependencies: npm install
  2. Build the project: npm run build
  3. Set up your API keys (see below)

Setting Up API Keys

OpenAI

Set the OPENAI_API_KEY environment variable:

export OPENAI_API_KEY=your-openai-api-key-here

Running Examples

Basic Chat

Demonstrates simple chat interaction with OpenAI:

npm run example:basic

This example shows:

Streaming

Real-time response streaming:

npm run example:streaming

This example demonstrates:

Conversation History

Multi-turn conversations with automatic history:

npm run example:history

This example demonstrates:

Persistent Storage

File-based storage for conversation persistence:

npm run example:storage

This example demonstrates:

Example Files

Coming Soon

Additional examples will be added in future releases: