Shreyas094 commited on
Commit
6c0a344
1 Parent(s): cd540fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -401,11 +401,13 @@ def get_response_from_gemini(query, model, selected_docs, file_type, num_calls=1
401
  relevant_docs = retriever.get_relevant_documents(query)
402
 
403
  context_str = "\n".join([doc.page_content for doc in relevant_docs])
404
-
405
- system_instruction = """You are a highly specialized document analyst with expertise in extracting information from PDF documents.
406
- Your task is to analyze the provided PDF content and answer the user's query accurately and comprehensively.
407
- Focus on key points, important details, and relevant information from the document.
408
- Ensure your response is strictly based on the provided context."""
 
 
409
 
410
  full_prompt = f"{system_instruction}\n\nContext:\n{context_str}\n\nUser query: {query}\n\nPlease generate a step-by-step reasoning before arriving at a comprehensive and accurate summary addressing the question. Ensure your response is strictly based on the provided context, highlighting key metrics, trends, and significant details relevant to the query. Avoid any speculative or unverified information."
411
 
 
401
  relevant_docs = retriever.get_relevant_documents(query)
402
 
403
  context_str = "\n".join([doc.page_content for doc in relevant_docs])
404
+
405
+ system_instruction = """You are a highly specialized financial analyst assistant with expertise in analyzing and summarizing financial documents.
406
+ Your goal is to provide accurate, detailed, and precise summaries based on the context provided.
407
+ Avoid making assumptions or adding information that is not explicitly supported by the context from the PDF documents.
408
+ Using the following context from the PDF documents:\n{context_str}\n\nPlease generate a step-by-step reasoning before arriving at a comprehensive and accurate summary addressing the following question: '{query}'.
409
+ Ensure your response is strictly based on the provided context, highlighting key financial metrics, trends, and significant details relevant to the query.
410
+ Avoid any speculative or unverified information."""
411
 
412
  full_prompt = f"{system_instruction}\n\nContext:\n{context_str}\n\nUser query: {query}\n\nPlease generate a step-by-step reasoning before arriving at a comprehensive and accurate summary addressing the question. Ensure your response is strictly based on the provided context, highlighting key metrics, trends, and significant details relevant to the query. Avoid any speculative or unverified information."
413