ModernMewtwo26 commited on
Commit
4637120
·
verified ·
1 Parent(s): 560de67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -19,7 +19,7 @@ def construct_course_search_query(interest: str, expertise: str, budget: str) ->
19
  return query
20
 
21
  # Existing tools from the template
22
- search_tool = DuckDuckGoSearchTool(construct_course_search_query)
23
  final_answer = FinalAnswerTool()
24
 
25
  # Model configuration (unchanged from template)
@@ -30,7 +30,6 @@ model = HfApiModel(
30
  custom_role_conversions=None,
31
  )
32
 
33
-
34
  # Load prompt templates (unchanged from template, but updated in prompt.yaml)
35
  with open("prompts.yaml", 'r') as stream:
36
  prompt_templates = yaml.safe_load(stream)
@@ -38,9 +37,9 @@ with open("prompts.yaml", 'r') as stream:
38
  # Initialize the agent with the updated tools list and custom logic
39
  agent = CodeAgent(
40
  model=model,
41
- tools=[construct_course_search_query, search_tool, final_answer], # Added custom tool
42
- max_steps=9,
43
- verbosity_level=1,
44
  grammar=None,
45
  planning_interval=None,
46
  name=None,
 
19
  return query
20
 
21
  # Existing tools from the template
22
+ search_tool = DuckDuckGoSearchTool()
23
  final_answer = FinalAnswerTool()
24
 
25
  # Model configuration (unchanged from template)
 
30
  custom_role_conversions=None,
31
  )
32
 
 
33
  # Load prompt templates (unchanged from template, but updated in prompt.yaml)
34
  with open("prompts.yaml", 'r') as stream:
35
  prompt_templates = yaml.safe_load(stream)
 
37
  # Initialize the agent with the updated tools list and custom logic
38
  agent = CodeAgent(
39
  model=model,
40
+ tools=[construct_course_search_query, search_tool, final_answer], # Added custom tools
41
+ max_steps=3, # Reduced from 9 to limit automatic progression
42
+ verbosity_level=2, # Increased to provide more detailed feedback
43
  grammar=None,
44
  planning_interval=None,
45
  name=None,