File size: 578 Bytes
6867117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from smolagents import Tool
from typing import Any, Optional

class SimpleTool(Tool):
    name = "get_today_datetime"
    description = "Get the current local date and time."
    inputs = {}
    output_type = "null"

    def forward(self):
        """
        Get the current local date and time.

        Returns:
            str: Current date and time in the format 'YYYY-MM-DD HH:MM:SS'.

        Example:
            >>> forward()
            '2025-08-29 15:42:18'
        """
        from datetime import datetime
        return datetime.now().strftime("%Y-%m-%d %H:%M:%S")