Skip to content

Getting Started

Installation

bash
npm install meloqui

Quick Start

Basic Chat

typescript
import { ChatClient } from 'meloqui';

// Create a client (API key from OPENAI_API_KEY env variable)
const client = new ChatClient({
  provider: 'openai',
  model: 'gpt-4o'
});

// Send a message
const response = await client.chat('Hello! What is TypeScript?', {
  temperature: 0.7,
  maxTokens: 150
});

console.log(response.content);
// Output: TypeScript is a strongly typed programming language...

Streaming Responses

typescript
import { ChatClient } from 'meloqui';

const client = new ChatClient({
  provider: 'openai',
  model: 'gpt-4o'
});

// Stream responses in real-time
for await (const chunk of client.stream('Tell me a story')) {
  process.stdout.write(chunk.content);
}

Released under the MIT License.