Merge branch 'songquanpeng' into sync_upstream
This commit is contained in:
@@ -2,6 +2,7 @@ package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math"
|
||||
"net/http"
|
||||
"one-api/common"
|
||||
"one-api/model"
|
||||
@@ -24,6 +25,11 @@ func RelayChat(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if chatRequest.MaxTokens < 0 || chatRequest.MaxTokens > math.MaxInt32/2 {
|
||||
common.AbortWithMessage(c, http.StatusBadRequest, "max_tokens is invalid")
|
||||
return
|
||||
}
|
||||
|
||||
// 解析模型映射
|
||||
var isModelMapped bool
|
||||
modelMap, err := parseModelMapping(channel.GetModelMapping())
|
||||
|
||||
Reference in New Issue
Block a user