only use langchain if env vars are set
This commit is contained in:
10
src/main.py
10
src/main.py
@@ -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():
|
||||
if langfuse.auth_check():
|
||||
print("Langfuse client is authenticated and ready!")
|
||||
else:
|
||||
else:
|
||||
print("Authentication failed. Please check your credentials and host.")
|
||||
|
||||
Agent.instrument_all()
|
||||
Agent.instrument_all()
|
||||
|
||||
app.add_static_files('/static', 'src/static')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user