Update app.py
Browse files28 unmodified lines2930313233343520 unmodified lines5657585960616228 unmodified linestz = pytz.timezone(timezone)# Get current time in that timezonelocal_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")return f"The current local time in {timezone} is: {local_time}"except Exception as e:return f"Error fetching time for timezone '{timezone}': {str(e)}"20 unmodified linesagent = CodeAgent(model=model,tools=[final_answer, get_current_time_in_timezone], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,28 unmodified lines293031323334353637383940414243444546474849505120 unmodified lines7273747576777828 unmodified linestz = pytz.timezone(timezone)# Get current time in that timezonelocal_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")return f"The current local time in original tool {timezone} is: {local_time}"except Exception as e:return f"Error fetching time for timezone '{timezone}': {str(e)}"@tooldef get_current_time_in_timezone_test_which_is_called(timezone: str) -> str:"""A tool that fetches the current local time in a specified timezone.Args:timezone: A string representing a valid timezone (e.g., 'America/New_York')."""try:# Create timezone objecttz = pytz.timezone(timezone)# Get current time in that timezonelocal_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")return f"The current local time in duplicate tool{timezone} is: {local_time}"except Exception as e:return f"Error fetching time for timezone '{timezone}': {str(e)}"20 unmodified linesagent = CodeAgent(model=model,tools=[final_answer, get_current_time_in_timezone, get_current_time_in_timezone_test_which_is_called], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,
app.py+18-2