Spaces:
Sleeping
Sleeping
Specify CUSTOM_PROMPT to improve answer reproducibility
Browse files
app.py
CHANGED
|
@@ -21,6 +21,18 @@ from youtube_transcript_tool import YoutubeTranscriptTool
|
|
| 21 |
# --- Constants ---
|
| 22 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
rate_limiter = RateLimiter()
|
| 25 |
|
| 26 |
# --- Basic Agent Definition ---
|
|
@@ -43,6 +55,7 @@ class BasicAgent:
|
|
| 43 |
model=model,
|
| 44 |
step_callbacks=[rate_limiter.increment_and_sleep_if_needed],
|
| 45 |
additional_authorized_imports=["pandas"],
|
|
|
|
| 46 |
)
|
| 47 |
print("BasicAgent initialized.")
|
| 48 |
|
|
|
|
| 21 |
# --- Constants ---
|
| 22 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 23 |
|
| 24 |
+
CUSTOM_PROMPT = """
|
| 25 |
+
You are a general AI assistant. I will ask you a question.
|
| 26 |
+
Your final response must be ONLY the answer itself and nothing else.
|
| 27 |
+
Do not include any explanations, reasoning, or prefixes like "FINAL ANSWER:".
|
| 28 |
+
|
| 29 |
+
The answer should be a number OR as few words as possible OR a comma separated list.
|
| 30 |
+
- If the answer is a number, do not use commas for thousands separators (e.g., write 1000 not 1,000) and do not include units like '$' or '%' unless specified.
|
| 31 |
+
- If the answer is a string, do not use articles (a, an, the) or abbreviations.
|
| 32 |
+
- If the answer is a list, apply these rules to each element
|
| 33 |
+
and separete them with a comma like "a, b, c".
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
rate_limiter = RateLimiter()
|
| 37 |
|
| 38 |
# --- Basic Agent Definition ---
|
|
|
|
| 55 |
model=model,
|
| 56 |
step_callbacks=[rate_limiter.increment_and_sleep_if_needed],
|
| 57 |
additional_authorized_imports=["pandas"],
|
| 58 |
+
instructions=CUSTOM_PROMPT
|
| 59 |
)
|
| 60 |
print("BasicAgent initialized.")
|
| 61 |
|