litellm call id's in responses when client true

This commit is contained in:
ishaan-jaff 2023-08-31 10:09:10 -07:00
parent bb766c34ca
commit beac62b8fe
2 changed files with 25 additions and 0 deletions

View file

@ -543,6 +543,11 @@ def client(original_function):
# [OPTIONAL] ADD TO CACHE
if litellm.caching or litellm.caching_with_models or litellm.cache != None: # user init a cache object
litellm.cache.add_cache(result, *args, **kwargs)
# [OPTIONAL] Return LiteLLM call_id
if litellm.use_client == True:
result['litellm_call_id'] = litellm_call_id
# LOG SUCCESS
my_thread = threading.Thread(
target=handle_success, args=(args, kwargs, result, start_time, end_time)