Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Add todowrite tool, closes #1060

davidmezzetti4c03a8106f01
diff --git a/src/python/txtai/agent/tool/todo.py b/src/python/txtai/agent/tool/todo.py
new file mode 100644
index 00000000..aa784ce6
--- /dev/null
+++ b/src/python/txtai/agent/tool/todo.py
@@ -0,0 +1,40 @@
+"""
+Todo imports
+"""
+
+from smolagents import Tool
+
+
+class TodoWriteTool(Tool):
+ """
+ The TodoWriteTool plans for task execution.
+ """
+
+ # pylint: disable=W0231
+ def __init__(self):
+ """
+ Creates a TodoWriteTool.
+ """
+
+ # Tool parameters
+ self.name = "todowrite"
+ self.description = (
+ "Implementation of a todo write tool. Generates a structured task list to help organize complex tasks. "
+ "Only use this tool for complex tasks with multiple steps. Skip for simple tasks that can be done easily."
+ )
+ self.inputs = {"plan": {"type": "string", "description": "The task plan"}}
+ self.output_type = "any"
+
+ # Validate parameters and initialize tool
+ super().__init__()
+
+ # pylint: disable=W0221
+ def forward(self, plan):
+ """
+ Returns the plan.
+
+ Returns:
+ plan
+ """
+
+ return plan