support templates

This commit is contained in:
Vince Loewe 2024-02-28 22:18:39 -08:00
parent 4e74582b6f
commit 40eebc6bea
4 changed files with 368 additions and 9 deletions

View file

@ -98,9 +98,12 @@ class LunaryLogger:
)
tags = litellm_params.pop("tags", None) or []
template_id = litellm_params.pop("templateId", None)
print(litellm_params)
print(template_id)
if extra:
template_id = extra.pop("templateId", None)
extra.pop("extra_body", None)
extra.pop("user", None)
@ -119,8 +122,6 @@ class LunaryLogger:
except:
pass
if response_obj:
usage = (
parse_usage(response_obj["usage"])
@ -130,7 +131,6 @@ class LunaryLogger:
output = response_obj["choices"] if "choices" in response_obj else None
print(output)
else:
usage = None
output = None
@ -140,8 +140,6 @@ class LunaryLogger:
else:
error_obj = None
self.lunary_client.track_event(
type,
"start",