fix(server): compatible with gateway.ai.cloudflare.com (#2029)
This commit is contained in:
parent
15903fae38
commit
c520580cda
|
@ -70,8 +70,13 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
|
|||
}
|
||||
}
|
||||
|
||||
if (isNotEmptyString(OPENAI_API_BASE_URL))
|
||||
if (isNotEmptyString(OPENAI_API_BASE_URL)) {
|
||||
// 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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue