1.0.5 • Published 2 years ago

egg-chatgpt v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

egg-chatgpt

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-chatgpt --save

Usage

// {app_root}/config/plugin.js
exports.chatgpt = {
  enable: true,
  package: 'egg-chatgpt',
};

Configuration

// {app_root}/config/config.default.js
exports.chatgpt = {
  clients: {
  c1: {
    apiKey: "api1",
  },
  c2: {
    apiKey: "api2",
  },
  },
  default: {
    debug: false,
    completionParams: {
      model: "gpt-3.5-turbo",
    },
  },
};

see config/config.default.js for more detail.

Example

const chatgpt = this.app.chatgpt;
const api =  chatgpt.get('c1')
const res = await api.sendMessage('hi')

Questions & Suggestions

1.use chatgpt-api 5.0.10 lib, and default use proxy whih 7890 port.

Please open an issue here.

License

MIT

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago