From f7ee904414aae6aa2ef7ae1c2934c566c18f48fe Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 7 Dec 2023 20:36:26 +0800 Subject: [PATCH] fix: api3 --- utils/config.js | 6 +++--- utils/message.js | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/utils/config.js b/utils/config.js index 059ca7d..fe95971 100644 --- a/utils/config.js +++ b/utils/config.js @@ -1,7 +1,7 @@ import fs from 'fs' import lodash from 'lodash' -export const defaultChatGPTAPI = 'https://pimon.d201.cn/backend-api/conversation' -export const officialChatGPTAPI = 'https://pimon.d201.cn/backend-api/conversation' +export const defaultChatGPTAPI = 'https://chat3.avocado.wiki/backend-api/conversation' +export const officialChatGPTAPI = 'https://chat3.avocado.wiki/backend-api/conversation' // Reverse proxy of https://api.openai.com export const defaultOpenAIReverseProxy = 'https://mondstadt.d201.eu.org/v1' // blocked in China Mainland @@ -43,7 +43,7 @@ const defaultConfig = { sydneyMoodTip: 'Your response should be divided into two parts, namely, the text and your mood. The mood available to you can only include: blandness, happy, shy, frustrated, disgusted, and frightened.All content should be replied in this format {"text": "", "mood": ""}.All content except mood should be placed in text, It is important to ensure that the content you reply to can be parsed by json.', enableSuggestedResponses: false, api: defaultChatGPTAPI, - apiBaseUrl: 'https://pimon.d201.cn/backend-api', + apiBaseUrl: 'https://chat3.avocado.wiki/backend-api', apiForceUseReverse: false, plus: false, useGPT4: false, diff --git a/utils/message.js b/utils/message.js index 875d20d..8d35eb4 100644 --- a/utils/message.js +++ b/utils/message.js @@ -36,11 +36,14 @@ export class OfficialChatGPTClient { content: { content_type: 'text', parts: [prompt] - } + }, + metadata: {} } ], model: Config.useGPT4 ? 'gpt-4' : 'text-davinci-002-render-sha', - parent_message_id: parentMessageId + parent_message_id: parentMessageId, + timezone_offset_min: -480, + history_and_training_disabled: false } if (conversationId) { body.conversation_id = conversationId