Spaces:
Sleeping
Sleeping
Update app.py
Browse files13 unmodified lines14151617181920212223242526272829306 unmodified lines3738394041424331 unmodified lines7576777879808113 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef movie_info(arg1:str)-> 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"""print ("Extracting movie info for --> ", arg1)try:# read and create an object of information about a movie requested.filtered_movies = [movie for movie in movies if movie["Title"].lower() == arg1.lower()]if len(filtered_movies) > 0:output = ""for movie in filtered_movies:6 unmodified linesoutput += "\n"else:output = "No information on that movie found!"print ("output = ", output)return outputexcept Exception as e:return f"Error movies json and formatting."31 unmodified linesagent = CodeAgent(model=model,tools=[final_answer, movie_info], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,13 unmodified lines141516171819202122232425262728296 unmodified lines3637383940414231 unmodified lines7475767778798013 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef movie_info(movie_name:str)-> 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:movie_name: 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:6 unmodified linesoutput += "\n"else:output = "No information on that movie found!"print (output)return outputexcept Exception as e:return f"Error movies json and formatting."31 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+6-7