mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-10-20 02:31:29 +00:00
fix(server): compatible with gateway.ai.cloudflare.com (#2029)
This commit is contained in:
@@ -70,8 +70,13 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNotEmptyString(OPENAI_API_BASE_URL))
|
if (isNotEmptyString(OPENAI_API_BASE_URL)) {
|
||||||
options.apiBaseUrl = `${OPENAI_API_BASE_URL}/v1`
|
// if find /v1 in OPENAI_API_BASE_URL then use it
|
||||||
|
if (OPENAI_API_BASE_URL.includes('/v1'))
|
||||||
|
options.apiBaseUrl = `${OPENAI_API_BASE_URL}`
|
||||||
|
else
|
||||||
|
options.apiBaseUrl = `${OPENAI_API_BASE_URL}/v1`
|
||||||
|
}
|
||||||
|
|
||||||
setupProxy(options)
|
setupProxy(options)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user