Skip to content

Commit 2fd1df6

Browse files
author
Sherwin
committed
feat(tools): add TimeAwareness and IDGeneration tools
1 parent 38b0b12 commit 2fd1df6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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")

0 commit comments

Comments
 (0)