mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: fallback to official api
This commit is contained in:
parent
176f94f534
commit
628f57a8b0
2 changed files with 4 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import fs from 'fs'
|
||||
import lodash from 'lodash'
|
||||
export const defaultChatGPTAPI = 'https://pimon.d201.cn/backend-api/conversation'
|
||||
export const officialChatGPTAPI = 'https://apps.openai.com/api/conversation'
|
||||
const defaultConfig = {
|
||||
blockWords: ['屏蔽词1', '屏蔽词b'],
|
||||
promptBlockWords: ['屏蔽词1', '屏蔽词b'],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { v4 as uuidv4 } from 'uuid'
|
||||
import {Config, defaultChatGPTAPI} from '../utils/config.js'
|
||||
import {Config, defaultChatGPTAPI, officialChatGPTAPI} 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 || defaultChatGPTAPI
|
||||
let url = this._apiReverseUrl || officialChatGPTAPI
|
||||
if (this._apiReverseUrl && Config.proxy && !Config.apiForceUseReverse) {
|
||||
// 如果配了proxy,而且有反代,但是没开启强制反代
|
||||
url = defaultChatGPTAPI
|
||||
url = officialChatGPTAPI
|
||||
}
|
||||
const body = {
|
||||
action,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue