mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-14 20:23:46 +08:00
🎨 Change the method of getting channel parameters
This commit is contained in:
@@ -59,7 +59,7 @@ func (p *OpenAIProvider) GetFullRequestURL(requestURL string, modelName string)
|
||||
baseURL := strings.TrimSuffix(p.GetBaseURL(), "/")
|
||||
|
||||
if p.IsAzure {
|
||||
apiVersion := p.Context.GetString("api_version")
|
||||
apiVersion := p.Channel.Other
|
||||
if modelName == "dall-e-2" {
|
||||
// 因为dall-e-3需要api-version=2023-12-01-preview,但是该版本
|
||||
// 已经没有dall-e-2了,所以暂时写死
|
||||
@@ -85,9 +85,9 @@ func (p *OpenAIProvider) GetRequestHeaders() (headers map[string]string) {
|
||||
headers = make(map[string]string)
|
||||
p.CommonRequestHeaders(headers)
|
||||
if p.IsAzure {
|
||||
headers["api-key"] = p.Context.GetString("api_key")
|
||||
headers["api-key"] = p.Channel.Key
|
||||
} else {
|
||||
headers["Authorization"] = fmt.Sprintf("Bearer %s", p.Context.GetString("api_key"))
|
||||
headers["Authorization"] = fmt.Sprintf("Bearer %s", p.Channel.Key)
|
||||
}
|
||||
|
||||
return headers
|
||||
|
||||
Reference in New Issue
Block a user