Spaces:
Runtime error
Runtime error
abtsousa
commited on
Commit
·
689ccd6
1
Parent(s):
1a1f4af
Add system prompt for AI assistant.
Browse files- agent/prompts.py +36 -0
agent/prompts.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Sequence
|
| 2 |
+
from datetime import datetime
|
| 3 |
+
|
| 4 |
+
from tools import list_tools
|
| 5 |
+
|
| 6 |
+
# DEFAULT_PROMPT = (
|
| 7 |
+
# "You are {app_name}, a general AI assistant.\n\n"
|
| 8 |
+
# "You have access to the following tools: {tools}.\n\n"
|
| 9 |
+
# "I will ask you a question. Report your thoughts, and finish your answer "
|
| 10 |
+
# "with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. "
|
| 11 |
+
# "YOUR FINAL ANSWER should be a number OR as few words as possible OR "
|
| 12 |
+
# "a comma separated list of numbers and/or strings. "
|
| 13 |
+
# "If you are asked for a number, don't use comma to write your number "
|
| 14 |
+
# "neither use units such as $ or percent sign unless specified otherwise. "
|
| 15 |
+
# "If you are asked for a string, don't use articles, neither abbreviations "
|
| 16 |
+
# "(e.g. for cities), and write the digits in plain text unless specified "
|
| 17 |
+
# "otherwise. If you are asked for a comma separated list, apply the above "
|
| 18 |
+
# "rules depending of whether the element to be put in the list is a number "
|
| 19 |
+
# "or a string."
|
| 20 |
+
# " Remember to use the provided tools if necessary to answer the questions accurately. "
|
| 21 |
+
# )
|
| 22 |
+
|
| 23 |
+
DEFAULT_PROMPT = """You are a helpful assistant tasked with answering questions using a set of tools.
|
| 24 |
+
Now, I will ask you a question. Report your thoughts, and finish your answer with the following template:
|
| 25 |
+
FINAL ANSWER: [YOUR FINAL ANSWER].
|
| 26 |
+
YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, Apply the rules above for each element (number or string), ensure there is exactly one space after each comma.
|
| 27 |
+
Your answer should only start with "FINAL ANSWER: ", then follows with the answer."""
|
| 28 |
+
|
| 29 |
+
def get_system_prompt() -> str:
|
| 30 |
+
"""
|
| 31 |
+
Generate a system prompt for the AI assistant.
|
| 32 |
+
|
| 33 |
+
Returns:
|
| 34 |
+
Formatted system prompt with dynamic sports information
|
| 35 |
+
"""
|
| 36 |
+
return DEFAULT_PROMPT
|