mirror of
https://github.com/linux-do/new-api.git
synced 2025-12-26 00:25:57 +08:00
feat: support set proxy for channel OpenAI (close #139)
This commit is contained in:
@@ -147,6 +147,10 @@ func relayHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
||||
requestURL := c.Request.URL.String()
|
||||
if channelType == common.ChannelTypeCustom {
|
||||
baseURL = c.GetString("base_url")
|
||||
} else if channelType == common.ChannelTypeOpenAI {
|
||||
if c.GetString("base_url") != "" {
|
||||
baseURL = c.GetString("base_url")
|
||||
}
|
||||
}
|
||||
fullRequestURL := fmt.Sprintf("%s%s", baseURL, requestURL)
|
||||
if channelType == common.ChannelTypeAzure {
|
||||
|
||||
Reference in New Issue
Block a user