From 9d6a8b5de318f458cf2f816d5e7d8440335ed6a9 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 82fe4be0aa1..4c76ba80b38 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()