From 07b451995e8e98a5c0e7b89178d870c033016282 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 17 Feb 2024 22:49:18 -0800 Subject: [PATCH] feat: reset rag template --- backend/apps/rag/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/apps/rag/main.py b/backend/apps/rag/main.py index fbfba258..6d06456f 100644 --- a/backend/apps/rag/main.py +++ b/backend/apps/rag/main.py @@ -172,7 +172,9 @@ class RAGTemplateForm(BaseModel): @app.post("/template/update") async def update_rag_template(form_data: RAGTemplateForm, user=Depends(get_admin_user)): # TODO: check template requirements - app.state.RAG_TEMPLATE = form_data.template + app.state.RAG_TEMPLATE = ( + form_data.template if form_data.template != "" else RAG_TEMPLATE + ) return {"status": True, "template": app.state.RAG_TEMPLATE}