diff --git a/i18n/en.json b/i18n/en.json index 6d9cf604..97218b96 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1120,5 +1120,7 @@ "开始时间": "Start Time", "模型名称为coze-{bot_id},你也可以直接使用 coze-* 通配符来匹配所有coze开头的模型": "The model name is coze-{bot_id}, you can also directly use the coze-* wildcard to match all models starting with coze", "模型名称映射, 你可以取一个容易记忆的名字来代替coze-{bot_id},例如:": "Model name mapping, you can take an easy-to-remember name to replace coze-{bot_id}, for example: ", - ",注意:如果使用了模型映射,那么上面的模型名称必须使用映射前的名称,上述例子中,你应该在模型中填入coze-translate(如果已经使用了coze-*,可以忽略)。": ", Note: If a model mapping is used, then the model name above must use the name before the mapping. In the example above, you should fill in coze-translate in the model (if coze-* has been used, it can be ignored)." + ",注意:如果使用了模型映射,那么上面的模型名称必须使用映射前的名称,上述例子中,你应该在模型中填入coze-translate(如果已经使用了coze-*,可以忽略)。": ", Note: If a model mapping is used, then the model name above must use the name before the mapping. In the example above, you should fill in coze-translate in the model (if coze-* has been used, it can be ignored).", + "位置/区域": "Location/Region", + "请输入你 Speech Studio 的位置/区域,例如:eastasia": "Please enter the location/region of your Speech Studio, for example: eastasia" } diff --git a/providers/azureSpeech/base.go b/providers/azureSpeech/base.go index 66bbf04b..52bc46ac 100644 --- a/providers/azureSpeech/base.go +++ b/providers/azureSpeech/base.go @@ -1,9 +1,11 @@ package azureSpeech import ( + "fmt" "one-api/common/requester" "one-api/model" "one-api/providers/base" + "strings" ) // 定义供应商工厂 @@ -26,6 +28,17 @@ type AzureSpeechProvider struct { base.BaseProvider } +func (p *AzureSpeechProvider) GetFullRequestURL(requestURL string, modelName string) string { + baseURL := "" + if p.Channel.Other != "" { + baseURL = fmt.Sprintf("https://%s.tts.speech.microsoft.com", p.Channel.Other) + } else { + baseURL = strings.TrimSuffix(p.GetBaseURL(), "/") + } + + return fmt.Sprintf("%s%s", baseURL, requestURL) +} + // 获取请求头 func (p *AzureSpeechProvider) GetRequestHeaders() (headers map[string]string) { headers = make(map[string]string) diff --git a/web/src/views/Channel/type/Config.js b/web/src/views/Channel/type/Config.js index 86c2176d..10b4d7d7 100644 --- a/web/src/views/Channel/type/Config.js +++ b/web/src/views/Channel/type/Config.js @@ -159,12 +159,16 @@ const typeConfig = { modelGroup: 'Baichuan' }, 24: { + inputLabel: { + other: '位置/区域' + }, input: { models: ['tts-1', 'tts-1-hd'] }, prompt: { test_model: '', - base_url: '请输入请求地址,例如:https://eastasia.tts.speech.microsoft.com' + base_url: '', + other: '请输入你 Speech Studio 的位置/区域,例如:eastasia' } }, 27: {