Renovation_Planner_AI / tools /estimate_renovation_cost.py
diegocp01's picture
Upload agent
d80b863 verified
from smolagents import Tool
from typing import Any, Optional
class SimpleTool(Tool):
name = "estimate_renovation_cost"
description = "Estimates renovation costs based on square footage and room type."
inputs = {"square_footage":{"type":"number","description":"The size of the room in square feet"},"room_type":{"type":"string","description":"The type of room (kitchen, bathroom, bedroom, living_room)"}}
output_type = "string"
def forward(self, square_footage: float, room_type: str) -> str:
"""
Estimates renovation costs based on square footage and room type.
Args:
square_footage: The size of the room in square feet
room_type: The type of room (kitchen, bathroom, bedroom, living_room)
"""
cost_per_sqft = {
"kitchen": 150,
"bathroom": 250,
"bedroom": 70,
"living_room": 90
}
base_cost = cost_per_sqft.get(room_type.lower(), 100) * square_footage
# Add contingency budget
total_cost = base_cost * 1.2
return f"Estimated cost for {room_type} renovation ({square_footage} sq ft): ${total_cost:.2f} including 20% contingency"