fix: make the 'openai_organization' parameter actually work.

This commit is contained in:
我秦始皇
2024-03-18 02:11:21 -07:00
committed by GitHub
parent 652bb4a53c
commit 0fb98e44a7
2 changed files with 9 additions and 0 deletions

View File

@@ -155,6 +155,9 @@ func Distribute() func(c *gin.Context) {
if channel.AutoBan != nil && *channel.AutoBan == 0 {
ban = false
}
if nil != channel.OpenAIOrganization {
c.Request.Header.Set("OpenAI-Organization", *channel.OpenAIOrganization)
}
c.Set("auto_ban", ban)
c.Set("model_mapping", channel.GetModelMapping())
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))