fix: 修复模型映射功能失效 (close #105)

This commit is contained in:
CaIon
2024-03-11 18:28:51 +08:00
parent 97dd80541b
commit d4df1960b2
3 changed files with 14 additions and 12 deletions

View File

@@ -60,7 +60,6 @@ func getAndValidateTextRequest(c *gin.Context, relayInfo *relaycommon.RelayInfo)
}
}
relayInfo.IsStream = textRequest.Stream
relayInfo.UpstreamModelName = textRequest.Model
return textRequest, nil
}
@@ -86,9 +85,11 @@ func TextHelper(c *gin.Context) *dto.OpenAIErrorWithStatusCode {
}
if modelMap[textRequest.Model] != "" {
textRequest.Model = modelMap[textRequest.Model]
// set upstream model name
isModelMapped = true
}
}
relayInfo.UpstreamModelName = textRequest.Model
modelPrice := common.GetModelPrice(textRequest.Model, false)
groupRatio := common.GetGroupRatio(relayInfo.Group)