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