niikun commited on
Commit
1a22e5a
·
verified ·
1 Parent(s): 2f2e07c

add coding tool

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -37,7 +37,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
37
 
38
  final_answer = FinalAnswerTool()
39
 
40
- search_tool = DuckDuckGoSearchTool()
41
 
42
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
43
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
@@ -52,15 +52,15 @@ custom_role_conversions=None,
52
 
53
  # Import tool from Hub
54
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
55
-
56
-
57
 
58
  with open("prompts.yaml", 'r') as stream:
59
  prompt_templates = yaml.safe_load(stream)
60
 
61
  agent = CodeAgent(
62
  model=model,
63
- tools=[final_answer,get_current_time_in_timezone,image_generation_tool,search_tool], ## add your tools here (don't remove final answer)
64
  max_steps=6,
65
  verbosity_level=1,
66
  grammar=None,
 
37
 
38
  final_answer = FinalAnswerTool()
39
 
40
+
41
 
42
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
43
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
 
52
 
53
  # Import tool from Hub
54
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
55
+ search_tool = DuckDuckGoSearchTool()
56
+ coding_tool = CodeAgent
57
 
58
  with open("prompts.yaml", 'r') as stream:
59
  prompt_templates = yaml.safe_load(stream)
60
 
61
  agent = CodeAgent(
62
  model=model,
63
+ tools=[final_answer,get_current_time_in_timezone,image_generation_tool,search_tool,coding_tool], ## add your tools here (don't remove final answer)
64
  max_steps=6,
65
  verbosity_level=1,
66
  grammar=None,