BenyaAronov commited on
Commit
cb562ee
·
verified ·
1 Parent(s): d2f9211

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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:
@@ -51,10 +51,9 @@ def _my_local_name_generator(arg1: str, arg2: str) -> str:
51
  except Exception as e:
52
  return f"An error occurred: {str(e)}"
53
 
54
- my_local_name_generator = _my_local_name_generator
55
 
56
  @tool
57
- def _get_current_time_in_timezone(timezone: str) -> str:
58
  """A tool that fetches the current local time in a specified timezone.
59
  Args:
60
  timezone: A string representing a valid timezone (e.g., 'America/New_York').
@@ -69,7 +68,6 @@ def _get_current_time_in_timezone(timezone: str) -> str:
69
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
70
 
71
 
72
- get_current_time_in_timezone = _get_current_time_in_timezone
73
  final_answer = FinalAnswerTool()
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:
@@ -91,7 +89,7 @@ with open("prompts.yaml", 'r') as stream:
91
 
92
  agent = CodeAgent(
93
  model=model,
94
- tools=[final_answer, image_generation_tool, DuckDuckGoSearchTool, get_current_time_in_timezone, my_local_name_generator], ## add your tools here (don't remove final answer)
95
  max_steps=6,
96
  verbosity_level=1,
97
  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:
 
51
  except Exception as e:
52
  return f"An error occurred: {str(e)}"
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').
 
68
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
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:
 
89
 
90
  agent = CodeAgent(
91
  model=model,
92
+ tools=[final_answer, image_generation_tool, DuckDuckGoSearchTool, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
93
  max_steps=6,
94
  verbosity_level=1,
95
  grammar=None,