Update app.py
Browse files
app.py
CHANGED
|
@@ -14,12 +14,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 14 |
# --- Basic Agent Definition ---
|
| 15 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 16 |
class BasicAgent:
|
| 17 |
-
|
| 18 |
-
Now, I will ask you a question. Report your thoughts, and finish your answer with the following template:
|
| 19 |
-
FINAL ANSWER: [YOUR FINAL ANSWER].
|
| 20 |
-
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 above rules depending of whether the element to be put in the list is a number or a string.
|
| 21 |
-
Your answer should only start with "FINAL ANSWER: ", then follows with the answer.
|
| 22 |
-
"""
|
| 23 |
def __init__(self):
|
| 24 |
print("BasicAgent initialized.")
|
| 25 |
self.graph = build_graph()
|
|
@@ -28,6 +23,12 @@ Your answer should only start with "FINAL ANSWER: ", then follows with the answe
|
|
| 28 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 29 |
# Wrap the question in a HumanMessage from langchain_core
|
| 30 |
#messages = [HumanMessage(content=question)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
messages = [
|
| 32 |
SystemMessage(
|
| 33 |
content=system_prompt
|
|
|
|
| 14 |
# --- Basic Agent Definition ---
|
| 15 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 16 |
class BasicAgent:
|
| 17 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
def __init__(self):
|
| 19 |
print("BasicAgent initialized.")
|
| 20 |
self.graph = build_graph()
|
|
|
|
| 23 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 24 |
# Wrap the question in a HumanMessage from langchain_core
|
| 25 |
#messages = [HumanMessage(content=question)]
|
| 26 |
+
system_prompt = """You are a helpful assistant tasked with answering questions using a set of tools.
|
| 27 |
+
Now, I will ask you a question. Report your thoughts, and finish your answer with the following template:
|
| 28 |
+
FINAL ANSWER: [YOUR FINAL ANSWER].
|
| 29 |
+
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 above rules depending of whether the element to be put in the list is a number or a string.
|
| 30 |
+
Your answer should only start with "FINAL ANSWER: ", then follows with the answer.
|
| 31 |
+
"""
|
| 32 |
messages = [
|
| 33 |
SystemMessage(
|
| 34 |
content=system_prompt
|