Spaces:
Sleeping
Sleeping
Update app.py
Browse files3 unmodified lines4567891011121314151617181920212228 unmodified lines515253545556573 unmodified linesimport pytzimport yamlfrom tools.final_answer import FinalAnswerToolfrom Gradio_UI import GradioUI# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef my_cutom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type#Keep this format for the description / args / args description but feel free to modify the tool"""A tool that does nothing yetArgs:arg1: the first argumentarg2: the second argument"""return "What magic will you build ?"@tooldef get_current_time_in_timezone(timezone: str) -> str:28 unmodified linesagent = CodeAgent(model=model,tools=[final_answer], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,3 unmodified lines45678910111213141516171819202122232425262728293031323334353637383940414228 unmodified lines717273747576773 unmodified linesimport pytzimport yamlfrom tools.final_answer import FinalAnswerToolimport jsonfrom Gradio_UI import GradioUImovies = {}with open('movies.json') as f:movies = json.load(f)# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef movie_info(arg1:movie_name)-> str: #it's import to specify the return type#Keep this format for the description / args / args description but feel free to modify the tool"""A tool that does nothing yetArgs:arg1: name of the movie"""try:# read and create an object of information about a movie requested.filtered_movies = [movie for movie in movies if movie["Title"].lower() == movie_name.lower()]if len(filtered_movies) > 0:output = ""for movie in filtered_movies:output += movie['Title'] + ","output += movie['Year'] + ","output += movie['imdbRating'] + ","output += movie['imdbVotes'] + ","output += movie['Actors'] + ","output += "\n"else:output = "No information on that movie found!"return output@tooldef get_current_time_in_timezone(timezone: str) -> str:28 unmodified linesagent = CodeAgent(model=model,tools=[final_answer, ], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,
app.py+25-5