Przeglądaj źródła

fix: backslash rag content issue

Timothy J. Baek 1 rok temu
rodzic
commit
072b499a50
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      backend/apps/rag/utils.py

+ 2 - 3
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