realambuj's picture
Upload 6 files
1ffc5c5 verified
raw
history blame
No virus
3.81 kB
# updated gemini prompts , for initial prompts use the ipynb file
# use Gemini-PRO Model
def getMcqQAPrompt():
prompt = """
Imagine leading a stimulating debate among renowned experts based on the following text:
{context}
To spark insightful discussion, design {numPairs} challenging multiple-choice questions, each with four plausible yet distinct options. Only one will be the accurate answer, revealed alongside the shuffled options as a bonus point for the sharpest minds!
Craft your questions thoughtfully, employing a variety of types (factual recall, inferential reasoning, critical analysis) to test the depth and agility of the experts' understanding. Remember, the more nuanced and insightful your questions, the richer and more engaging the intellectual exchange will become.
Then output only a json array that would describe each question and answer it will have in this format. Generate a valid json array.
Please include each and every Question Answer Pair in the context.
{{
"question": <string>,
"answer": <string>,
"options" : [string],
"correct_option_index" : <number>,
}}
Never output the instructions given for output.
Not include ```json in output , only give output as array.
"""
return prompt
def getLongQAPrompt():
prompt = """
Carefully read and comprehend the following paragraph:
{context}
Now, create {numPairs} thought-provoking questions that delve into the key points, details, and implications of the paragraph. Provide concise and informative answers to each question, ensuring factual accuracy and clarity.
Strive to generate a diverse range of question types (who, what, when, where, why, how) to explore various aspects of the text. Prioritize questions that encourage deeper understanding and critical thinking.
Then output only a json array that would describe each question and answer it will have in this format. Generate a valid json array.
Please include each and every Question Answer Pair in the context.
{{
"question": <string>,
"answer": <string>
}}
Never output the instructions given for output.
Not include ```json in output , only give output as array.
"""
return prompt
def getShortQAPrompt():
prompt = """
Carefully read and comprehend the following paragraph:
{context}
Now, craft {numPairs} intriguing questions that pierce through the heart of the paragraph, demanding concise answers. Aim for single-word or two-word responses that capture the essence.
Diversify your question types (who, what, when, where, why, how) to illuminate various facets of the text. Prioritize questions that spark reflection and ignite critical thinking.
Then output only a json array that would describe each question and answer it will have in this format. Generate a valid json array.
Please include each and every Question Answer Pair in the context.
{{
"question": <string>,
"answer": <string>
}}
Never output the instructions given for output.
Not include ```json in output , only give output as array.
Remember, brevity is key! One or two words should suffice to convey the point.
"""
return prompt
def getRagChainPrompt():
prompt = """
Answer the question as detailed as possible from the provided context, make sure to provide all the details, if the answer is not in
provided context just say, "Answer is not available in the given Context", don't provide the wrong answer\n\n
Context:\n {context}?\n
Question: \n{question}\n
Answer: __answer__
Always return response in JSON format
Response should not contain ***
"""
return prompt