chore: change variable name
This commit is contained in:
parent
9944dd5c39
commit
00fa86c000
@ -4,5 +4,5 @@ var (
|
|||||||
Channel = "channel"
|
Channel = "channel"
|
||||||
RequestModel = "request_model"
|
RequestModel = "request_model"
|
||||||
ConvertedRequest = "converted_request"
|
ConvertedRequest = "converted_request"
|
||||||
OriginModel = "origin_model"
|
OriginalModel = "original_model"
|
||||||
)
|
)
|
||||||
|
@ -55,7 +55,7 @@ func Relay(c *gin.Context) {
|
|||||||
lastFailedChannelId := channelId
|
lastFailedChannelId := channelId
|
||||||
channelName := c.GetString("channel_name")
|
channelName := c.GetString("channel_name")
|
||||||
group := c.GetString("group")
|
group := c.GetString("group")
|
||||||
originalModel := c.GetString(ctxkey.OriginModel)
|
originalModel := c.GetString(ctxkey.OriginalModel)
|
||||||
go processChannelRelayError(ctx, channelId, channelName, bizErr)
|
go processChannelRelayError(ctx, channelId, channelName, bizErr)
|
||||||
requestId := c.GetString(logger.RequestIdKey)
|
requestId := c.GetString(logger.RequestIdKey)
|
||||||
retryTimes := config.RetryTimes
|
retryTimes := config.RetryTimes
|
||||||
|
@ -64,7 +64,7 @@ func SetupContextForSelectedChannel(c *gin.Context, channel *model.Channel, mode
|
|||||||
c.Set("channel_id", channel.Id)
|
c.Set("channel_id", channel.Id)
|
||||||
c.Set("channel_name", channel.Name)
|
c.Set("channel_name", channel.Name)
|
||||||
c.Set("model_mapping", channel.GetModelMapping())
|
c.Set("model_mapping", channel.GetModelMapping())
|
||||||
c.Set(ctxkey.OriginModel, modelName) // for retry
|
c.Set(ctxkey.OriginalModel, modelName) // for retry
|
||||||
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
|
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
|
||||||
c.Set("base_url", channel.GetBaseURL())
|
c.Set("base_url", channel.GetBaseURL())
|
||||||
// this is for backward compatibility
|
// this is for backward compatibility
|
||||||
|
@ -212,7 +212,7 @@ func StreamHandler(c *gin.Context, resp *http.Response) (*relaymodel.ErrorWithSt
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
response.Id = id
|
response.Id = id
|
||||||
response.Model = c.GetString(ctxkey.OriginModel)
|
response.Model = c.GetString(ctxkey.OriginalModel)
|
||||||
response.Created = createdTime
|
response.Created = createdTime
|
||||||
jsonStr, err := json.Marshal(response)
|
jsonStr, err := json.Marshal(response)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user