1.0.5 • Published 6 months ago

openai-single-response v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Openai Single Response

openai-single-response is a JavaScript library for interacting with OpenAI's GPT models. It provides an easy-to-use API for generating chat completions, managing chat streams, and handling responses with or without schema validation.

Features

  • Easy integration with OpenAI's Chat models.
  • Support for both streaming and non-streaming chat completions.
  • Optional schema validation for responses.
  • Convenient utilities for message composition.

Installation

npm install openai-single-response

Usage

Basic Usage

Here's a quick example to get you started:

import { getSingleChatCompletion } from openai-single-response;

async function chat() {
const response = await getSingleChatCompletion({
apiKey: 'your-api-key',
systemPrompt: "Your system prompt",
userPrompt: "Your user prompt",
});

console.log(response);
}

chat();

Licensing

The code in this project is licensed under MIT.

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago