mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(lowest_latency.py): set default none value for time_to_first_token in sync log success event
This commit is contained in:
parent
bfde1357dd
commit
f19d7327ca
1 changed files with 2 additions and 1 deletions
|
@ -84,6 +84,7 @@ class LowestLatencyLoggingHandler(CustomLogger):
|
|||
|
||||
response_ms: timedelta = end_time - start_time
|
||||
time_to_first_token_response_time: Optional[timedelta] = None
|
||||
|
||||
if kwargs.get("stream", None) is not None and kwargs["stream"] == True:
|
||||
# only log ttft for streaming request
|
||||
time_to_first_token_response_time = (
|
||||
|
@ -91,7 +92,7 @@ class LowestLatencyLoggingHandler(CustomLogger):
|
|||
)
|
||||
|
||||
final_value = response_ms
|
||||
|
||||
time_to_first_token: Optional[float] = None
|
||||
total_tokens = 0
|
||||
|
||||
if isinstance(response_obj, ModelResponse):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue