RemVdH commited on
Commit
908eedb
·
verified ·
1 Parent(s): 4d85a47

Update app.py

Browse files

Added tool to improve clock prompt

Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -18,6 +18,18 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
18
  """
19
  return "What magic will you build ?"
20
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  @tool
22
  def get_current_time_in_timezone(timezone: str) -> str:
23
  """A tool that fetches the current local time in a specified timezone.
@@ -55,7 +67,7 @@ with open("prompts.yaml", 'r') as stream:
55
 
56
  agent = CodeAgent(
57
  model=model,
58
- tools=[final_answer, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
 
18
  """
19
  return "What magic will you build ?"
20
 
21
+ # Below is an try to make to improve the step of visualizing a clock !
22
+
23
+ @tool
24
+ def clock_visual_improve_prompt(arg1:str)-> str: #it's import to specify the return type
25
+ #Keep this format for the description / args / args description but feel free to modify the tool
26
+ """This tool help to improve the prompt when ask to visualize a clock. It should be used before the actual visualization. The output is an improved description.
27
+ Making it much more likely that the clock is visualized correctly
28
+ Args:
29
+ arg1: the original prompt
30
+ """
31
+ return "An analog wall clock with a white face and black Arabic numerals. The hour hand is slightly past the 10, pointing about 1/4 of the way towards the 11. The minute hand points directly at the 3. The background is a soft blue. The lighting is bright and even."
32
+
33
  @tool
34
  def get_current_time_in_timezone(timezone: str) -> str:
35
  """A tool that fetches the current local time in a specified timezone.
 
67
 
68
  agent = CodeAgent(
69
  model=model,
70
+ tools=[final_answer, get_current_time_in_timezone, clock_visual_improve_prompt, image_generation_tool], ## add your tools here (don't remove final answer)
71
  max_steps=6,
72
  verbosity_level=1,
73
  grammar=None,