Update utils.py (#5530)

fix KeyError (cause by typo?)
This commit is contained in:
OrangeWolf 2024-09-05 23:21:41 +08:00 committed by GitHub
parent a9be7dd79b
commit 773914bcb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -503,7 +503,7 @@ class Usage(CompletionUsage):
if "prompt_cache_hit_tokens" in params and isinstance(
params["prompt_cache_hit_tokens"], int
):
self._cache_read_input_tokens = params["prompt_cache_hit_tokens=0"]
self._cache_read_input_tokens = params["prompt_cache_hit_tokens"]
for k, v in params.items():
setattr(self, k, v)