Spaces:
Sleeping
Sleeping
Update app.py
Browse files8 unmodified lines9101112131412131415161716171819201921222324252627282932 unmodified lines62636458656667688 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 yet def get_latest_business_news(topic: str) -> str: """Fetches the latest business news about a given topic using DuckDuckGo search. Args: arg1: the first argument arg2: the second argument topic: The business-related topic to search for (e.g., "AI in FMCG", "Retail trends 2024"). Returns: A short summary of the latest news related to the topic. """ return "What magic will you build ?" try: search_tool = DuckDuckGoSearchTool() results = search_tool.run(f"latest business news about {topic}") return f"Here are the latest updates on {topic}:\n{results[:3]}" # Return top 3 results except Exception as e: return f"Error fetching news: {str(e)}"
@tooldef get_current_time_in_timezone(timezone: str) -> str:32 unmodified lines agent = CodeAgent( model=model, tools=[final_answer], ## add your tools here (don't remove final answer) tools=[final_answer, image_generation_tool, get_latest_business_news, get_current_time_in_timezone], ## add your tools here (don't remove final answer) max_steps=6, verbosity_level=1, grammar=None,app.py+14-7