Merge remote-tracking branch 'songquanpeng/main'
This commit is contained in:
commit
5108f3c98f
@ -48,6 +48,9 @@ func GetUsage(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
amount := float64(quota)
|
amount := float64(quota)
|
||||||
|
if common.DisplayInCurrencyEnabled {
|
||||||
|
amount /= common.QuotaPerUnit
|
||||||
|
}
|
||||||
usage := OpenAIUsageResponse{
|
usage := OpenAIUsageResponse{
|
||||||
Object: "list",
|
Object: "list",
|
||||||
TotalUsage: amount,
|
TotalUsage: amount,
|
||||||
|
@ -33,6 +33,7 @@ func CacheGetTokenByKey(key string) (*Token, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
common.SysError("Redis set token error: " + err.Error())
|
common.SysError("Redis set token error: " + err.Error())
|
||||||
}
|
}
|
||||||
|
return &token, nil
|
||||||
}
|
}
|
||||||
err = json.Unmarshal([]byte(tokenObjectString), &token)
|
err = json.Unmarshal([]byte(tokenObjectString), &token)
|
||||||
return &token, err
|
return &token, err
|
||||||
@ -94,6 +95,7 @@ func CacheGetRandomSatisfiedChannel(group string, model string) (*Channel, error
|
|||||||
if !common.RedisEnabled {
|
if !common.RedisEnabled {
|
||||||
return GetRandomSatisfiedChannel(group, model)
|
return GetRandomSatisfiedChannel(group, model)
|
||||||
}
|
}
|
||||||
|
return GetRandomSatisfiedChannel(group, model)
|
||||||
// TODO: implement this
|
// TODO: implement this
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user