From 072b499a50a8ec2387b5215e27afb3b3fe3b8123 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 15 Mar 2024 13:34:52 -0700 Subject: [PATCH] fix: backslash rag content issue --- backend/apps/rag/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/apps/rag/utils.py b/backend/apps/rag/utils.py index b2da7d90c..a3537d4d3 100644 --- a/backend/apps/rag/utils.py +++ b/backend/apps/rag/utils.py @@ -91,9 +91,8 @@ def query_collection( def rag_template(template: str, context: str, query: str): - template = re.sub(r"\[context\]", context, template) - template = re.sub(r"\[query\]", query, template) - + template = template.replace("[context]", context) + template = template.replace("[query]", query) return template