only use langchain if env vars are set

This commit is contained in:
2025-09-22 12:59:44 +02:00
parent 8d3f791966
commit 6b060f9865

View File

@@ -15,20 +15,22 @@ from tools.base_tool import ToolContext, set_tool_context
load_dotenv()
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logging.getLogger('watchfiles').setLevel(logging.WARNING)
langfuse = get_client()
if all(var in os.environ for var in ['LANGFUSE_PUBLIC_KEY', 'LANGFUSE_SECRET_KEY', 'LANGFUSE_HOST']):
langfuse = get_client()
if langfuse.auth_check():
print("Langfuse client is authenticated and ready!")
else:
print("Authentication failed. Please check your credentials and host.")
if langfuse.auth_check():
print("Langfuse client is authenticated and ready!")
else:
print("Authentication failed. Please check your credentials and host.")
Agent.instrument_all()
Agent.instrument_all()
app.add_static_files('/static', 'src/static')