@weykon/gpt-ts
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Introduce

gpt api using typescript on nodejs

Usage

yarn add @weykon/gpt-ts
  1. create a file named ".env"
  2. edit .env
ChatGPTKey="*******"
  1. demo
import { ChatGPTClient } from '@weykon/gpt-ts'
require('dotenv').config();

const clientOptions = {
    modelOptions: {
        model: 'gpt-3.5-turbo',
        temperature: 0,
    },
    debug: false,
};

const cacheOptions = {}

const app = new ChatGPTClient(
    process.env.ChatGPTKey,
    clientOptions,
    cacheOptions);

app.sendMessage('hello gpt api!!').then(e => {
    console.log('e.response', e.response);
})

Package Sidebar

Install

npm i @weykon/gpt-ts

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

28.7 kB

Total Files

7

Last publish

Collaborators

  • weykon