Spaces:
Sleeping
Sleeping
Update app.py
Browse files62 unmodified lines636465666768697071727374757662 unmodified linesreturn "Sorry, I couldn't find a place with that weather type."# Register the tool in Smolagentstool_1 = smolagents.Tool(name="FavoriteWeather", function=weather_tool)# Example usage (you can use this to test the tool)#from smolagents.agents import Agent # Importing Agent correctly#agent = smolagents.Agent(tools=[tool_1])#response = agent.run("sunny")#print(response) # Should print the response for "sunny" weather# Tool 2: Ask for favorite color and return a shape associated with it# def color_shape_tool(agent_input: str):62 unmodified lines636465666768697071727374757677787962 unmodified linesreturn "Sorry, I couldn't find a place with that weather type."# Register the tool in Smolagents#tool_1 = smolagents.Tool(name="FavoriteWeather", function=weather_tool)# Register the tooltool_1 = smolagents.tools.Tool(name="FavoriteWeather", function=weather_tool)# Example of running the agent directly with the toolagent = smolagents.agents.Agent() # Use this if `Agent` is the correct classagent.add_tool(tool_1) # Add tool to agentresponse = agent.run("sunny") # Run the tool with an example inputprint(response) # Should print the response for "sunny" weather# Tool 2: Ask for favorite color and return a shape associated with it# def color_shape_tool(agent_input: str):
app.py+9-6