Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,11 +10,6 @@ from smolagents import CodeAgent, WebSearchTool, InferenceClientModel, DuckDuckG
|
|
| 10 |
# --- Constants ---
|
| 11 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 12 |
|
| 13 |
-
prompt_templates = """
|
| 14 |
-
You are an expert assistant who can find out any fact. You are skilled in using search tools to find information, using reasoning to identify complex relationships and can generate code to find precise answers. You are being asked specific questions and the fate of the world rests in your ability to precisely answer them. Your primary objective is to track down the exact answer required by the question. The number of iterations needed to find the answer is not a concern so long as you are 100% confident in the answer you return.
|
| 15 |
-
|
| 16 |
-
After you identify and validate the exact answer to the question you will return only that with no further explanation. Debugging logs will be used if needed to identify how you arrived at that answer.
|
| 17 |
-
"""
|
| 18 |
# --- Basic Agent Definition ---
|
| 19 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 20 |
class BasicAgent:
|
|
@@ -23,6 +18,10 @@ class BasicAgent:
|
|
| 23 |
search_tool = DuckDuckGoSearchTool()
|
| 24 |
model = InferenceClientModel()
|
| 25 |
# TODO: add additional tools and or subagents (e.g. OpenAI image recognition)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
master_agent = CodeAgent(
|
| 27 |
tools=[websearchtool, search_tool],
|
| 28 |
model=model,
|
|
|
|
| 10 |
# --- Constants ---
|
| 11 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# --- Basic Agent Definition ---
|
| 14 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 15 |
class BasicAgent:
|
|
|
|
| 18 |
search_tool = DuckDuckGoSearchTool()
|
| 19 |
model = InferenceClientModel()
|
| 20 |
# TODO: add additional tools and or subagents (e.g. OpenAI image recognition)
|
| 21 |
+
|
| 22 |
+
with open("prompts.yaml", 'r') as stream:
|
| 23 |
+
prompt_templates = yaml.safe_load(stream)
|
| 24 |
+
|
| 25 |
master_agent = CodeAgent(
|
| 26 |
tools=[websearchtool, search_tool],
|
| 27 |
model=model,
|