fix: api3

This commit is contained in:
ikechan8370 2023-12-07 20:36:26 +08:00
parent 8553525935
commit f7ee904414
2 changed files with 8 additions and 5 deletions

View file

@ -1,7 +1,7 @@
import fs from 'fs' import fs from 'fs'
import lodash from 'lodash' import lodash from 'lodash'
export const defaultChatGPTAPI = 'https://pimon.d201.cn/backend-api/conversation' export const defaultChatGPTAPI = 'https://chat3.avocado.wiki/backend-api/conversation'
export const officialChatGPTAPI = 'https://pimon.d201.cn/backend-api/conversation' export const officialChatGPTAPI = 'https://chat3.avocado.wiki/backend-api/conversation'
// Reverse proxy of https://api.openai.com // Reverse proxy of https://api.openai.com
export const defaultOpenAIReverseProxy = 'https://mondstadt.d201.eu.org/v1' export const defaultOpenAIReverseProxy = 'https://mondstadt.d201.eu.org/v1'
// blocked in China Mainland // 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.', 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, enableSuggestedResponses: false,
api: defaultChatGPTAPI, api: defaultChatGPTAPI,
apiBaseUrl: 'https://pimon.d201.cn/backend-api', apiBaseUrl: 'https://chat3.avocado.wiki/backend-api',
apiForceUseReverse: false, apiForceUseReverse: false,
plus: false, plus: false,
useGPT4: false, useGPT4: false,

View file

@ -36,11 +36,14 @@ export class OfficialChatGPTClient {
content: { content: {
content_type: 'text', content_type: 'text',
parts: [prompt] parts: [prompt]
} },
metadata: {}
} }
], ],
model: Config.useGPT4 ? 'gpt-4' : 'text-davinci-002-render-sha', 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) { if (conversationId) {
body.conversation_id = conversationId body.conversation_id = conversationId