🐛 fix: Fix conditional caching in RelayHandler
This commit is contained in:
parent
755dbf79be
commit
36653c2ce5
@ -111,8 +111,11 @@ func RelayHandler(relay RelayBaseInterface) (err *types.OpenAIErrorWithStatusCod
|
||||
}
|
||||
|
||||
quota.Consume(relay.getContext(), usage)
|
||||
cacheProps := relay.GetChatCache()
|
||||
go cacheProps.StoreCache(relay.getContext().GetInt("channel_id"), usage.PromptTokens, usage.CompletionTokens, relay.getModelName())
|
||||
if usage.CompletionTokens > 0 {
|
||||
cacheProps := relay.GetChatCache()
|
||||
go cacheProps.StoreCache(relay.getContext().GetInt("channel_id"), usage.PromptTokens, usage.CompletionTokens, relay.getModelName())
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user