Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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()
|
| 23 |
final_answer = FinalAnswerTool()
|
| 24 |
|
| 25 |
# Model configuration (unchanged from template)
|
|
@@ -30,8 +30,6 @@ model = HfApiModel(
|
|
| 30 |
custom_role_conversions=None,
|
| 31 |
)
|
| 32 |
|
| 33 |
-
# Import tool from Hub (unchanged from template)
|
| 34 |
-
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 35 |
|
| 36 |
# Load prompt templates (unchanged from template, but updated in prompt.yaml)
|
| 37 |
with open("prompts.yaml", 'r') as stream:
|
|
@@ -41,7 +39,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 41 |
agent = CodeAgent(
|
| 42 |
model=model,
|
| 43 |
tools=[construct_course_search_query, search_tool, final_answer], # Added custom tool
|
| 44 |
-
max_steps=
|
| 45 |
verbosity_level=1,
|
| 46 |
grammar=None,
|
| 47 |
planning_interval=None,
|
|
|
|
| 19 |
return query
|
| 20 |
|
| 21 |
# Existing tools from the template
|
| 22 |
+
search_tool = DuckDuckGoSearchTool(query)
|
| 23 |
final_answer = FinalAnswerTool()
|
| 24 |
|
| 25 |
# Model configuration (unchanged from template)
|
|
|
|
| 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:
|
|
|
|
| 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,
|