mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Merge 57f1d436e1
into f5996b2f6b
This commit is contained in:
commit
2c20b3726b
9 changed files with 189 additions and 104 deletions
|
@ -808,9 +808,7 @@ async def _client_async_logging_helper(
|
|||
f"Async Wrapper: Completed Call, calling async_success_handler: {logging_obj.async_success_handler}"
|
||||
)
|
||||
# check if user does not want this to be logged
|
||||
asyncio.create_task(
|
||||
logging_obj.async_success_handler(result, start_time, end_time)
|
||||
)
|
||||
await logging_obj.async_success_handler(result, start_time, end_time)
|
||||
logging_obj.handle_sync_success_callbacks_for_async_calls(
|
||||
result=result,
|
||||
start_time=start_time,
|
||||
|
@ -1183,12 +1181,8 @@ def client(original_function): # noqa: PLR0915
|
|||
|
||||
# LOG SUCCESS - handle streaming success logging in the _next_ object, remove `handle_success` once it's deprecated
|
||||
verbose_logger.info("Wrapper: Completed Call, calling success_handler")
|
||||
executor.submit(
|
||||
logging_obj.success_handler,
|
||||
result,
|
||||
start_time,
|
||||
end_time,
|
||||
)
|
||||
logging_obj.success_handler(result, start_time, end_time)
|
||||
|
||||
# RETURN RESULT
|
||||
update_response_metadata(
|
||||
result=result,
|
||||
|
@ -1357,15 +1351,18 @@ def client(original_function): # noqa: PLR0915
|
|||
)
|
||||
|
||||
# LOG SUCCESS - handle streaming success logging in the _next_ object
|
||||
asyncio.create_task(
|
||||
_client_async_logging_helper(
|
||||
logging_obj=logging_obj,
|
||||
result=result,
|
||||
start_time=start_time,
|
||||
end_time=end_time,
|
||||
is_completion_with_fallbacks=is_completion_with_fallbacks,
|
||||
)
|
||||
async_logging_params = dict(
|
||||
logging_obj=logging_obj,
|
||||
result=result,
|
||||
start_time=start_time,
|
||||
end_time=end_time,
|
||||
is_completion_with_fallbacks=is_completion_with_fallbacks,
|
||||
)
|
||||
if litellm.sync_logging:
|
||||
await _client_async_logging_helper(**async_logging_params)
|
||||
else:
|
||||
asyncio.create_task(_client_async_logging_helper(**async_logging_params))
|
||||
|
||||
logging_obj.handle_sync_success_callbacks_for_async_calls(
|
||||
result=result,
|
||||
start_time=start_time,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue