mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
(fix) use asyncio run_in_executor
This commit is contained in:
parent
e6b5152e63
commit
f2cfb76920
1 changed files with 6 additions and 4 deletions
|
@ -2363,10 +2363,12 @@ def client(original_function):
|
|||
threading.Thread(
|
||||
target=logging_obj.success_handler, args=(result, start_time, end_time)
|
||||
).start()
|
||||
threading.Thread(
|
||||
target=logging_obj.async_success_handler,
|
||||
args=(result, start_time, end_time),
|
||||
).start()
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_in_executor(
|
||||
executor=None,
|
||||
func=logging_obj.async_success_handler(result, start_time, end_time),
|
||||
)
|
||||
# RETURN RESULT
|
||||
if hasattr(result, "_hidden_params"):
|
||||
result._hidden_params["model_id"] = kwargs.get("model_info", {}).get(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue