hmgill commited on
Commit
2f8f161
Β·
verified Β·
1 Parent(s): 1bee7b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -14,9 +14,15 @@ from utils.prechecks import check_hf_persistent_storage
14
 
15
  def setup_observability():
16
  """Initializes Langfuse and Smolagents instrumentation."""
17
- get_client()
18
- SmolagentsInstrumentor().instrument()
19
- print("βœ“ Observability and instrumentation initialized.")
 
 
 
 
 
 
20
 
21
 
22
  def initialize_app():
 
14
 
15
  def setup_observability():
16
  """Initializes Langfuse and Smolagents instrumentation."""
17
+ try:
18
+ if os.getenv("LANGFUSE_PUBLIC_KEY") and os.getenv("LANGFUSE_SECRET_KEY"):
19
+ get_client()
20
+ SmolagentsInstrumentor().instrument()
21
+ print("βœ“ Observability and instrumentation initialized.")
22
+ else:
23
+ print("⚠️ Langfuse keys not found. Observability disabled.")
24
+ except Exception as e:
25
+ print(f"⚠️ Could not initialize observability: {e}")
26
 
27
 
28
  def initialize_app():