mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Fix default config initialization for for chat.html
This commit is contained in:
@@ -3,12 +3,11 @@ from fastapi import APIRouter
|
|||||||
from fastapi import Request
|
from fastapi import Request
|
||||||
from fastapi.responses import HTMLResponse, FileResponse
|
from fastapi.responses import HTMLResponse, FileResponse
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from khoj.utils.rawconfig import TextContentConfig, ConversationProcessorConfig
|
from khoj.utils.rawconfig import TextContentConfig, ConversationProcessorConfig, FullConfig
|
||||||
|
|
||||||
# Internal Packages
|
# Internal Packages
|
||||||
from khoj.utils import constants, state
|
from khoj.utils import constants, state
|
||||||
|
|
||||||
import logging
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +33,12 @@ if not state.demo:
|
|||||||
|
|
||||||
@web_client.get("/config", response_class=HTMLResponse)
|
@web_client.get("/config", response_class=HTMLResponse)
|
||||||
def config_page(request: Request):
|
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})
|
return templates.TemplateResponse("config.html", context={"request": request, "current_config": current_config})
|
||||||
|
|
||||||
@web_client.get("/config/content_type/github", response_class=HTMLResponse)
|
@web_client.get("/config/content_type/github", response_class=HTMLResponse)
|
||||||
|
|||||||
Reference in New Issue
Block a user