jonas-luehrs commited on
Commit
41392dc
·
verified ·
1 Parent(s): a55fa34

Add new tool

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -52,6 +52,8 @@ def get_current_time_in_timezone(timezone: str) -> str:
52
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
53
 
54
 
 
 
55
  final_answer = FinalAnswerTool()
56
  model = HfApiModel(
57
  max_tokens=2096,
@@ -65,13 +67,18 @@ custom_role_conversions=None,
65
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
66
  web_search_tool = DuckDuckGoSearchTool()
67
  model_downloads_tool = HFModelDownloadsTool()
 
 
 
 
 
68
 
69
  with open("prompts.yaml", 'r') as stream:
70
  prompt_templates = yaml.safe_load(stream)
71
 
72
  agent = CodeAgent(
73
  model=model,
74
- tools=[final_answer, image_generation_tool, web_search_tool, model_downloads_tool], ## add your tools here (don't remove final answer)
75
  max_steps=6,
76
  verbosity_level=1,
77
  grammar=None,
 
52
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
53
 
54
 
55
+
56
+
57
  final_answer = FinalAnswerTool()
58
  model = HfApiModel(
59
  max_tokens=2096,
 
67
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
68
  web_search_tool = DuckDuckGoSearchTool()
69
  model_downloads_tool = HFModelDownloadsTool()
70
+ object_detection_tool = Tool.from_space(
71
+ space_id="kadirnar/Yolov10",
72
+ name="object-detection",
73
+ description="Detect objects within an image"
74
+ )
75
 
76
  with open("prompts.yaml", 'r') as stream:
77
  prompt_templates = yaml.safe_load(stream)
78
 
79
  agent = CodeAgent(
80
  model=model,
81
+ tools=[final_answer, image_generation_tool, web_search_tool, model_downloads_tool, object_detection_tool], ## add your tools here (don't remove final answer)
82
  max_steps=6,
83
  verbosity_level=1,
84
  grammar=None,