fix(utils.py): better exception raising if logging object is not able to get set

This commit is contained in:
Krrish Dholakia 2023-11-06 06:34:16 -08:00
parent 2014e69e99
commit c55db28b6f
3 changed files with 34 additions and 19 deletions

View file

@ -14,7 +14,7 @@ class LangFuseLogger:
try:
from langfuse import Langfuse
except Exception as e:
raise Exception("\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error\033[0m", e)
raise Exception(f"\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error: {e}\033[0m")
# Instance variables
self.secret_key = os.getenv("LANGFUSE_SECRET_KEY")
self.public_key = os.getenv("LANGFUSE_PUBLIC_KEY")