BenyaAronov commited on
Commit
deb72b0
·
verified ·
1 Parent(s): 13a5c13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -9,7 +9,7 @@ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
- def my_local_name_generator(arg1: str, arg2: str) -> str:
13
  """A tool that generates a localized version of the given name for the specified country.
14
 
15
  Args:
@@ -53,7 +53,7 @@ def my_local_name_generator(arg1: str, arg2: str) -> str:
53
 
54
 
55
  @tool
56
- def get_current_time_in_timezone(timezone: str) -> str:
57
  """A tool that fetches the current local time in a specified timezone.
58
  Args:
59
  timezone: A string representing a valid timezone (e.g., 'America/New_York').
@@ -69,6 +69,8 @@ def get_current_time_in_timezone(timezone: str) -> str:
69
 
70
 
71
  final_answer = FinalAnswerTool()
 
 
72
 
73
  # 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:
74
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
@@ -92,7 +94,7 @@ with open("prompts.yaml", 'r') as stream:
92
 
93
  agent = CodeAgent(
94
  model=model,
95
- tools=[final_answer, image_generation_tool, websearch], ## add your tools here (don't remove final answer)
96
  max_steps=6,
97
  verbosity_level=1,
98
  grammar=None,
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def _my_local_name_generator(arg1: str, arg2: str) -> str:
13
  """A tool that generates a localized version of the given name for the specified country.
14
 
15
  Args:
 
53
 
54
 
55
  @tool
56
+ def _get_current_time_in_timezone(timezone: str) -> str:
57
  """A tool that fetches the current local time in a specified timezone.
58
  Args:
59
  timezone: A string representing a valid timezone (e.g., 'America/New_York').
 
69
 
70
 
71
  final_answer = FinalAnswerTool()
72
+ get_current_time_in_timezone = _get_current_time_in_timezone
73
+ my_local_name_generator = _my_local_name_generator
74
 
75
  # 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:
76
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
 
94
 
95
  agent = CodeAgent(
96
  model=model,
97
+ tools=[final_answer, image_generation_tool, websearch, get_current_time_in_timezone, my_local_name_generator], ## add your tools here (don't remove final answer)
98
  max_steps=6,
99
  verbosity_level=1,
100
  grammar=None,