mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-19 18:14:45 +00:00
feat: support dalle for Azure (#754)
* feat: Add Message-ID to email headers to comply with RFC 5322 - Extract domain from SMTPFrom - Generate a unique Message-ID - Add Message-ID to email headers * chore: check slice length * feat: Add Azure compatibility for relayImageHelper - Handle Azure channel requestURL compatibility - Set api-key header for Azure channel authentication - Handle Azure channel request body fixes: https://github.com/songquanpeng/one-api/issues/751 * refactor: update implementation --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
@@ -191,7 +191,6 @@ func getFullRequestURL(baseURL string, requestURL string, channelType int) strin
|
||||
fullRequestURL = fmt.Sprintf("%s%s", baseURL, strings.TrimPrefix(requestURL, "/openai/deployments"))
|
||||
}
|
||||
}
|
||||
|
||||
return fullRequestURL
|
||||
}
|
||||
|
||||
@@ -216,3 +215,12 @@ func postConsumeQuota(ctx context.Context, tokenId int, quotaDelta int, totalQuo
|
||||
common.LogError(ctx, fmt.Sprintf("totalQuota consumed is %d, something is wrong", totalQuota))
|
||||
}
|
||||
}
|
||||
|
||||
func GetAPIVersion(c *gin.Context) string {
|
||||
query := c.Request.URL.Query()
|
||||
apiVersion := query.Get("api-version")
|
||||
if apiVersion == "" {
|
||||
apiVersion = c.GetString("api_version")
|
||||
}
|
||||
return apiVersion
|
||||
}
|
||||
|
Reference in New Issue
Block a user