fix: make the 'openai_organization' parameter actually work.

This commit is contained in:
我秦始皇
2024-03-18 02:19:59 -07:00
committed by GitHub
parent 0fb98e44a7
commit f63ad9c03c
3 changed files with 5 additions and 6 deletions

View File

@@ -49,11 +49,8 @@ func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Request, info *re
req.Header.Set("api-key", info.ApiKey)
return nil
}
if info.ChannelType == common.ChannelTypeOpenAI {
orgId := c.GetHeader("OpenAI-Organization")
if "" != orgId {
req.Header.Set("OpenAI-Organization", orgId)
}
if info.ChannelType == common.ChannelTypeOpenAI && "" != info.Organization {
req.Header.Set("OpenAI-Organization", info.Organization)
}
req.Header.Set("Authorization", "Bearer "+info.ApiKey)
//if info.ChannelType == common.ChannelTypeOpenRouter {