# extract_relation_prompt = """Please retrieve %s relations (separated by semicolon) that contribute to the question and rate their contribution on a scale from 0 to 1 (the sum of the scores of %s relations is 1).
# Q: Name the president of the country whose main spoken language was Brahui in 1980?
# Topic Entity: Brahui Language
# Relations: language.human_language.main_country; language.human_language.language_family; language.human_language.iso_639_3_code; base.rosetta.languoid.parent; language.human_language.writing_system; base.rosetta.languoid.languoid_class; language.human_language.countries_spoken_in; kg.object_profile.prominent_type; base.rosetta.languoid.document; base.ontologies.ontology_instance.equivalent_instances; base.rosetta.languoid.local_name; language.human_language.region
# A: 1. {language.human_language.main_country (Score: 0.4))}: This relation is highly relevant as it directly relates to the country whose president is being asked for, and the main country where Brahui language is spoken in 1980.
# 2. {language.human_language.countries_spoken_in (Score: 0.3)}: This relation is also relevant as it provides information on the countries where Brahui language is spoken, which could help narrow down the search for the president.
# 3. {base.rosetta.languoid.parent (Score: 0.2)}: This relation is less relevant but still provides some context on the language family to which Brahui belongs, which could be useful in understanding the linguistic and cultural background of the country in question.
#
# Q: """

query_reason_prompt1 = """Please analyze and think about the problem from different angles, give different instructions perspectives in concise language, and tell me what information should be unearthed to more effectively answer the question step by step. Provide the one to three most important instructions perspectives.
Example1:
###Input:
Question: Which country is the Forbidden City in?
###Output:
instruction1: This is a simple question. Just search for the country the Forbidden City belongs to.

Example2:
###Input:
Question: What is the majority party in the country where Canberra is located now?
###Output:
instruction1: You could first search for the country where Canberra is located, then search for the majority party of that country.
instruction2: The governing party of a country might be the majority party, so you could first search for the country where Canberra is located, then search for the governing party of that country.
instruction3: The party to which a country's president belongs might be the majority party, so you could first search for the country where Canberra is located, then search for the party of the president of that country.

Strictly refer to the above example output results.
###Input:
Question: {}
###Output:"""
query_reason_prompt = """Analyze the question from shallow to deep, give different instructions perspectives in concise language, and tell me what information should be unearthed to more effectively answer the question step by step. Provide the one to three most important instructions perspectives.
Example1:
###Input:
Question: Which country is the Forbidden City in?
###Output:
instruction1: Just search for the country the Forbidden City belongs to.

Example2:
###Input:
Question: What is the majority party in the country where Canberra is located now?
###Output:
instruction1: You could first search for the country where Canberra is located, then search for the majority party of that country.
instruction2: The governing party of a country might be the majority party, so you could first search for the country where Canberra is located, then search for the governing party of that country.
instruction3: The party to which a country's president belongs might be the majority party, so you could first search for the country where Canberra is located, then search for the party of the president of that country.

Strictly refer to the above example output results.
###Input:
Question: {}
###Output:"""

reason_score_prompt = """Please score my instructions based on how much it contributes to answering the question (the sum of the scores is 1)
Example:
### input:
Question: What is the majority party in the country where Canberra is located now?
instruction1: The governing party of a country might be the majority party, so you could first search for the country where Canberra is located, then search for the governing party of that country.
instruction2: The party to which a country's president belongs might be the majority party, so you could first search for the country where Canberra is located, then search for the party of the president of that country.
instruction3: The House of Representatives of a country is often governed by the majority party, so you could first search for the country where Canberra is located, then search for the governing information of the House of Representatives of that country.
### output:
instruction1: (0.4)This is a strong instruction because finding the governing party is often indicative of the majority party. However, it assumes that the governing party is always the majority party, which may not always be the case due to coalition governments or other political arrangements.
instruction2: (0.3)This is also a good instruction because the leader of a country (prime minister or president) often belongs to the majority party. However, it may not always be the case, especially in countries where the head of state is a ceremonial role and the head of government is a different position.
instruction3: (0.3)This instruction is also relevant as the majority party often controls the lower house of a country’s legislature. However, it is less direct than the first instruction because you would still need to determine which party controls the House of Representatives, which might require additional steps.

Strictly refer to the above example output results.
### input:
Question: {}
{}
### output:
 """

