Check if completion_tokens is none in error handler.

This commit is contained in:
Andrei Betlen 2023-12-22 13:41:06 -05:00
parent 12b7f2f4e9
commit 99ff175562

View file

@ -72,7 +72,7 @@ class ErrorResponseFormatters:
return 400, ErrorResponse(
message=message.format(
context_window,
completion_tokens + prompt_tokens,
(completion_tokens or 0) + prompt_tokens,
prompt_tokens,
completion_tokens,
), # type: ignore