mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 07:54:52 +00:00
fix: prompt calculation
User will correctly get estimated prompt usage when upstream returns either zero or nothing.
This commit is contained in:
@@ -128,6 +128,8 @@ func Relay(c *gin.Context, relayFormat types.RelayFormat) {
|
||||
return
|
||||
}
|
||||
|
||||
relayInfo.SetPromptTokens(tokens)
|
||||
|
||||
priceData, err := helper.ModelPriceHelper(c, relayInfo, tokens, meta)
|
||||
if err != nil {
|
||||
newAPIError = types.NewError(err, types.ErrorCodeModelPriceError)
|
||||
|
||||
Reference in New Issue
Block a user