# query_reason_prompt = """From different angles, analyze and think about the problem, give different reasoning perspectives in concise language, and tell me which information should be explored to answer the question more effectively. Provide 1-2 of the most important reasoning perspectives.
# Example:
# Question: Which political party is the majority party in Australia now?
# Reasoning 1: Australia's ruling party may be the majority party, so you can to search for Australia's ruling party.
# Reasoning 2: The party to which the president of Australia belongs may be the majority party, so you can to search for the party to which the president of the country belongs.
#
# Strictly refer to the above example output results.
# Question: {}"""
extract_relation_prompt = """Please retrieve %s relations (separated by semicolon) that contribute to the question and rate their contribution on a scale from 0 to 1 (the sum of the scores of %s relations is 1).
###input:
Q: Name the president of the country whose main spoken language was Brahui in 1980?
Topic Entity: Brahui Language
Relations: language.human_language.main_country; language.human_language.language_family; language.human_language.iso_639_3_code; base.rosetta.languoid.parent; language.human_language.writing_system; base.rosetta.languoid.languoid_class; language.human_language.countries_spoken_in; kg.object_profile.prominent_type; base.rosetta.languoid.document; base.ontologies.ontology_instance.equivalent_instances; base.rosetta.languoid.local_name; language.human_language.region
###output:
A: 1. {language.human_language.main_country (Score: 0.4))}: This relation is highly relevant as it directly relates to the country whose president is being asked for, and the main country where Brahui language is spoken in 1980.
2. {language.human_language.countries_spoken_in (Score: 0.3)}: This relation is also relevant as it provides information on the countries where Brahui language is spoken, which could help narrow down the search for the president.
3. {base.rosetta.languoid.parent (Score: 0.2)}: This relation is less relevant but still provides some context on the language family to which Brahui belongs, which could be useful in understanding the linguistic and cultural background of the country in question.

Strictly refer to the above example output results.
###input:
Q: """

score_entity_candidates_prompt = """Please score the entities' contribution to the question on a scale from 0 to 1 (the sum of the scores of all entities is 1).
###input:
Q: The movie featured Miley Cyrus and was produced by Tobin Armbrust?
Relation: film.producer.film
Entites: The Resident; So Undercover; Let Me In; Begin Again; The Quiet Ones; A Walk Among the Tombstones
###output:
Score: 0.0, 1.0, 0.0, 0.0, 0.0, 0.0
The movie that matches the given criteria is "So Undercover" with Miley Cyrus and produced by Tobin Armbrust. Therefore, the score for "So Undercover" would be 1, and the scores for all other entities would be 0.

Strictly refer to the above example output results.
###input:
Q: {}
Relation: {}
Entites: {}"""

reason_summary_prompt = """
"""
extract_relation_prompt_reason = """Please pick the %s relations (separated by semicolons) that contribute most to the problem from the relations I provide, and rate their contribution on a scale of 0 to 1 (the sum of the scores of %s relations is 1).You can refer to the instructions if you think they are helpful.

Example:
###input:
Q: Name the president of the country whose main spoken language was Brahui in 1980?
instruction: You could first find the countries where Brahui was the main language in 1980, and then find the president of this country.
Topic Entity: Brahui Language
Relations: language.human_language.main_country; language.human_language.language_family; language.human_language.iso_639_3_code; base.rosetta.languoid.parent; language.human_language.writing_system; base.rosetta.languoid.languoid_class; language.human_language.countries_spoken_in; kg.object_profile.prominent_type; base.rosetta.languoid.document; base.ontologies.ontology_instance.equivalent_instances; base.rosetta.languoid.local_name; language.human_language.region
###output
A: 1. {language.human_language.main_country (Score: 0.4))}: This relation is crucial as it directly connects the main spoken language to the country where it is predominantly spoken. It helps in identifying the president of the country associated with the Brahui language.
2. {language.human_language.countries_spoken_in (Score: 0.3)}: Understanding the countries where the language is spoken can provide insights into the geopolitical context necessary to determine the president of the relevant country.
3. {kg.object_profile.prominent_type (Score: 0.2)}: Exploring the language family to which Brahui belongs can provide historical and cultural context that might be relevant to identifying the president of the country in 1980. 

###input
Q: """

score_entity_candidates_prompt_reason = """Please refer to the instruction provided about the problem(If you think it helps you score the entity, otherwise ignore it), score the entities' contribution to the question on a scale from 0 to 1 (the sum of the scores of all entities is 1).

### input:
Q: what did pamela courson die from?
instruction:Pamela Courson's cause of death may be documented in official records such as a death certificate or autopsy report, so it is essential to search for these official documents to determine the exact cause of her death.
Relation: people.deceased_person.cause_of_death
Entites: Drug overdose; Heroin overdose; UnName_Entity
Score:

### output:
Score: 0.5, 0.5, 0.0
"Drug Overdose" and "Heroin Overdose" are both related to Pamela Coulson's cause of death, so both entities have the same score. "UnName_Entity" is unrelated to the cause of death or not specified, its relevance is none.

### Strictly refer to the above example output results:
### input:
Q: {}
{}
Relation: {}
Entites: {}
Score:

### output: """

