支持 openai 的 orgid

This commit is contained in:
baomi.wbm
2023-11-13 21:23:07 +08:00
parent e92587fd35
commit 45f6285d42
4 changed files with 30 additions and 3 deletions

View File

@@ -85,6 +85,7 @@ func Distribute() func(c *gin.Context) {
c.Set("model_mapping", channel.GetModelMapping())
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
c.Set("base_url", channel.GetBaseURL())
c.Set("openai_organization", channel.Organization)
switch channel.Type {
case common.ChannelTypeAzure:
c.Set("api_version", channel.Other)