INNER CODE UNIT · Python
load_index
pathwaycom/llm-app · serviette/frontend/main.py:33
def load_index(title: str) -> str:
"""Return the chat page HTML with the configured title substituted.
Shared with the server's embedded-UI mode, so both serve one page.
"""
return _INDEX_FILE.read_text(encoding="utf-8").replace("__APP_TITLE__", title)
def create_app(config: ServietteConfig, *, client: httpx.AsyncClient | None = None) -> FastAPI:
"""Build the frontend app.
``client`` can be injected (tests provide an httpx client backed by a mock
transport); otherwise one is created against ``frontend.api_url``.
"""
config.for_frontend()
fe = config.frontend