From e676eaa85d834cc1dd62349d01e08b95d7bbd0d7 Mon Sep 17 00:00:00 2001 From: Tim Asp <707699+timothyasp@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:56:45 -0800 Subject: [PATCH] Cleaner fallback --- litellm/integrations/langsmith.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/integrations/langsmith.py b/litellm/integrations/langsmith.py index 82fe4be0aa..4c76ba80b3 100644 --- a/litellm/integrations/langsmith.py +++ b/litellm/integrations/langsmith.py @@ -21,9 +21,7 @@ class LangsmithLogger: def log_event(self, kwargs, response_obj, start_time, end_time, print_verbose): # Method definition # inspired by Langsmith http api here: https://github.com/langchain-ai/langsmith-cookbook/blob/main/tracing-examples/rest/rest.ipynb - metadata = kwargs.get('litellm_params', {}).get("metadata", {}) - if metadata is None: - metadata = {} + metadata = kwargs.get('litellm_params', {}).get("metadata", {}) or {} # if metadata is None # set project name and run_name for langsmith logging # users can pass project_name and run name to litellm.completion()