jeremierostan commited on
Commit
53a1615
·
verified ·
1 Parent(s): 62e175f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -54,7 +54,7 @@ def preprocess_query(query):
54
  # Function to create RAG chain with Groq
55
  def create_rag_chain(vector_store):
56
  prompt = ChatPromptTemplate.from_messages([
57
- ("system", "You are an AI assistant helping with data protection and regulation compliance related queries. Use the following context to answer the user's question:\n\n{context}"),
58
  ("human", "{input}")
59
  ])
60
  document_chain = create_stuff_documents_chain(groq_client, prompt)
@@ -63,7 +63,7 @@ def create_rag_chain(vector_store):
63
  # Function for Gemini response with long context
64
  def gemini_response(query, full_pdf_content):
65
  prompt = ChatPromptTemplate.from_messages([
66
- ("system", "You are an AI assistant helping with data protection and regulation compliance related queries.. Use the following full content of official regulation documents to answer the user's question:\n\n{context}"),
67
  ("human", "{input}")
68
  ])
69
  chain = prompt | gemini_client
@@ -78,7 +78,7 @@ def generate_final_response(query, response1, response2):
78
  2. Think of a comprehensive answer that combines the strengths of both responses.
79
  3. If the responses contradict each other, highlight this and if it might indicate a hallucination.
80
  [Output]
81
- 4. Provide practical advice on how to meet regulatory requirements in the context of the user question based on the information given.
82
 
83
  User Query: {query}
84
 
 
54
  # Function to create RAG chain with Groq
55
  def create_rag_chain(vector_store):
56
  prompt = ChatPromptTemplate.from_messages([
57
+ ("system", "You are an AI assistant helping with data protection and regulation compliance related queries. Use the following passages of official regulation documents to provide practical advice on how to meet regulatory requirements in the context of the user question:\n\n{context}"),
58
  ("human", "{input}")
59
  ])
60
  document_chain = create_stuff_documents_chain(groq_client, prompt)
 
63
  # Function for Gemini response with long context
64
  def gemini_response(query, full_pdf_content):
65
  prompt = ChatPromptTemplate.from_messages([
66
+ ("system", "You are an AI assistant helping with data protection and regulation compliance related queries. Use the following full content of official regulation documents to provide practical advice on how to meet regulatory requirements in the context of the user question:\n\n{context}"),
67
  ("human", "{input}")
68
  ])
69
  chain = prompt | gemini_client
 
78
  2. Think of a comprehensive answer that combines the strengths of both responses.
79
  3. If the responses contradict each other, highlight this and if it might indicate a hallucination.
80
  [Output]
81
+ 4. Provide practical advice on how to meet regulatory requirements in the context of the user question based on Steps 1, 2, and 3.
82
 
83
  User Query: {query}
84