aboutsummaryrefslogtreecommitdiffstats
path: root/useragents/src/current_time.py
blob: 83044648a80944303a253ec3a135d876edc53794 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from datetime import datetime
from agents import function_tool


@function_tool
def fetch_time():
    """
    Fetches the current time.
    """

    return datetime.now().strftime("%H:%M:%S")


@function_tool
def fetch_date():
    """
    Fetches the current date.
    """

    return datetime.now().strftime("%Y-%m-%d")