This commit is contained in:
Alcedo 2023-03-03 09:53:52 +08:00
commit 282c6578d4
7 changed files with 166 additions and 194 deletions

View file

@ -3,9 +3,9 @@
## 特点
* 支持单人连续对话Conversation群聊中支持加入其他人的对话
* API模式下使用 GPT-3 API及相关模型配置尽可能逼近ChatGPT体验支持自定义部分模型参数仅需OpenAI Api Key开箱即用
* API模式下使用 gpt-3.5-turbo APIChatGPT官网同款模型仅需OpenAI Api Key开箱即用。**注意收费**
* 支持问答图片截图
* API3模式下绕过Cloudflare防护直接访问ChatGPT的SSE API与官方体验一致且保留对话记录在官网可查。
* API3模式下绕过Cloudflare防护直接访问ChatGPT的SSE API与官方体验一致且保留对话记录在官网可查。免费。
* 提供基于浏览器的解决方案作为备选API3不可用的情况下或担心账户安全的用户可以选择使用浏览器模式。
* 支持新[必应](https://www.bing.com/new)Beta
@ -17,14 +17,13 @@ Node.js >= 18 / Node.js >= 14(with node-fetch)
### 安装
在安装之前请先判断自己需要使用哪种模式本插件支持官方API/第三方API/浏览器/必应四种模式。也可以选择**我全都要**(通过qq发送命令`#chatgpt切换浏览器/API/API2/API3/Bing`实时切换)
在安装之前请先判断自己需要使用哪种模式本插件支持官方API/第三方API/浏览器/必应四种模式。也可以选择**我全都要**(通过qq发送命令`#chatgpt切换浏览器/API/API3/Bing`实时切换)
对于轻量用户可以先使用API模式有较高要求再转为使用其他模式。
> #### API模式和浏览器模式如何选择
>
> * API模式会调用OpenAI官方提供的GPT-3 LLM API只需要提供API Key。一般情况下该种方式响应速度更快可配置项多且不会像chatGPT官网一样总出现不可用的现象但其聊天效果明显较官网差。但注意GPT-3的API调用是收费的新用户有18美元试用金可用于支付价格为`$0.0200/1K tokens`。(问题和回答**加起来**算token
> * 【当前不可用】API2模式会调用第三方提供的基于OpenAI text-davinci-002-render模型官网同款的API需要提供ChatGPT的Token。效果比单纯的GPT-3 API好很多但同时将Token提供给了第三方API其中风险自行承担。
> * API3模式会调用第三方提供的官网反代API他会帮你绕过CF防护需要提供ChatGPT的Token。效果与官网和浏览器一致但稳定性不一定。设置token和API2方法一样。
> * 浏览器模式通过在本地启动Chrome等浏览器模拟用户访问ChatGPT网站使得获得和官方以及API2模式一模一样的回复质量同时保证安全性。缺点是本方法对环境要求较高需要提供桌面环境和一个可用的代理能够访问ChatGPT的IP地址且响应速度不如API而且高峰期容易无法使用。一般作为API3的下位替代。
> * 必应Bing将调用微软新必应接口进行对话。需要在必应网页能够正常使用新必应且设置有效的Bing登录Cookie方可使用。
@ -43,7 +42,7 @@ pnpm i
如果是手工下载的 zip 压缩包,请将解压后的 chatgpt-plugin 文件夹(请删除压缩自带的-master后缀放置在 Yunzai-Bot 目录下的 plugins 文件夹内
> 浏览器模式仅为备选,如您需要使用浏览器模式,您还需要有**桌面环境**,优先级建议:必应>API3>浏览器
> 2.20更新必应被大削变得蠢了建议还是API3优先
> 2.20更新:必应被大削,变得蠢了,建议还是API/API3优先
3. 修改配置
@ -160,17 +159,6 @@ pnpm i
发挥你的想象力吧,~~调教~~拟造出你自己的机器人风格!
关于部分API模式下配置中的一些模型的配置项
* `model`通常保持空即可除非你想调用特定的模型比如你用gpt-3微调的学到特定领域知识的机器人。API1模式下将强制使用chatGPT模型。
* `promptPrefixOverride`:通常保持空即可。如果你想调整机器人回复的风格,可以在这里加入对机器人的一些暗示,比如要求用中文,要求回答长一点/短一点。甚至可以让它有自己的小脾气。
* `assistantLabel`默认为ChatGPT表示机器人认知中的自己的名字。你可以修改为其他名字。
* `plus`如果你购买了ChatGPT Plus将这个值改为true可以使响应速度更快。
#### 文本/图片回复模式
> #chatgpt文本/图片模式
@ -249,10 +237,6 @@ git stash pop
## 其他
### 关于未来更新
OpenAI 即将开放其官方ChatGPT API且微软必应也公开发布了基于ChatGPT的问答搜索能够为实现更好、更快的聊天机器人提供更多途径。
### 常见问题
1. 如果在linux系统上发现图片模式下emoj无法正常显示可以搜索安装支持emoj的字体如Ubuntu可以使用`sudo apt install fonts-noto-color-emoji`
@ -275,7 +259,7 @@ OpenAI 即将开放其官方ChatGPT API且微软必应也公开发布了基
>
> 原因:没装依赖
>
> 解决方式:请参考文档用`pnmp install -w xxx`安装依赖,遇到的情况一般是`pnpm install -w undici chatgpt showdown mathjax-node delay uuid remark strip-markdown random puppeteer-extra-plugin-recaptcha puppeteer-extra puppeteer-extra-plugin-stealth @waylaidwanderer/chatgpt-api keyv-file`,安装完就不报错了
> 解决方式:请参考文档在本插件目录下`pnmp install`安装依赖,安装完就不报错了
@ -287,7 +271,7 @@ OpenAI 即将开放其官方ChatGPT API且微软必应也公开发布了基
* https://github.com/acheong08/ChatGPT
* https://github.com/PawanOsman
图片模式支持 @HalcyonAlcedo
图片以及Bing模式支持 @HalcyonAlcedo
* https://github.com/HalcyonAlcedo/ChatGPT-Plugin-PageCache
以及ChatGPT

View file

@ -671,21 +671,23 @@ export class chatgpt extends plugin {
if (Config.model) {
completionParams.model = Config.model
}
const currentDate = new Date().toISOString().split('T')[0]
let promptPrefix = `You are ${Config.assistantLabel}, a large language model trained by OpenAI. ${Config.promptPrefixOverride || defaultPropmtPrefix}
Current date: ${currentDate}`
this.chatGPTApi = new ChatGPTAPI({
apiBaseUrl: Config.openAiBaseUrl,
apiKey: Config.apiKey,
debug: false,
upsertMessage,
getMessageById,
systemMessage: promptPrefix,
completionParams,
assistantLabel: Config.assistantLabel,
fetch
})
const currentDate = new Date().toISOString().split('T')[0]
let promptPrefix = `You are ${Config.assistantLabel}, a large language model trained by OpenAI. ${Config.promptPrefixOverride || defaultPropmtPrefix}
Current date: ${currentDate}`
let option = {
timeoutMs: 120000,
promptPrefix
systemMessage: promptPrefix
}
if (conversation) {
option = Object.assign(option, conversation)
@ -773,11 +775,11 @@ export class chatgpt extends plugin {
async totalAvailable (e) {
if (!Config.apiKey) {
this.reply('当前未配置OpenAI API key请在插件配置文件config/config.js中配置。若使用免费的API3则无需关心计费。')
this.reply('当前未配置OpenAI API key请在锅巴面板或插件配置文件config/config.js中配置。若使用免费的API3则无需关心计费。')
return false
}
// 查询OpenAI API剩余试用额度
fetch('https://api.openai.com/dashboard/billing/credit_grants', {
fetch(`${Config.openAiBaseUrl}/dashboard/billing/credit_grants`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

View file

@ -269,10 +269,8 @@ export class ChatgptManagement extends plugin {
let message = ` API模式和浏览器模式如何选择
// eslint-disable-next-line no-irregular-whitespace
API模式会调用OpenAI官方提供的GPT-3 LLM API只需要提供API Key一般情况下该种方式响应速度更快可配置项多且不会像chatGPT官网一样总出现不可用的现象但其聊天效果明显较官网差但注意GPT-3的API调用是收费的新用户有18美元试用金可用于支付价格为$0.0200/1K tokens.(问题和回答加起来算token)
当前不可用API2模式会调用第三方提供的基于OpenAI text-davinci-002-render模型官网同款的API需要提供ChatGPT的Token效果比单纯的GPT-3 API好很多但同时将Token提供给了第三方API其中风险自行承担#chatgpt设置token
API模式会调用OpenAI官方提供的gpt-3.5-turbo API只需要提供API Key一般情况下该种方式响应速度更快不会像chatGPT官网一样总出现不可用的现象但注意gpt-3.5-turbo的API调用是收费的新用户有18美元试用金可用于支付价格为$0.0020/1K tokens.(问题和回答加起来算token)
API3模式会调用第三方提供的官网反代API他会帮你绕过CF防护需要提供ChatGPT的Token效果与官网和浏览器一致但稳定性不一定设置token和API2方法一样#chatgpt设置token
浏览器模式通过在本地启动Chrome等浏览器模拟用户访问ChatGPT网站使得获得和官方以及API2模式一模一样的回复质量同时保证安全性缺点是本方法对环境要求较高需要提供桌面环境和一个可用的代理能够访问ChatGPT的IP地址且响应速度不如API而且高峰期容易无法使用

View file

@ -36,9 +36,12 @@ export default {
// 以下为API方式(默认)的配置 *
// ***********************************************************************************************************************************
apiKey: API_KEY,
// 如果有openai api的加速反代可以写
// openAiBaseUrl: null,
// 模型名称选填。如无特殊需求保持默认即可会使用chatgpt-api库提供的当前可用的最适合的默认值。保底可用的是 text-davinci-003。当发现新的可用的chatGPT模型会更新这里的值
// 20230211 text-chat-davinci-002-sh-alpha-aoruigiofdj83 中午存活了几分钟
// model: '',
// temperature: 0.8,
// ***********************************************************************************************************************************
// 以下为API3方式的配置 *
// ***********************************************************************************************************************************
@ -48,16 +51,6 @@ export default {
// 或者 https://gpt.pawan.krd/backend-api
// apiBaseUrl: 'https://chatgpt.duti.tech/api',
// ***********************************************************************************************************************************
// 以下为API2方式的配置 *
// ***********************************************************************************************************************************
// 如果购买了plus改为true将使用收费模型响应更快
// plus: false,
// 使用谁提供的第三方API。github开源的有几个没特别要求保持默认就好
// https://chatgpt.pawan.krd/api/completions 来自https://github.com/PawanOsman 使用Cloudflare CDN三网延迟可能都较高。目前看起来最稳定
// https://chatgpt.roki.best/api/completions 对上面那个的二次反代搭建在Hong Kong本人自建不保证稳定性
// https://chatgpt.hato.ai/completions 来自https://github.com/waylaidwanderer本插件使用的chatgpt库之一的作者
// reverseProxy: 'https://chatgpt.pawan.krd/api/completions',
// ***********************************************************************************************************************************
// 以下为API/API2方式公用的配置 *
// ***********************************************************************************************************************************
// 给模型的前言promt。选填。默认完整值`You are ${this._assistantLabel}, a large language model trained by OpenAI. You answer as concisely as possible for each response (e.g. dont be verbose). It is very important that you answer as concisely as possible, so please remember this. If you are generating a list, do not have too many items. Keep the number of items short. Current date: ${currentDate}\n\n

View file

@ -1,7 +1,7 @@
import { Config } from './utils/config.js'
// 支持锅巴
export function supportGuoba() {
export function supportGuoba () {
return {
// 插件信息,将会显示在前端页面
// 如果你的插件没有在插件库里,那么需要填上补充信息
@ -19,7 +19,7 @@ export function supportGuoba() {
// 图标可在 https://icon-sets.iconify.design 这里进行搜索
icon: 'simple-icons:openai',
// 图标颜色,例:#FF0000 或 rgb(255, 0, 0)
iconColor: '#00c3ff',
iconColor: '#00c3ff'
},
// 配置项信息
configInfo: {
@ -29,51 +29,51 @@ export function supportGuoba() {
field: 'blockWords',
label: '输出黑名单',
bottomHelpMessage: '检查输出结果中是否有违禁词,如果存在黑名单中的违禁词则不输出',
component: 'InputTextArea',
component: 'InputTextArea'
},
{
field: 'promptBlockWords',
label: '输入黑名单',
bottomHelpMessage: '检查输入结果中是否有违禁词,如果存在黑名单中的违禁词则不输出',
component: 'InputTextArea',
component: 'InputTextArea'
},
{
field: 'imgOcr',
label: '图片识别',
bottomHelpMessage: '是否识别消息中图片的文字内容,需要同时包含图片和消息才生效',
component: 'Switch',
component: 'Switch'
},
{
field: 'defaultUsePicture',
label: '全局图片模式',
bottomHelpMessage: '全局默认以图片形式回复并自动发出Continue命令补全回答。长回复可能会有bug。',
component: 'Switch',
component: 'Switch'
},
{
field: 'autoUsePicture',
label: '长文本自动转图片',
bottomHelpMessage: '字数大于阈值会自动用图片发送,即使是文本模式。',
component: 'Switch',
field: 'autoUsePicture',
label: '长文本自动转图片',
bottomHelpMessage: '字数大于阈值会自动用图片发送,即使是文本模式。',
component: 'Switch'
},
{
field: 'autoUsePictureThreshold',
label: '自动转图片阈值',
helpMessage: '长文本自动转图片开启后才生效',
bottomHelpMessage: '自动转图片的字数阈值。',
component: 'InputNumber',
componentProps: {
min: 0,
},
field: 'autoUsePictureThreshold',
label: '自动转图片阈值',
helpMessage: '长文本自动转图片开启后才生效',
bottomHelpMessage: '自动转图片的字数阈值。',
component: 'InputNumber',
componentProps: {
min: 0
}
},
{
field: 'conversationPreserveTime',
label: '对话保留时长',
helpMessage: '单位:秒',
bottomHelpMessage: '每个人发起的对话保留时长。超过这个时长没有进行对话,再进行对话将开启新的对话。',
component: 'InputNumber',
componentProps: {
min: 0,
},
field: 'conversationPreserveTime',
label: '对话保留时长',
helpMessage: '单位:秒',
bottomHelpMessage: '每个人发起的对话保留时长。超过这个时长没有进行对话,再进行对话将开启新的对话。',
component: 'InputNumber',
componentProps: {
min: 0
}
},
{
field: 'toggleMode',
@ -82,207 +82,201 @@ export function supportGuoba() {
component: 'Select',
componentProps: {
options: [
{label: 'at', value: 'at'},
{label: '#chat', value: 'prefix'},
],
},
{ label: 'at', value: 'at' },
{ label: '#chat', value: 'prefix' }
]
}
},
{
field: 'quoteReply',
label: '图片引用消息',
bottomHelpMessage: '在回复图片时引用原始消息',
component: 'Switch',
field: 'quoteReply',
label: '图片引用消息',
bottomHelpMessage: '在回复图片时引用原始消息',
component: 'Switch'
},
{
field: 'showQRCode',
label: '启用二维码',
bottomHelpMessage: '在图片模式中启用二维码。该对话内容将被发送至第三方服务器以进行渲染展示,如果不希望对话内容被上传到第三方服务器请关闭此功能。',
component: 'Switch',
field: 'showQRCode',
label: '启用二维码',
bottomHelpMessage: '在图片模式中启用二维码。该对话内容将被发送至第三方服务器以进行渲染展示,如果不希望对话内容被上传到第三方服务器请关闭此功能。',
component: 'Switch'
},
{
field: 'cacheUrl',
label: '渲染服务器地址',
bottomHelpMessage: '用于缓存图片模式会话内容并渲染的服务器地址。',
component: 'Input',
component: 'Input'
},
{
field: 'cacheEntry',
label: '预制渲染服务器访问代码',
bottomHelpMessage: '图片内容渲染服务器开启预制访问代码,当渲染服务器访问较慢时可以开启,但无法保证访问代码可以正常访问页面。',
component: 'Switch',
field: 'cacheEntry',
label: '预制渲染服务器访问代码',
bottomHelpMessage: '图片内容渲染服务器开启预制访问代码,当渲染服务器访问较慢时可以开启,但无法保证访问代码可以正常访问页面。',
component: 'Switch'
},
{
field: 'drawCD',
label: '绘图CD',
helpMessage: '单位:秒',
bottomHelpMessage: '绘图指令的CD时间主人不受限制',
component: 'InputNumber',
componentProps: {
min: 0,
},
field: 'drawCD',
label: '绘图CD',
helpMessage: '单位:秒',
bottomHelpMessage: '绘图指令的CD时间主人不受限制',
component: 'InputNumber',
componentProps: {
min: 0
}
},
{
field: 'proxy',
label: '代理服务器地址',
bottomHelpMessage: '数据通过代理服务器发送http或socks5代理。',
component: 'Input',
component: 'Input'
},
{
field: 'debug',
label: '调试信息',
bottomHelpMessage: '将输出更多调试信息,如果不希望控制台刷屏的话,可以关闭。',
component: 'Switch',
field: 'debug',
label: '调试信息',
bottomHelpMessage: '将输出更多调试信息,如果不希望控制台刷屏的话,可以关闭。',
component: 'Switch'
},
{
label: '以下为服务超时配置。',
component: 'Divider',
label: '以下为服务超时配置。',
component: 'Divider'
},
{
field: 'defaultTimeoutMs',
label: '默认超时时间',
helpMessage: '单位:毫秒',
bottomHelpMessage: '各个地方的默认超时时间。',
component: 'InputNumber',
componentProps: {
min: 0,
},
field: 'defaultTimeoutMs',
label: '默认超时时间',
helpMessage: '单位:毫秒',
bottomHelpMessage: '各个地方的默认超时时间。',
component: 'InputNumber',
componentProps: {
min: 0
}
},
{
field: 'chromeTimeoutMS',
label: '浏览器超时时间',
helpMessage: '单位:毫秒',
bottomHelpMessage: '浏览器默认超时,浏览器可能需要更高的超时时间。',
component: 'InputNumber',
componentProps: {
min: 0,
},
field: 'chromeTimeoutMS',
label: '浏览器超时时间',
helpMessage: '单位:毫秒',
bottomHelpMessage: '浏览器默认超时,浏览器可能需要更高的超时时间。',
component: 'InputNumber',
componentProps: {
min: 0
}
},
{
label: '以下为API方式(默认)的配置',
component: 'Divider',
component: 'Divider'
},
{
field: 'apiKey',
label: 'OpenAI API Key',
bottomHelpMessage: 'OpenAI的ApiKey用于访问OpenAI的API接口。',
component: 'InputPassword',
component: 'InputPassword'
},
{
field: 'openAiBaseUrl',
label: 'OpenAI API服务器地址',
bottomHelpMessage: 'OpenAI的API服务器地址。默认为https://api.openai.com',
component: 'Input'
},
{
field: 'model',
label: '模型',
bottomHelpMessage: '模型名称如无特殊需求保持默认即可会使用chatgpt-api库提供的当前可用的最适合的默认值。保底可用的是 text-davinci-003。当发现新的可用的chatGPT模型会更新这里的值。',
component: 'Input',
component: 'Input'
},
{
field: 'thinkingTips',
label: '思考提示',
bottomHelpMessage: '是否开启AI正在思考中的提示信息。',
component: 'Switch',
},
{
label: '以下为API2方式的配置',
component: 'Divider',
},
{
field: 'plus',
label: 'ChatGPT Plus',
bottomHelpMessage: 'ChatGPT Plus访问如果购买了ChatGPT Plus请开启响应更快。',
component: 'Switch',
},
{
field: 'reverseProxy',
label: '第三方API接口',
bottomHelpMessage: '使用第三方API。github开源的有几个没特别要求保持默认就好。',
component: 'Input',
},
{
label: '以下为API3方式的配置。',
component: 'Divider',
},
{
field: 'api',
label: 'ChatGPT API反代服务器地址',
bottomHelpMessage: 'ChatGPT的API反代服务器用于绕过Cloudflare访问ChatGPT API',
component: 'Input',
},
{
field: 'apiBaseUrl',
label: 'apiBaseUrl地址',
bottomHelpMessage: 'apiBaseUrl地址',
component: 'Input',
},
{
label: '以下为API/API2方式公用的配置',
component: 'Divider',
field: 'thinkingTips',
label: '思考提示',
bottomHelpMessage: '是否开启AI正在思考中的提示信息。',
component: 'Switch'
},
{
field: 'promptPrefixOverride',
label: 'AI风格',
bottomHelpMessage: '你可以在这里写入你希望AI回答的风格比如希望优先回答中文回答长一点等。',
component: 'InputTextArea',
component: 'InputTextArea'
},
{
field: 'assistantLabel',
label: 'AI名字',
bottomHelpMessage: 'AI认为的自己的名字当你问他你是谁是他会回答这里的名字。',
component: 'Input',
component: 'Input'
},
{
field: 'temperature',
label: 'temperature',
bottomHelpMessage: 'temperature。',
component: 'InputNumber',
componentProps: {
min: 0,
max: 2
}
},
{
label: '以下为API3方式的配置。',
component: 'Divider'
},
{
field: 'api',
label: 'ChatGPT API反代服务器地址',
bottomHelpMessage: 'ChatGPT的API反代服务器用于绕过Cloudflare访问ChatGPT API',
component: 'Input'
},
{
field: 'apiBaseUrl',
label: 'apiBaseUrl地址',
bottomHelpMessage: 'apiBaseUrl地址',
component: 'Input'
},
{
label: '以下为浏览器方式的配置',
component: 'Divider',
component: 'Divider'
},
{
field: 'username',
label: '用户名',
bottomHelpMessage: 'OpenAI用户名。',
component: 'Input',
component: 'Input'
},
{
field: 'password',
label: '密码',
bottomHelpMessage: 'OpenAI密码。',
component: 'InputPassword',
component: 'InputPassword'
},
{
field: 'UA',
label: '浏览器UA',
bottomHelpMessage: '模拟浏览器UA无特殊需求保持默认即可。',
component: 'InputTextArea',
component: 'InputTextArea'
},
{
field: 'headless',
label: '无头模式',
bottomHelpMessage: '无界面的服务器可以开启,但遇到验证码时可能无法使用。(实测很容易卡住,几乎不可用)。',
component: 'Switch',
field: 'headless',
label: '无头模式',
bottomHelpMessage: '无界面的服务器可以开启,但遇到验证码时可能无法使用。(实测很容易卡住,几乎不可用)。',
component: 'Switch'
},
{
field: 'chromePath',
label: 'Chrome路径',
bottomHelpMessage: '为空使用默认puppeteer的chromium也可以传递自己本机安装的Chrome可执行文件地址提高通过率。windows可以是C:\\Program Files\\Google\\Chrome\\Application\\chrome.exelinux通过which查找路径。',
component: 'Input',
component: 'Input'
},
{
field: '2captchaToken',
label: '验证码平台Token',
bottomHelpMessage: '可注册2captcha实现跳过验证码收费服务但很便宜。否则可能会遇到验证码而卡住。',
component: 'InputPassword',
},
component: 'InputPassword'
}
],
// 获取配置数据方法(用于前端填充显示数据)
getConfigData() {
getConfigData () {
return Config
},
// 设置配置的方法(前端点确定后调用的方法)
setConfigData(data, {Result}) {
setConfigData (data, { Result }) {
for (let [keyPath, value] of Object.entries(data)) {
// 处理黑名单
if (keyPath === 'blockWords' || keyPath === 'promptBlockWords')
value = value.toString().split(/[,;\|]/)
if (Config[keyPath] != value)
Config[keyPath] = value
// 处理黑名单
if (keyPath === 'blockWords' || keyPath === 'promptBlockWords') { value = value.toString().split(/[,;\|]/) }
if (Config[keyPath] != value) { Config[keyPath] = value }
}
return Result.ok({}, '保存成功~')
},
},
}
}
}
}
}

View file

@ -3,21 +3,21 @@
"type": "module",
"author": "ikechan8370",
"dependencies": {
"@waylaidwanderer/chatgpt-api": "^1.20.2",
"chatgpt": "^4.4.1",
"@waylaidwanderer/chatgpt-api": "^1.22.5",
"chatgpt": "^5.0.0",
"delay": "^5.0.0",
"keyv-file": "^0.2.0",
"node-fetch": "^3.3.0",
"openai": "^3.1.0",
"puppeteer-extra": "^3.3.4",
"puppeteer-extra-plugin-recaptcha": "^3.6.6",
"puppeteer-extra-plugin-stealth": "^2.11.1",
"openai": "^3.2.1",
"puppeteer-extra": "^3.3.6",
"puppeteer-extra-plugin-recaptcha": "^3.6.8",
"puppeteer-extra-plugin-stealth": "^2.11.2",
"random": "^4.1.0",
"undici": "^5.19.1",
"undici": "^5.20.0",
"uuid": "^9.0.0"
},
"optionalDependencies": {
"sharp": "^0.31.3",
"jimp": "^0.22.7"
"jimp": "^0.22.7",
"sharp": "^0.31.3"
}
}

View file

@ -14,13 +14,14 @@ const defaultConfig = {
cacheUrl: 'https://content.alcedogroup.com',
cacheEntry: false,
apiKey: '',
openAiBaseUrl: 'https://api.openai.com',
drawCD: 30,
model: '',
temperature: 0.8,
api: 'https://chatgpt.duti.tech/api/conversation',
apiBaseUrl: 'https://chatgpt.duti.tech/api',
plus: false,
reverseProxy: 'https://chatgpt.pawan.krd/api/completions',
promptPrefixOverride: 'Your answer shouldn\'t be too verbose. If you are generating a list, do not have too many items. Keep the number of items short. Prefer to answer in Chinese.',
promptPrefixOverride: 'Your answer shouldn\'t be too verbose. Prefer to answer in Chinese.',
assistantLabel: 'ChatGPT',
thinkingTips: true,
username: '',
@ -33,7 +34,7 @@ const defaultConfig = {
debug: true,
defaultTimeoutMs: 120000,
chromeTimeoutMS: 120000,
version: '2.0.3'
version: '2.0.9'
}
const _path = process.cwd()
let config = {}