Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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():
|