1.0.5 • Published 2 years ago
egg-chatgpt v1.0.5
egg-chatgpt
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.