From fe4ef2bd576604ef0f30bdaebe6fa2660a11a50d Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 27 Oct 2023 18:02:14 -0700 Subject: [PATCH] (fix) only set litellm call id if it's not set in completion() --- litellm/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index caba194da4..65a069906c 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -757,8 +757,10 @@ def client(original_function): def wrapper(*args, **kwargs): start_time = datetime.datetime.now() result = None - litellm_call_id = str(uuid.uuid4()) - kwargs["litellm_call_id"] = litellm_call_id + + # only set litellm_call_id if its not in kwargs + if "litellm_call_id" not in kwargs: + kwargs["litellm_call_id"] = str(uuid.uuid4()) try: model = args[0] if len(args) > 0 else kwargs["model"] except: