mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): fix cached responses - translate dict to objects
This commit is contained in:
parent
84460b8222
commit
a4c9e6bd46
4 changed files with 108 additions and 21 deletions
|
@ -144,7 +144,11 @@ async def acompletion(*args, **kwargs):
|
|||
response = completion(*args, **kwargs)
|
||||
else:
|
||||
# Await normally
|
||||
response = await completion(*args, **kwargs)
|
||||
init_response = completion(*args, **kwargs)
|
||||
if isinstance(init_response, dict):
|
||||
response = init_response
|
||||
else:
|
||||
response = await init_response
|
||||
else:
|
||||
# Call the synchronous function using run_in_executor
|
||||
response = await loop.run_in_executor(None, func_with_context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue