Spaces:
Sleeping
Sleeping
Update app.py
Browse files32 unmodified lines3334353637383911 unmodified lines5152535455565732 unmodified linesexcept Exception as e:return f"Error fetching time for timezone '{timezone}': {str(e)}"final_answer = FinalAnswerTool()model = HfApiModel(max_tokens=2096,11 unmodified linesagent = CodeAgent(model=model,tools=[final_answer, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,32 unmodified lines33343536373839404142434445464748495051525354555611 unmodified lines686970717273747532 unmodified linesexcept Exception as e:return f"Error fetching time for timezone '{timezone}': {str(e)}"def get_joke_tool(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 tells a jokeArgs:arg1: the first argument ex programmingarg2: the second argument ex 0"""if arg1 = "programming":joke= "why didn't the programmer quit his job? because he didn't get a raise"else:"What magic will you build ?"return jokefinal_answer = FinalAnswerTool()model = HfApiModel(max_tokens=2096,11 unmodified linesagent = CodeAgent(model=model,tools=[final_answer, get_current_time_in_timezone, get_joke_tool, image_generation_tool], ## add your tools here (don't remove final answer)print tools, ## newmax_steps=6,verbosity_level=1,grammar=None,
app.py+19-1