ng-openai
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

ng-openai

Overview

A simple Angular service for openai(chatGPT)

Démo

Démo

Installation

npm i npm install ng-openai
import { NgOpenaiModule } from 'ng-openai';

imports: [
    NgOpenaiModule.forRoot('sk-XXXXXXXXXXXXXXXXXXXXXX'), // your API key here
]

Usage

const completion = await this.ngOpenaiService.openai().createCompletion({
    model: "text-davinci-002",
    prompt: "Hello world",
});
console.log(completion.data.choices[0].text);

Package Sidebar

Install

npm i ng-openai

Weekly Downloads

0

Version

0.0.1

License

none

Unpacked Size

22.5 kB

Total Files

14

Last publish

Collaborators

  • paulrichez