mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
fix(utils.py): add response ms for async calls
This commit is contained in:
parent
898f15af2b
commit
381fdcd37b
2 changed files with 5 additions and 2 deletions
|
@ -1370,6 +1370,8 @@ def client(original_function):
|
|||
# LOG SUCCESS - handle streaming success logging in the _next_ object, remove `handle_success` once it's deprecated
|
||||
threading.Thread(target=logging_obj.success_handler, args=(result, start_time, end_time)).start()
|
||||
# RETURN RESULT
|
||||
if isinstance(result, ModelResponse):
|
||||
result._response_ms = (end_time - start_time).total_seconds() * 1000 # return response latency in ms like openai
|
||||
return result
|
||||
except Exception as e:
|
||||
call_type = original_function.__name__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue