SergeyO7 commited on
Commit
5190d3e
·
verified ·
1 Parent(s): 96aa631

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -99,6 +99,7 @@ PRUNING_PHASE_COEFFS = {
99
 
100
  # Tool definitions
101
 
 
102
  def get_moon_info(date_time: str) -> dict:
103
  """
104
  Returns Moon's Zodiac position, phase, and fertility and pruning indices for the given date/time.
@@ -190,6 +191,7 @@ def get_moon_info(date_time: str) -> dict:
190
  except Exception as e:
191
  raise ValueError(f"Error in get_moon_info: {str(e)}")
192
 
 
193
  def get_current_time_in_timezone(timezone: str) -> str:
194
  """
195
  Returns the current local time in the specified timezone with description.
@@ -206,6 +208,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
206
  except Exception as e:
207
  return f"Error: {str(e)}"
208
 
 
209
  def get_current_time_raw(timezone: str) -> str:
210
  """
211
  Returns current local time in specified timezone as ISO 8601 string.
@@ -273,7 +276,7 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
273
  # Initialize the agent without the 'memory' parameter
274
  agent = CodeAgent(
275
  model=model,
276
- tools=[final_answer, get_moon_info, get_current_time_in_timezone, get_current_time_raw, image_generation_tool],
277
  max_steps=10,
278
  verbosity_level=1,
279
  prompt_templates=prompt_templates,
 
99
 
100
  # Tool definitions
101
 
102
+ @tool
103
  def get_moon_info(date_time: str) -> dict:
104
  """
105
  Returns Moon's Zodiac position, phase, and fertility and pruning indices for the given date/time.
 
191
  except Exception as e:
192
  raise ValueError(f"Error in get_moon_info: {str(e)}")
193
 
194
+ @tool
195
  def get_current_time_in_timezone(timezone: str) -> str:
196
  """
197
  Returns the current local time in the specified timezone with description.
 
208
  except Exception as e:
209
  return f"Error: {str(e)}"
210
 
211
+ @tool
212
  def get_current_time_raw(timezone: str) -> str:
213
  """
214
  Returns current local time in specified timezone as ISO 8601 string.
 
276
  # Initialize the agent without the 'memory' parameter
277
  agent = CodeAgent(
278
  model=model,
279
+ tools=[final_answer, get_moon_info, get_current_time_in_timezone, get_current_time_raw],
280
  max_steps=10,
281
  verbosity_level=1,
282
  prompt_templates=prompt_templates,