mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
raise error when langfuse not installed
This commit is contained in:
parent
ac2d89aee6
commit
73ad1bf6ed
1 changed files with 4 additions and 1 deletions
|
@ -11,7 +11,10 @@ import traceback
|
|||
class LangFuseLogger:
|
||||
# Class variables or attributes
|
||||
def __init__(self):
|
||||
from langfuse import Langfuse
|
||||
try:
|
||||
from langfuse import Langfuse
|
||||
except:
|
||||
raise Exception("\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error\033[0m")
|
||||
# Instance variables
|
||||
self.secret_key = os.getenv("LANGFUSE_SECRET_KEY")
|
||||
self.public_key = os.getenv("LANGFUSE_PUBLIC_KEY")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue