Spaces:
Sleeping
Sleeping
Download multi_llm_chatbot_backend/app/api/routes/root.py from BrainForge/LaunchPadAI: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/BrainForge/LaunchPadAI/resolve/main/multi_llm_chatbot_backend/app/api/routes/root.py
- Command line
-
hf download hf://spaces/BrainForge/LaunchPadAI/multi_llm_chatbot_backend/app/api/routes/root.py
-
curl -L -o root.py https://huggingface.co/spaces/BrainForge/LaunchPadAI/resolve/main/multi_llm_chatbot_backend/app/api/routes/root.py
1.25 kB
| from fastapi import APIRouter | |
| from app.config import get_settings | |
| from app.core.secrets import normalize_secret | |
| from app.version import __version__ | |
| import logging | |
| import os | |
| logger = logging.getLogger(__name__) | |
| router = APIRouter() | |
| # NB: keep this OFF the bare "/" path. In the single-container / Hugging Face | |
| # Spaces deployment the React SPA is mounted at "/" as a catch-all, and any | |
| # API route registered at exactly "/" would shadow the SPA's index.html and | |
| # leave users staring at this JSON banner instead of the app. | |
| def root(): | |
| settings = get_settings() | |
| title = settings.app.title | |
| openai_key_configured = bool( | |
| normalize_secret(settings.llm.openai.api_key) | |
| or normalize_secret(os.getenv("OPENAI_API_KEY", "")) | |
| ) | |
| return { | |
| "message": f"{title} Backend is up and running", | |
| "version": __version__, | |
| "llm_provider": settings.llm.provider, | |
| "openai_api_key_configured": openai_key_configured, | |
| "features": [ | |
| "Configurable Personas", | |
| "Improved Session Management", | |
| "Unified Context Handling", | |
| "Ollama Support", | |
| "Gemini API Support", | |
| "Provider Switching" | |
| ] | |
| } | |