feat: support xunfei v3 (#637)

This commit is contained in:
MaricoHan 2023-10-29 22:03:01 +08:00 committed by GitHub
parent 89d458b9cf
commit aec343dc38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -298,8 +298,8 @@ func getXunfeiAuthUrl(c *gin.Context, apiKey string, apiSecret string) (string,
common.SysLog("api_version not found, use default: " + apiVersion)
}
domain := "general"
if apiVersion == "v2.1" {
domain = "generalv2"
if apiVersion != "v1.1" {
domain += strings.Split(apiVersion, ".")[0]
}
authUrl := buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/chat", apiVersion), apiKey, apiSecret)
return domain, authUrl