aboutsummaryrefslogtreecommitdiffstats
path: root/useragents/src/current_time.py
diff options
context:
space:
mode:
Diffstat (limited to 'useragents/src/current_time.py')
-rw-r--r--useragents/src/current_time.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/useragents/src/current_time.py b/useragents/src/current_time.py
new file mode 100644
index 0000000..8304464
--- /dev/null
+++ b/useragents/src/current_time.py
@@ -0,0 +1,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")