mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Fix default config initialization for for chat.html
This commit is contained in:
parent
fa218ff5aa
commit
bf8914d0c8
1 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue