mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-21 17:56:38 +08:00
fix: add missing upstreamModelName
This commit is contained in:
parent
a8f0c5dab2
commit
7297c6269f
@ -116,6 +116,8 @@ func Distribute() func(c *gin.Context) {
|
|||||||
abortWithMessage(c, http.StatusServiceUnavailable, fmt.Sprintf("当前分组 %s 下对于模型 %s 无可用渠道(数据库一致性已被破坏)", userGroup, modelRequest.Model))
|
abortWithMessage(c, http.StatusServiceUnavailable, fmt.Sprintf("当前分组 %s 下对于模型 %s 无可用渠道(数据库一致性已被破坏)", userGroup, modelRequest.Model))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.Set("model_name", modelRequest.Model)
|
||||||
}
|
}
|
||||||
c.Set("channel", channel.Type)
|
c.Set("channel", channel.Type)
|
||||||
c.Set("channel_id", channel.Id)
|
c.Set("channel_id", channel.Id)
|
||||||
|
@ -34,6 +34,7 @@ func GenRelayInfo(c *gin.Context) *RelayInfo {
|
|||||||
userId := c.GetInt("id")
|
userId := c.GetInt("id")
|
||||||
group := c.GetString("group")
|
group := c.GetString("group")
|
||||||
tokenUnlimited := c.GetBool("token_unlimited_quota")
|
tokenUnlimited := c.GetBool("token_unlimited_quota")
|
||||||
|
upstreamModelName := c.GetString("model_name")
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
|
|
||||||
apiType := constant.ChannelType2APIType(channelType)
|
apiType := constant.ChannelType2APIType(channelType)
|
||||||
@ -52,6 +53,7 @@ func GenRelayInfo(c *gin.Context) *RelayInfo {
|
|||||||
ApiType: apiType,
|
ApiType: apiType,
|
||||||
ApiVersion: c.GetString("api_version"),
|
ApiVersion: c.GetString("api_version"),
|
||||||
ApiKey: strings.TrimPrefix(c.Request.Header.Get("Authorization"), "Bearer "),
|
ApiKey: strings.TrimPrefix(c.Request.Header.Get("Authorization"), "Bearer "),
|
||||||
|
UpstreamModelName: upstreamModelName,
|
||||||
}
|
}
|
||||||
if info.BaseUrl == "" {
|
if info.BaseUrl == "" {
|
||||||
info.BaseUrl = common.ChannelBaseURLs[channelType]
|
info.BaseUrl = common.ChannelBaseURLs[channelType]
|
||||||
|
Loading…
Reference in New Issue
Block a user