File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
lib/crewai/src/crewai/tools Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ import uuid
2+ from datetime import datetime
3+ from langchain .tools import tool
4+
5+ class AgentUtilityTools :
6+ """
7+ A collection of utility tools to help Agents with
8+ grounding (Time) and traceability (IDs).
9+ """
10+
11+ @tool ("Generate Unique ID" )
12+ def generate_id (tool_input = None ):
13+ """
14+ Generates a unique Version 4 UUID.
15+ Useful for tagging tasks, creating transaction IDs, or tracking agent actions.
16+ Returns a string ID (e.g., 'a1b2-c3d4...').
17+ """
18+ return str (uuid .uuid4 ())
19+
20+ @tool ("Get Current Time" )
21+ def get_current_time (tool_input = None ):
22+ """
23+ Returns the current system date and time.
24+ Useful for agents that need to schedule events, check deadlines,
25+ or know 'what day is it today' to avoid hallucinations.
26+ """
27+ return datetime .now ().strftime ("%Y-%m-%d %H:%M:%S" )
You can’t perform that action at this time.
0 commit comments