Spaces:
Sleeping
Sleeping
Commit
·
92c77a0
1
Parent(s):
1634884
short prompt
Browse files
app.py
CHANGED
@@ -772,47 +772,39 @@ First check if you can answer the question by yourself without the need for a to
|
|
772 |
You also have access to a set of tools, which you can use to answer the question, if you can't answer the question directly. The available tools are:
|
773 |
{tool_descriptions}
|
774 |
|
775 |
-
If there is a file (image, audio, or video) attached to the question, you should use the process_attachment tool to process it and follow the instructions below:
|
776 |
-
- For audio or video attachments, the process_attachment tool will transcribe the audio and return the transcript, which you can use to answer the question.
|
777 |
-
- For image attachments, the process_attachment tool will return a base64 encoded string of the image. You can use this encoded information to provide answer.
|
778 |
-
|
779 |
If the question is related to sports, awards, historical facts or similar topic that can be answered from wikipedia, you should use the 'wikipedia_and_generalknowledge_search', if the question is based on current events or news kind then you can utilize the tool 'current_events_news_search_tool' to fetch relevant page information and answer from it.
|
780 |
You must not use multiple tools in a single call. Don't hallucinate.
|
781 |
|
|
|
|
|
|
|
|
|
782 |
|
783 |
-
For each question, follow this format:
|
784 |
-
|
785 |
-
Question: the input question you must answer
|
786 |
-
Thought: your reasoning about what to do next
|
787 |
-
Action: the action to take, must be one of the tools. If no relevant tools, answer the question directly.
|
788 |
-
Action Input: the input to the action
|
789 |
-
Observation: the result of the action
|
790 |
-
... (repeat Thought/Action/Action Input/Observation as needed)
|
791 |
-
Final Answer: the answer to the original question, as concise as possible (number, short string, or comma-separated list, no extra explanation).
|
792 |
|
793 |
**Examples:**
|
794 |
Q: Which country had the least number of athletes at the 1928 Summer Olympics?
|
795 |
Final Answer: Luxembourg
|
796 |
|
797 |
-
Q: How many albums did the band release?
|
798 |
-
Final Answer: 5
|
799 |
-
|
800 |
Q: List the top 3 programming languages.
|
801 |
Final Answer: Python, JavaScript, Java
|
802 |
|
803 |
Q: What is the maximum number os birds in the video https://www.youtube.com/watch?v=example?
|
804 |
Final Answer: 12
|
805 |
|
806 |
-
Rules for YOUR FINAL ANSWER:
|
807 |
-
- Don't include explanations, thoughts, or tool calls in YOUR FINAL ANSWER.
|
808 |
-
- YOUR FINAL ANSWER should be a single value (number, string, or comma-separated list).
|
809 |
-
- If your example thought and Final Answer is something like 'Thought:Final Answer: The country with the least number of athletes at the 1928 Summer Olympics was Luxembourg, which had only 2 athletes.' then your output should be just: 'Luxembourg'
|
810 |
|
811 |
If after 12 iterations also a tool usage is not useful then try to answer directly based on your knowledge. If you cannot answer then just say "no_answer" as YOUR FINAL ANSWER.
|
812 |
-
|
813 |
"""
|
814 |
# If your final answer is something like 'there were 5 studio albums published between 2000 and 2009' then modify YOUR FINAL ANSWER as: '5'
|
815 |
# If your final answer is something like 'b, e' then YOUR FINAL ANSWER be: 'b, e'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
816 |
|
817 |
|
818 |
# system_prompt = f"""
|
@@ -867,7 +859,7 @@ chat_llm = ChatHuggingFace(llm=llm)
|
|
867 |
chat_llm = ChatOpenAI(
|
868 |
openai_api_key=OPENAI_KEY,
|
869 |
model_name=OPENAI_MODEL,
|
870 |
-
temperature=0.
|
871 |
# max_tokens=10
|
872 |
)
|
873 |
|
|
|
772 |
You also have access to a set of tools, which you can use to answer the question, if you can't answer the question directly. The available tools are:
|
773 |
{tool_descriptions}
|
774 |
|
|
|
|
|
|
|
|
|
775 |
If the question is related to sports, awards, historical facts or similar topic that can be answered from wikipedia, you should use the 'wikipedia_and_generalknowledge_search', if the question is based on current events or news kind then you can utilize the tool 'current_events_news_search_tool' to fetch relevant page information and answer from it.
|
776 |
You must not use multiple tools in a single call. Don't hallucinate.
|
777 |
|
778 |
+
Instructions to follow for YOUR FINAL ANSWER:
|
779 |
+
- Don't include explanations, thoughts, or tool calls in YOUR FINAL ANSWER.
|
780 |
+
- YOUR FINAL ANSWER should be a single value (number, string, or comma-separated list).
|
781 |
+
- If your example thought and Final Answer is something like 'Thought:Final Answer: The country with the least number of athletes at the 1928 Summer Olympics was Luxembourg, which had only 2 athletes.' then your output should be just: 'Luxembourg'
|
782 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
783 |
|
784 |
**Examples:**
|
785 |
Q: Which country had the least number of athletes at the 1928 Summer Olympics?
|
786 |
Final Answer: Luxembourg
|
787 |
|
|
|
|
|
|
|
788 |
Q: List the top 3 programming languages.
|
789 |
Final Answer: Python, JavaScript, Java
|
790 |
|
791 |
Q: What is the maximum number os birds in the video https://www.youtube.com/watch?v=example?
|
792 |
Final Answer: 12
|
793 |
|
|
|
|
|
|
|
|
|
794 |
|
795 |
If after 12 iterations also a tool usage is not useful then try to answer directly based on your knowledge. If you cannot answer then just say "no_answer" as YOUR FINAL ANSWER.
|
|
|
796 |
"""
|
797 |
# If your final answer is something like 'there were 5 studio albums published between 2000 and 2009' then modify YOUR FINAL ANSWER as: '5'
|
798 |
# If your final answer is something like 'b, e' then YOUR FINAL ANSWER be: 'b, e'
|
799 |
+
# For each question, follow this format:
|
800 |
+
|
801 |
+
# Question: the input question you must answer
|
802 |
+
# Thought: your reasoning about what to do next
|
803 |
+
# Action: the action to take, must be one of the tools. If no relevant tools, answer the question directly.
|
804 |
+
# Action Input: the input to the action
|
805 |
+
# Observation: the result of the action
|
806 |
+
# ... (repeat Thought/Action/Action Input/Observation as needed)
|
807 |
+
# Final Answer: the answer to the original question, as concise as possible (number, short string, or comma-separated list, no extra explanation).
|
808 |
|
809 |
|
810 |
# system_prompt = f"""
|
|
|
859 |
chat_llm = ChatOpenAI(
|
860 |
openai_api_key=OPENAI_KEY,
|
861 |
model_name=OPENAI_MODEL,
|
862 |
+
temperature=0.1,
|
863 |
# max_tokens=10
|
864 |
)
|
865 |
|