lrmla commited on
Commit
488cc06
·
verified ·
1 Parent(s): de43e1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -33,6 +33,10 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
 
 
 
 
36
 
37
  final_answer = FinalAnswerTool()
38
 
@@ -48,14 +52,14 @@ custom_role_conversions=None,
48
 
49
 
50
  # Import tool from Hub
51
- image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
52
 
53
  with open("prompts.yaml", 'r') as stream:
54
  prompt_templates = yaml.safe_load(stream)
55
 
56
  agent = CodeAgent(
57
  model=model,
58
- tools=[final_answer], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
 
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
+ @tool
37
+ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
38
+
39
+
40
 
41
  final_answer = FinalAnswerTool()
42
 
 
52
 
53
 
54
  # Import tool from Hub
55
+ #image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
56
 
57
  with open("prompts.yaml", 'r') as stream:
58
  prompt_templates = yaml.safe_load(stream)
59
 
60
  agent = CodeAgent(
61
  model=model,
62
+ tools=[final_answer, calculator, image_generation_tool], ## add your tools here (don't remove final answer)
63
  max_steps=6,
64
  verbosity_level=1,
65
  grammar=None,