From e794a9d5707ff0a0c2729009207e5b4bda2d4c66 Mon Sep 17 00:00:00 2001 From: Vince Loewe Date: Wed, 28 Feb 2024 23:10:06 -0800 Subject: [PATCH] fix template tracking --- litellm/integrations/lunary.py | 13 +++---------- litellm/main.py | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/litellm/integrations/lunary.py b/litellm/integrations/lunary.py index 7fb0cca3c81..2a018658cee 100644 --- a/litellm/integrations/lunary.py +++ b/litellm/integrations/lunary.py @@ -98,14 +98,14 @@ class LunaryLogger: ) tags = litellm_params.pop("tags", None) or [] - template_id = litellm_params.pop("templateId", None) - print(litellm_params) - print(template_id) + + if extra: extra.pop("extra_body", None) extra.pop("user", None) + template_id = extra.pop("extra_headers", {}).get("Template-Id", None) # keep only serializable types for param, value in extra.items(): @@ -115,13 +115,6 @@ class LunaryLogger: except: pass - for param, value in metadata.items(): - if not isinstance(value, (str, int, bool, float)): - try: - extra[param] = str(value) - except: - pass - if response_obj: usage = ( parse_usage(response_obj["usage"]) diff --git a/litellm/main.py b/litellm/main.py index e0e70d5f726..cd2ecb0731e 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -557,7 +557,6 @@ def completion( "output_cost_per_second", "hf_model_name", "model_info", - "templateId", "proxy_server_request", "preset_cache_key", "caching_groups",