vapit commited on
Commit
6bd1d3d
·
verified ·
1 Parent(s): a4b101a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -28,6 +28,19 @@ def multipy_two_digits(arg1:int, arg2:int)-> int: #it's import to specify the re
28
  """
29
  return arg1 * arg2
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  @tool
32
  def get_current_time_in_timezone(timezone: str) -> str:
33
  """A tool that fetches the current local time in a specified timezone.
@@ -65,7 +78,7 @@ with open("prompts.yaml", 'r') as stream:
65
 
66
  agent = CodeAgent(
67
  model=model,
68
- tools=[final_answer, multipy_two_digits], ## add your tools here (don't remove final answer)
69
  max_steps=6,
70
  verbosity_level=1,
71
  grammar=None,
 
28
  """
29
  return arg1 * arg2
30
 
31
+ @tool
32
+ def generate_cat_image(prompt: str) -> str:
33
+ """
34
+ A tool that generates an image of a cat
35
+ Args:
36
+ prompt: a prompt which describes the type of cat
37
+ """
38
+ image_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
39
+
40
+ image_url = image_tool(prompt=prompt)
41
+
42
+ return image_url
43
+
44
  @tool
45
  def get_current_time_in_timezone(timezone: str) -> str:
46
  """A tool that fetches the current local time in a specified timezone.
 
78
 
79
  agent = CodeAgent(
80
  model=model,
81
+ tools=[final_answer, multipy_two_digits, generate_cat_image], ## add your tools here (don't remove final answer)
82
  max_steps=6,
83
  verbosity_level=1,
84
  grammar=None,