fix: 整理默认ChatGPTAPI变量

This commit is contained in:
ikechan8370 2023-03-07 17:22:08 +08:00
parent 5c650041b9
commit ec74999df8
2 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
import { v4 as uuidv4 } from 'uuid'
import { Config } from '../utils/config.js'
import {Config, defaultChatGPTAPI} from '../utils/config.js'
import _ from 'lodash'
import fetch from 'node-fetch'
let proxy
@ -48,10 +48,10 @@ export class OfficialChatGPTClient {
if (timeoutMs) {
abortController = new AbortController()
}
let url = this._apiReverseUrl || 'https://apps.openai.com/api/conversation'
let url = this._apiReverseUrl || defaultChatGPTAPI
if (this._apiReverseUrl && Config.proxy && !Config.apiForceUseReverse) {
// 如果配了proxy而且有反代但是没开启强制反代
url = 'https://apps.openai.com/api/conversation'
url = defaultChatGPTAPI
}
const body = {
action,