Spaces:
Runtime error
Runtime error
Update app.py
Browse files6 unmodified lines789101112131415161718192021226 unmodified linesfrom Gradio_UI import GradioUI# 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 important to specify the return type# Keep this format for the tool description / 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:6 unmodified lines7891011121314151617181920212223242526272829303132333435363738394041426 unmodified linesfrom Gradio_UI import GradioUI# # Below is an example of a tool that does nothing. Amaze us with your creativity!# @tool# def my_custom_tool(arg1:str, arg2:int)-> str: # it's important to specify the return type# # Keep this format for the tool description / args description but feel free to modify the tool# """A tool that does nothing yet# Args:# arg1: the first argument# arg2: the second argument# """# return "What magic will you build ?"@tooldef my_custom_tool(query: str, max_results: int = 5) -> str:"""Function that performs a DuckDuckGo search using the DuckDuckGoSearchTool class.Args:query: The search query to perform.max_results: Number of results to fetch (default is 5).Returns:A string containing the search results formatted as Markdown."""# Initialize the DuckDuckGoSearchTool with the desired number of resultssearch_tool = DuckDuckGoSearchTool(max_results=max_results)try:# Perform the search and return formatted resultsreturn search_tool.forward(query)except Exception as e:return f"An error occurred during the search: {e}"@tooldef get_current_time_in_timezone(timezone: str) -> str:
app.py+27-7