feat - log base_url to langfuse as a tag

This commit is contained in:
Ishaan Jaff 2024-04-19 15:48:00 -07:00
parent 5b31a5c754
commit a1e2a2e540

View file

@ -300,6 +300,11 @@ class LangFuseLogger:
else: else:
clean_metadata[key] = value clean_metadata[key] = value
# if user has set proxy_base_url in env -> log to langfuse as a tag
proxy_base_url = os.getenv("PROXY_BASE_URL", None)
if proxy_base_url is not None:
tags.append(f"proxy_base_url:{proxy_base_url}")
api_base = litellm_params.get("api_base", None) api_base = litellm_params.get("api_base", None)
if api_base: if api_base:
clean_metadata["api_base"] = api_base clean_metadata["api_base"] = api_base