answer_prompt = """Given a question and the associated retrieved knowledge graph triplets (entity, relation, entity), you are asked to answer the question with these triplets and your knowledge.
Q: Find the person who said \"Taste cannot be controlled by law\", what did this person die from?
Knowledge Triplets: Taste cannot be controlled by law., media_common.quotation.author, Thomas Jefferson
A: Based on the given knowledge triplets, it's not sufficient to answer the entire question. The triplets only provide information about the person who said "Taste cannot be controlled by law," which is Thomas Jefferson. To answer the second part of the question, it's necessary to have additional knowledge about where Thomas Jefferson's dead.

Q: The artist nominated for The Long Winter lived where?
Knowledge Triplets: The Long Winter, book.written_work.author, Laura Ingalls Wilder
Laura Ingalls Wilder, people.person.places_lived, Unknown-Entity
Unknown-Entity, people.place_lived.location, De Smet
A: Based on the given knowledge triplets, the author of The Long Winter, Laura Ingalls Wilder, lived in De Smet. Therefore, the answer to the question is {De Smet}.

Q: Who is the coach of the team owned by Steve Bisciotti?
Knowledge Triplets: Steve Bisciotti, sports.professional_sports_team.owner_s, Baltimore Ravens
Steve Bisciotti, sports.sports_team_owner.teams_owned, Baltimore Ravens
Steve Bisciotti, organization.organization_founder.organizations_founded, Allegis Group
A: Based on the given knowledge triplets, the coach of the team owned by Steve Bisciotti is not explicitly mentioned. However, it can be inferred that the team owned by Steve Bisciotti is the Baltimore Ravens, a professional sports team. Therefore, additional knowledge about the current coach of the Baltimore Ravens can be used to answer the question.

Q: Rift Valley Province is located in a nation that uses which form of currency?
Knowledge Triplets: Rift Valley Province, location.administrative_division.country, Kenya
Rift Valley Province, location.location.geolocation, UnName_Entity
Rift Valley Province, location.mailing_address.state_province_region, UnName_Entity
Kenya, location.country.currency_used, Kenyan shilling
A: Based on the given knowledge triplets, Rift Valley Province is located in Kenya, which uses the Kenyan shilling as its currency. Therefore, the answer to the question is {Kenyan shilling}.

Q: The country with the National Anthem of Bolivia borders which nations?
Knowledge Triplets: National Anthem of Bolivia, government.national_anthem_of_a_country.anthem, UnName_Entity
National Anthem of Bolivia, music.composition.composer, Leopoldo Benedetto Vincenti
National Anthem of Bolivia, music.composition.lyricist, José Ignacio de Sanjinés
UnName_Entity, government.national_anthem_of_a_country.country, Bolivia
Bolivia, location.country.national_anthem, UnName_Entity
A: Based on the given knowledge triplets, we can infer that the National Anthem of Bolivia is the anthem of Bolivia. Therefore, the country with the National Anthem of Bolivia is Bolivia itself. However, the given knowledge triplets do not provide information about which nations border Bolivia. To answer this question, we need additional knowledge about the geography of Bolivia and its neighboring countries.

Q: {}
"""

prompt_evaluate="""Given a question and the associated retrieved knowledge graph triplets (entity, relation, entity), you are asked to answer whether it's sufficient for you to answer the question with these triplets and your knowledge (Yes or No).
Q: Find the person who said \"Taste cannot be controlled by law\", what did this person die from?
Knowledge Triplets: Taste cannot be controlled by law., media_common.quotation.author, Thomas Jefferson
A: {No}. Based on the given knowledge triplets, it's not sufficient to answer the entire question. The triplets only provide information about the person who said "Taste cannot be controlled by law," which is Thomas Jefferson. To answer the second part of the question, it's necessary to have additional knowledge about where Thomas Jefferson's dead.

Q: The artist nominated for The Long Winter lived where?
Knowledge Triplets: The Long Winter, book.written_work.author, Laura Ingalls Wilder
Laura Ingalls Wilder, people.person.places_lived, Unknown-Entity
Unknown-Entity, people.place_lived.location, De Smet
A: {Yes}. Based on the given knowledge triplets, the author of The Long Winter, Laura Ingalls Wilder, lived in De Smet. Therefore, the answer to the question is {De Smet}.

Q: Who is the coach of the team owned by Steve Bisciotti?
Knowledge Triplets: Steve Bisciotti, sports.professional_sports_team.owner_s, Baltimore Ravens
Steve Bisciotti, sports.sports_team_owner.teams_owned, Baltimore Ravens
Steve Bisciotti, organization.organization_founder.organizations_founded, Allegis Group
A: {No}. Based on the given knowledge triplets, the coach of the team owned by Steve Bisciotti is not explicitly mentioned. However, it can be inferred that the team owned by Steve Bisciotti is the Baltimore Ravens, a professional sports team. Therefore, additional knowledge about the current coach of the Baltimore Ravens can be used to answer the question.

Q: Rift Valley Province is located in a nation that uses which form of currency?
Knowledge Triplets: Rift Valley Province, location.administrative_division.country, Kenya
Rift Valley Province, location.location.geolocation, UnName_Entity
Rift Valley Province, location.mailing_address.state_province_region, UnName_Entity
Kenya, location.country.currency_used, Kenyan shilling
A: {Yes}. Based on the given knowledge triplets, Rift Valley Province is located in Kenya, which uses the Kenyan shilling as its currency. Therefore, the answer to the question is {Kenyan shilling}.

Q: The country with the National Anthem of Bolivia borders which nations?
Knowledge Triplets: National Anthem of Bolivia, government.national_anthem_of_a_country.anthem, UnName_Entity
National Anthem of Bolivia, music.composition.composer, Leopoldo Benedetto Vincenti
National Anthem of Bolivia, music.composition.lyricist, José Ignacio de Sanjinés
UnName_Entity, government.national_anthem_of_a_country.country, Bolivia
Bolivia, location.country.national_anthem, UnName_Entity
A: {No}. Based on the given knowledge triplets, we can infer that the National Anthem of Bolivia is the anthem of Bolivia. Therefore, the country with the National Anthem of Bolivia is Bolivia itself. However, the given knowledge triplets do not provide information about which nations border Bolivia. To answer this question, we need additional knowledge about the geography of Bolivia and its neighboring countries.

"""

