isayahc commited on
Commit
7aec130
·
unverified ·
1 Parent(s): f71d212

made a query rewritting chain

Browse files
rag_app/chains/__init__.py CHANGED
@@ -1 +1,2 @@
1
- from rag_app.chains.user_response_sentiment_chain import user_response_sentiment_prompt
 
 
1
+ from rag_app.chains.user_response_sentiment_chain import user_response_sentiment_prompt
2
+ from rag_app.chains.query_rewritten_chain import query_rewritting_prompt
rag_app/chains/query_rewritten_chain.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain_core.prompts import PromptTemplate
2
+
3
+
4
+ query_rewritting_template = """
5
+ You will be given a query from a user
6
+ =================
7
+ {user_query}
8
+ ====================
9
+
10
+ You must improve the query to optimize the result
11
+
12
+
13
+ """
14
+
15
+ query_rewritting_prompt = PromptTemplate.from_template(query_rewritting_template)
16
+