fix: null option

This commit is contained in:
ikechan8370 2023-02-14 18:58:58 +08:00
parent 87cc56e289
commit 548642dab9
2 changed files with 7 additions and 3 deletions

View file

@ -6,7 +6,7 @@ import mjAPI from 'mathjax-node'
import { uuid } from 'oicq/lib/common.js'
import delay from 'delay'
import { ChatGPTAPI } from 'chatgpt'
import { ChatGPTClient, BingAIClient } from '@waylaidwanderer/chatgpt-api'
import { ChatGPTClient, BingAIClient } from '@waylaidwanderer/chatgpt-api'
import { getMessageById, tryTimes, upsertMessage } from '../utils/common.js'
import { ChatGPTPuppeteer } from '../utils/browser.js'
import { KeyvFile } from 'keyv-file'
@ -336,7 +336,11 @@ export class chatgpt extends plugin {
}
async sendMessage (prompt, conversation = {}, use) {
conversation.timeoutMs = 120000
if (!conversation) {
conversation = {
timeoutMs: 120000
}
}
// console.log(use)
if (use === 'browser') {
return await this.chatgptBrowserBased(prompt, conversation)

View file

@ -20,7 +20,7 @@ export const Config = {
apiKey: API_KEY,
// 模型名称选填。如无特殊需求保持默认即可会使用chatgpt-api库提供的当前可用的最适合的默认值。保底可用的是 text-davinci-003。当发现新的可用的chatGPT模型会更新这里的值
// 20230211 text-chat-davinci-002-sh-alpha-aoruigiofdj83 中午存活了几分钟
model: '',
model: 'text-davinci-002-render',
api: '',
// ***********************************************************************************************************************************
// 以下为API2方式的配置 *