Spaces:
Runtime error
Runtime error
update app.py with two tools that I found online
Browse files8 unmodified lines910111213142 unmodified lines171819202122238 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef my_custom_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 yet2 unmodified linesarg2: the second argument"""return "What magic will you build ?"@tooldef get_current_time_in_timezone(timezone: str) -> str:"""A tool that fetches the current local time in a specified timezone.8 unmodified lines91011121314151617181920212223242526272829303132333435363738394041424344454647484950515253542 unmodified lines5758596061628 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef water_phase(arg1: 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 show the phase of water at a given temperatureArgs:arg1: the number representing temperature in Celsius"""if arg1 < 0:return "Ice"if 0 <= arg1 <= 100:return "Water"if arg1 > 100:return "Vapor"# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef create_new_vday_card_tool(theme: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 generates a custom Valentine's Day card based on a given theme.Args:theme: A string representing the theme for the Valentine's Day card."""try:#Import tool from Hub...image_gereration_tool = Tool.from_space(space_id="black-forest-labs/FLUX.1-schnell",name="generate image",description="Generate image from prompt")...image_generation_tool = load_tool("agents-couse/text-to-image", trust_remote_code=True)image = image_generation_tool(theme)return final_answer(image)except Exception as e:return f"Error creating card for theme '{theme}': {str(e)}"#image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef my_custom_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 yet2 unmodified linesarg2: the second argument"""return "What magic will you build ?"@tooldef get_current_time_in_timezone(timezone: str) -> str:"""A tool that fetches the current local time in a specified timezone.
app.py+40-1