mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +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 LangFuseLogger:
|
||||||
# Class variables or attributes
|
# Class variables or attributes
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
try:
|
||||||
from langfuse import Langfuse
|
from langfuse import Langfuse
|
||||||
|
except:
|
||||||
|
raise Exception("\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error\033[0m")
|
||||||
# Instance variables
|
# Instance variables
|
||||||
self.secret_key = os.getenv("LANGFUSE_SECRET_KEY")
|
self.secret_key = os.getenv("LANGFUSE_SECRET_KEY")
|
||||||
self.public_key = os.getenv("LANGFUSE_PUBLIC_KEY")
|
self.public_key = os.getenv("LANGFUSE_PUBLIC_KEY")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue