From c0c43461c109a239ed72184fa85f2f1d50ecc6ad Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Tue, 14 Feb 2023 18:55:47 +0800 Subject: [PATCH] feat: add other api base url for API --- apps/chat.js | 3 ++- config/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/chat.js b/apps/chat.js index 7858394..d02bdad 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -336,7 +336,7 @@ export class chatgpt extends plugin { } async sendMessage (prompt, conversation = {}, use) { - + conversation.timeoutMs = 120000 // console.log(use) if (use === 'browser') { return await this.chatgptBrowserBased(prompt, conversation) @@ -409,6 +409,7 @@ export class chatgpt extends plugin { upsertMessage, getMessageById, completionParams, + apiBaseUrl: Config.api || 'https://api.openai.com', assistantLabel: Config.assistantLabel }) const currentDate = new Date().toISOString().split('T')[0] diff --git a/config/index.js b/config/index.js index f2c7efb..d938084 100644 --- a/config/index.js +++ b/config/index.js @@ -20,7 +20,8 @@ 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方式的配置 * // ***********************************************************************************************************************************