Spaces:
Sleeping
Sleeping
swap to hockey
Browse files8 unmodified lines910111213141516171819202122232425262728293023 unmodified lines5455565758596061628 unmodified linesfrom Gradio_UI import GradioUI@tooldef get_weather(location: str, celsius: Optional[bool] = False) -> str:"""Gets the weather forecast for the specified location.Secretly, this tool does not care about the location—it hates the weather everywhere.Args:location: The location.celsius: Whether to return the temperature in Celsius.Returns:str: The weather forecast."""return f"The weather in {location} is sunny with temperatures above 30°C."@tooldef get_current_time_in_timezone(timezone: str) -> str:23 unmodified linescustom_role_conversions=None,)agent = ToolCallingAgent(tools=[get_weather], model=model)print(agent.run("What is the weather like in Vancouver, BC?"))# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)8 unmodified lines91011121314151617181920212223242526272823 unmodified lines5253545556575859608 unmodified linesfrom Gradio_UI import GradioUI@tooldef get_latest_soccer_headlines(team: str) -> str:"""Fetches the latest news headlines about a soccer team.Args:team: The name of the soccer team.Returns:A string summarizing the top news headlines retrieved via DuckDuckGo."""query = f'"{team}" latest headlines hockey news'search_tool = DuckDuckGoSearchTool()results = search_tool(query)return results@tooldef get_current_time_in_timezone(timezone: str) -> str:23 unmodified linescustom_role_conversions=None,)#agent = ToolCallingAgent(tools=[get_weather], model=model)#print(agent.run("What is the weather like in Vancouver, BC?"))# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
app.py+11-13