only use langchain if env vars are set
This commit is contained in:
@@ -15,12 +15,14 @@ from tools.base_tool import ToolContext, set_tool_context
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||||
)
|
)
|
||||||
logging.getLogger('watchfiles').setLevel(logging.WARNING)
|
logging.getLogger('watchfiles').setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
if all(var in os.environ for var in ['LANGFUSE_PUBLIC_KEY', 'LANGFUSE_SECRET_KEY', 'LANGFUSE_HOST']):
|
||||||
langfuse = get_client()
|
langfuse = get_client()
|
||||||
|
|
||||||
if langfuse.auth_check():
|
if langfuse.auth_check():
|
||||||
|
|||||||
Reference in New Issue
Block a user