Refactor UI state management (#1191)

* Added logs at generation of the UI, and generate the UI in an object
* Make ingest script more verbose in case of an error at ingestion time
* Removed the explicit state in the UI containing ingested files
* Make script of ingestion a bit more verbose by displaying stack traces
* Change the browser tab title of privateGPT ui to `My Private GPT`
This commit is contained in:
lopagela 2023-11-10 10:42:43 +01:00 committed by GitHub
parent 55e626eac7
commit a666fd5b73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 170 additions and 137 deletions

View file

@ -1,4 +1,5 @@
"""FastAPI app creation, logger configuration and main API routes."""
import logging
from typing import Any
import llama_index
@ -14,6 +15,8 @@ from private_gpt.server.health.health_router import health_router
from private_gpt.server.ingest.ingest_router import ingest_router
from private_gpt.settings.settings import settings
logger = logging.getLogger(__name__)
# Add LlamaIndex simple observability
llama_index.set_global_handler("simple")
@ -103,6 +106,7 @@ app.include_router(health_router)
if settings.ui.enabled:
from private_gpt.ui.ui import mount_in_app
logger.debug("Importing the UI module")
from private_gpt.ui.ui import PrivateGptUi
mount_in_app(app)
PrivateGptUi().mount_in_app(app)