sahil-datascience commited on
Commit
e326d81
·
1 Parent(s): 727ef0f

Prompt inside agent

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -14,16 +14,7 @@ import yaml
14
  # --- Constants ---
15
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
16
 
17
- # --- System Prompt ---
18
- with open("prompts.yaml", "r", encoding="utf-8") as f:
19
- prompts = yaml.safe_load(f)
20
 
21
- prompt_templates = PromptTemplates(
22
- system=prompts["system"],
23
- planning=prompts["planning"],
24
- managed_agent=prompts["managed_agent"],
25
- final_answer=prompts["final_answer"],
26
- )
27
 
28
  # --- Basic Agent Definition ---
29
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
@@ -36,7 +27,18 @@ class BasicAgent:
36
  wiki_tool = WikipediaSearchTool()
37
  python_tool = PythonInterpreterTool()
38
  visit_tool = VisitWebpageTool()
39
-
 
 
 
 
 
 
 
 
 
 
 
40
  self.agent = CodeAgent(
41
  model=self.model,
42
  tools=[search_tool, wiki_tool, python_tool, visit_tool],
 
14
  # --- Constants ---
15
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
16
 
 
 
 
17
 
 
 
 
 
 
 
18
 
19
  # --- Basic Agent Definition ---
20
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
 
27
  wiki_tool = WikipediaSearchTool()
28
  python_tool = PythonInterpreterTool()
29
  visit_tool = VisitWebpageTool()
30
+
31
+ # --- System Prompt ---
32
+ with open("prompts.yaml", "r", encoding="utf-8") as f:
33
+ prompts = yaml.safe_load(f)
34
+
35
+ prompt_templates = PromptTemplates(
36
+ system=prompts["system"],
37
+ planning=prompts["planning"],
38
+ managed_agent=prompts["managed_agent"],
39
+ final_answer=prompts["final_answer"],
40
+ )
41
+
42
  self.agent = CodeAgent(
43
  model=self.model,
44
  tools=[search_tool, wiki_tool, python_tool, visit_tool],