todo.py
1 """ 2 Todo imports 3 """ 4 5 from smolagents import Tool 6 7 8 class TodoWriteTool(Tool): 9 """ 10 The TodoWriteTool plans for task execution. 11 """ 12 13 # pylint: disable=W0231 14 def __init__(self): 15 """ 16 Creates a TodoWriteTool. 17 """ 18 19 # Tool parameters 20 self.name = "todowrite" 21 self.description = ( 22 "Implementation of a todo write tool. Generates a structured task list to help organize complex tasks. " 23 "Only use this tool for complex tasks with multiple steps. Skip for simple tasks that can be done easily." 24 ) 25 self.inputs = {"plan": {"type": "string", "description": "The task plan"}} 26 self.output_type = "any" 27 28 # Validate parameters and initialize tool 29 super().__init__() 30 31 # pylint: disable=W0221 32 def forward(self, plan): 33 """ 34 Returns the plan. 35 36 Returns: 37 plan 38 """ 39 40 return plan