mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-17 05:33:42 +08:00
✨ feat: support editing completion rate (#68)
* ✨ feat: support editing completion rate * 🐛 fix: Error judgment of Azure model name * 💄 improve: mobile tip experience * 💄 improve: SparkDesk model version switch
This commit is contained in:
@@ -85,13 +85,6 @@ func (p *OpenAIProvider) GetFullRequestURL(requestURL string, modelName string)
|
||||
|
||||
if p.IsAzure {
|
||||
apiVersion := p.Channel.Other
|
||||
// 以-分割,检测modelName 最后一个元素是否为4位数字,必须是数字,如果是则删除modelName最后一个元素
|
||||
modelNameSlice := strings.Split(modelName, "-")
|
||||
lastModelNameSlice := modelNameSlice[len(modelNameSlice)-1]
|
||||
modelNum := common.String2Int(lastModelNameSlice)
|
||||
if modelNum > 999 && modelNum < 10000 {
|
||||
modelName = strings.TrimSuffix(modelName, "-"+lastModelNameSlice)
|
||||
}
|
||||
// 检测模型是是否包含 . 如果有则直接去掉
|
||||
modelName = strings.Replace(modelName, ".", "", -1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user