generate_directly = """Q: What state is home to the university that is represented in sports by George Washington Colonials men's basketball?
A: First, the education institution has a sports team named George Washington Colonials men's basketball in is George Washington University , Second, George Washington University is in Washington D.C. The answer is {Washington, D.C.}.

Q: Who lists Pramatha Chaudhuri as an influence and wrote Jana Gana Mana?
A: First, Bharoto Bhagyo Bidhata wrote Jana Gana Mana. Second, Bharoto Bhagyo Bidhata lists Pramatha Chaudhuri as an influence. The answer is {Bharoto Bhagyo Bidhata}.

Q: Who was the artist nominated for an award for You Drive Me Crazy?
A: First, the artist nominated for an award for You Drive Me Crazy is Britney Spears. The answer is {Jason Allen Alexander}.

Q: What person born in Siegen influenced the work of Vincent Van Gogh?
A: First, Peter Paul Rubens, Claude Monet and etc. influenced the work of Vincent Van Gogh. Second, Peter Paul Rubens born in Siegen. The answer is {Peter Paul Rubens}.

Q: What is the country close to Russia where Mikheil Saakashvii holds a government position?
A: First, China, Norway, Finland, Estonia and Georgia is close to Russia. Second, Mikheil Saakashvii holds a government position at Georgia. The answer is {Georgia}.

Q: What drug did the actor who portrayed the character Urethane Wheels Guy overdosed on?
A: First, Mitchell Lee Hedberg portrayed character Urethane Wheels Guy. Second, Mitchell Lee Hedberg overdose Heroin. The answer is {Heroin}."""


cot_prompt = """Q: What state is home to the university that is represented in sports by George Washington Colonials men's basketball?
A: First, the education institution has a sports team named George Washington Colonials men's basketball in is George Washington University , Second, George Washington University is in Washington D.C. The answer is {Washington, D.C.}.

Q: Who lists Pramatha Chaudhuri as an influence and wrote Jana Gana Mana?
A: First, Bharoto Bhagyo Bidhata wrote Jana Gana Mana. Second, Bharoto Bhagyo Bidhata lists Pramatha Chaudhuri as an influence. The answer is {Bharoto Bhagyo Bidhata}.

Q: Who was the artist nominated for an award for You Drive Me Crazy?
A: First, the artist nominated for an award for You Drive Me Crazy is Britney Spears. The answer is {Jason Allen Alexander}.

Q: What person born in Siegen influenced the work of Vincent Van Gogh?
A: First, Peter Paul Rubens, Claude Monet and etc. influenced the work of Vincent Van Gogh. Second, Peter Paul Rubens born in Siegen. The answer is {Peter Paul Rubens}.

Q: What is the country close to Russia where Mikheil Saakashvii holds a government position?
A: First, China, Norway, Finland, Estonia and Georgia is close to Russia. Second, Mikheil Saakashvii holds a government position at Georgia. The answer is {Georgia}.

Q: What drug did the actor who portrayed the character Urethane Wheels Guy overdosed on?
A: First, Mitchell Lee Hedberg portrayed character Urethane Wheels Guy. Second, Mitchell Lee Hedberg overdose Heroin. The answer is {Heroin}."""
