From bf8914d0c8911e73a5c776b71afdf0df1760197e Mon Sep 17 00:00:00 2001 From: sabaimran Date: Mon, 3 Jul 2023 00:00:47 -0700 Subject: [PATCH] Fix default config initialization for for chat.html --- src/khoj/routers/web_client.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/khoj/routers/web_client.py b/src/khoj/routers/web_client.py index 72070fb0..8fb8324a 100644 --- a/src/khoj/routers/web_client.py +++ b/src/khoj/routers/web_client.py @@ -3,12 +3,11 @@ from fastapi import APIRouter from fastapi import Request from fastapi.responses import HTMLResponse, FileResponse from fastapi.templating import Jinja2Templates -from khoj.utils.rawconfig import TextContentConfig, ConversationProcessorConfig +from khoj.utils.rawconfig import TextContentConfig, ConversationProcessorConfig, FullConfig # Internal Packages from khoj.utils import constants, state -import logging import json @@ -34,7 +33,12 @@ if not state.demo: @web_client.get("/config", response_class=HTMLResponse) def config_page(request: Request): - current_config = state.config if state.config else constants.default_config + default_full_config = FullConfig( + content_type=None, + search_type=None, + processor=None, + ) + current_config = state.config if state.config else json.loads(default_full_config.json()) return templates.TemplateResponse("config.html", context={"request": request, "current_config": current_config}) @web_client.get("/config/content_type/github", response_class=HTMLResponse)