DTStudios commited on
Commit
9848f16
·
verified ·
1 Parent(s): 5fb6ced

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent,DuckDuckGoSearchTool,ToolRegistry,HfApiModel,load_tool,tool
2
  import datetime
3
  from duckduckgo_search import DDGS
4
  import requests
@@ -64,17 +64,18 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
64
  with open("prompts.yaml", 'r') as stream:
65
  prompt_templates = yaml.safe_load(stream)
66
 
67
- # --- Tool registry ---
68
- tool_registry = ToolRegistry([
69
  DuckDuckGoSearchTool,
70
  get_current_time_in_timezone,
71
- ])
 
72
 
73
  agent_tools = [entry["tool"] for entry in tool_registry.values() if entry["enabled"]
74
  ]
75
  # --- Agent setup ---
76
  agent = CodeAgent(
77
- tools=ToolRegistry,
78
  model="gpt-4o-mini", # or whichever model you’re using
79
  add_base_tools=True,
80
  name="MyAgent",
 
1
+ from smolagents import CodeAgent,DuckDuckGoSearchTool,HfApiModel,load_tool,tool
2
  import datetime
3
  from duckduckgo_search import DDGS
4
  import requests
 
64
  with open("prompts.yaml", 'r') as stream:
65
  prompt_templates = yaml.safe_load(stream)
66
 
67
+ # Tools list (no registry object needed)
68
+ tool=[
69
  DuckDuckGoSearchTool,
70
  get_current_time_in_timezone,
71
+ load_tool("agents-course/text-to-image", trust_remote_code=True),
72
+ ]
73
 
74
  agent_tools = [entry["tool"] for entry in tool_registry.values() if entry["enabled"]
75
  ]
76
  # --- Agent setup ---
77
  agent = CodeAgent(
78
+ tools=tools,
79
  model="gpt-4o-mini", # or whichever model you’re using
80
  add_base_tools=True,
81
  name="MyAgent",