mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: openAiBaseUrl为空的情况
This commit is contained in:
parent
36cdd701f9
commit
b140a9955b
1 changed files with 9 additions and 0 deletions
|
|
@ -23,6 +23,9 @@ export async function createImage (prompt, n = 1, size = '512x512') {
|
|||
// 如果配了proxy,而且有反代,但是没开启强制反代
|
||||
basePath = defaultOpenAIReverseProxy
|
||||
}
|
||||
if (!Config.openAiBaseUrl) {
|
||||
basePath = defaultOpenAIReverseProxy
|
||||
}
|
||||
const configuration = new Configuration({
|
||||
apiKey: Config.apiKey,
|
||||
basePath: basePath + '/v1'
|
||||
|
|
@ -50,6 +53,9 @@ export async function imageVariation (imageUrl, n = 1, size = '512x512') {
|
|||
// 如果配了proxy,而且有反代,但是没开启强制反代
|
||||
basePath = defaultOpenAIReverseProxy
|
||||
}
|
||||
if (!Config.openAiBaseUrl) {
|
||||
basePath = defaultOpenAIReverseProxy
|
||||
}
|
||||
const configuration = new Configuration({
|
||||
apiKey: Config.apiKey,
|
||||
basePath: basePath + '/v1'
|
||||
|
|
@ -124,6 +130,9 @@ export async function editImage (originalImage, mask = [], prompt, num = 1, size
|
|||
// 如果配了proxy,而且有反代,但是没开启强制反代
|
||||
basePath = defaultOpenAIReverseProxy
|
||||
}
|
||||
if (!Config.openAiBaseUrl) {
|
||||
basePath = defaultOpenAIReverseProxy
|
||||
}
|
||||
const configuration = new Configuration({
|
||||
apiKey: Config.apiKey,
|
||||
basePath: basePath + '/v1'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue