mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-11 10:53:42 +08:00
fix: Improve error handling and logging in channel update abilities
- Improve error handling in `UpdateAbilities()` method - Log model name change request to the mapped model
This commit is contained in:
@@ -29,9 +29,16 @@ func RelayTextHelper(c *gin.Context) *model.ErrorWithStatusCode {
|
||||
meta.IsStream = textRequest.Stream
|
||||
|
||||
// map model name
|
||||
var isModelMapped bool
|
||||
var (
|
||||
originRequestModel = textRequest.Model
|
||||
isModelMapped bool
|
||||
)
|
||||
meta.OriginModelName = textRequest.Model
|
||||
textRequest.Model, isModelMapped = util.GetMappedModelName(textRequest.Model, meta.ModelMapping)
|
||||
if isModelMapped {
|
||||
logger.Info(c.Request.Context(), fmt.Sprintf("rewrite model name from %s to %s", originRequestModel, textRequest.Model))
|
||||
}
|
||||
|
||||
meta.ActualModelName = textRequest.Model
|
||||
// get model ratio & group ratio
|
||||
modelRatio := common.GetModelRatio(textRequest.Model)
|
||||
|
||||
Reference in New Issue
Block a user