feat: support set proxy for channel OpenAI (close #139)

This commit is contained in:
JustSong committed 2023-06-09 18:30:01 +08:00
1 parent ac11307faf
commit a04afb22ea
5 files changed
+25 -7

No files matched your search

+3 -5
View File
@@ -82,11 +82,9 @@ func Distribute() func(c *gin.Context) {
c.Set("channel_id", channel.Id)
c.Set("channel_name", channel.Name)
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
if channel.Type == common.ChannelTypeCustom || channel.Type == common.ChannelTypeAzure {
c.Set("base_url", channel.BaseURL)
if channel.Type == common.ChannelTypeAzure {
c.Set("api_version", channel.Other)
}
c.Set("base_url", channel.BaseURL)
if channel.Type == common.ChannelTypeAzure {
c.Set("api_version", channel.Other)
}
c.Next()
}