Spaces:
Sleeping
Sleeping
| """System health check page""" | |
| import streamlit as st | |
| from components import render_sidebar | |
| from utils import client | |
| st.set_page_config(page_title="Health Check", page_icon="π₯") | |
| render_sidebar() | |
| st.title("π₯ System Health Check") | |
| if st.button("π Check Backend Status", use_container_width=True): | |
| with st.spinner("Checking..."): | |
| health = client.health_check() | |
| if health.get("status") == "healthy": | |
| st.success("β Backend is running and healthy!") | |
| # Display details | |
| col1, col2 = st.columns(2) | |
| with col1: | |
| st.metric("Status", health.get("status", "unknown")) | |
| st.metric("Service", health.get("service", "unknown")) | |
| with col2: | |
| st.metric("LLM Model", health.get("llm_model", "unknown")) | |
| st.metric("Environment", health.get("environment", "unknown")) | |
| st.divider() | |
| # Display full response | |
| st.subheader("π Full Response") | |
| st.json(health) | |
| else: | |
| st.error("β Backend is not responding or unhealthy") | |
| if "detail" in health: | |
| st.error(f"Details: {health['detail']}") | |