Extract_keywords_system_prompt= "You are a linguistics expert specializing in English literature."

Extract_keywords_user_prompt = """You are a linguistics expert specializing in English literature. Given a text, identify its keywords. Please output all the important keywords. Do not output anything else.

Text: {text}

Output:
1."""

paragraph_split_system_prompt = "You are a linguistics expert specializing in English literature."

paragraph_split_user_prompt = """You are given a text. Your task is to reformat it into a few paragraphs only if the content would benefit from clearer paragraph structure. Do not remove, rewrite, or alter any words. If the text is already clearly structured, leave it unchanged.
Output only the reformatted text, with no explanations or extra comments.

Text:
{text}
Output: """

question_refine_system_prompt = "You are a AI assistant."

question_refine_prompt = """
You are given:
- Original question
- Short answer: A portion of the long-form answer that directly responds to the original question.
- Long-form answer: A more detailed response that includes both the short answer and additional relevant information.

Your task is to expand and improve the original question so that it better reflects the full scope of the long-form answer. Focus on incorporating aspects of the long-form answer that would be missing or unexpected if someone had only seen the original question and short answer. Only output the refined question.

Original Question: {question}

Short answer: {short_answer}

Long-form answer: {answer}

Refined question: """

extract_short_answer_user_prompt ="""You are given a question and a corresponding long-form answer. Your task is to extract the short, direct answer if it is explicitly present in the long-form response. The direct answer should be concise, without including additional explanation or context.
If the question asks for a reason, explanation, description, or opinion, and the provided answer consists only of that explanatory content without a clearly extractable short answer, please output: [No direct answer]
Do not rewrite or summarize the long answer. Only extract the direct answer if it exists. Be strict in identifying clear direct answers.

Example 1:
Question: What is the boiling point of water at sea level in Celsius?
Answer: The boiling point of water at sea level is 100 degrees Celsius. This is the temperature at which water transitions from a liquid to a gaseous state under normal atmospheric pressure.
Output: 100 degrees Celsius

Example 2:
Question: Can you explain the process of mitosis?
Answer: Mitosis is a type of cell division that results in two daughter cells each having the same number and kind of chromosomes as the parent nucleus. The process consists of several stages including prophase, metaphase, anaphase, and telophase. It is essential for growth and tissue repair in multicellular organisms.
Output: [No direct answer]

Now complete the task below:
Question: {question}
Answer: {answer}
Output: """

extract_short_answer_user_prompt_2 ="""You are an extraction assistant.
Task: Given a question and a long-form answer, output one clear, complete sentence that directly answers the question and output that sentence only (no labels, no extra text).
The sentence must stand alone (begin with a capital letter and end with a period).
Do not repeat the question or add commentary.
If the answer is uncertain or absent, output “[No direct answer]”.

Example 1
Question: When was Tallahassee chosen to be the capital of Florida?
Long-form answer: Tallahassee, Florida, /ˌtæləˈhæsi/, is the capital of the U.S. state of Florida. It became the capital of Florida, then the Florida Territory, in 1824. In 2016, the population was 190,894.
Answer: Tallahassee became the capital of the Florida Territory in 1824.

Example 2
Question: Who discovered penicillin?
Long-form answer: Penicillin was first observed by Scottish bacteriologist Alexander Fleming in 1928 while he was working at St Mary’s Hospital in London. Although other scientists later helped purify and mass-produce it, Fleming’s accidental discovery marked the birth of modern antibiotics.
Answer: Alexander Fleming discovered penicillin in 1928.

Example 3
Question: On what date did Apollo 11 land on the Moon?
Long-form answer: Apollo 11 was the first crewed mission to land on the Moon. The Lunar Module Eagle touched down in the Sea of Tranquility at 20:17 UTC on July 20 1969, carrying astronauts Neil Armstrong and Edwin “Buzz” Aldrin.
Answer: Apollo 11 landed on the Moon on July 20 1969.

Example 4 (negative)
Question: What is the capital city of Atlantis?
Long-form answer: Atlantis is a mythical island mentioned within an allegory on the hubris of nations in Plato’s works; its existence has never been proven and no modern state claims it.
Answer: [No direct answer]

Question: {question}
Long-form answer: {answer}
Answer: """