diff --git a/src/gptbot/tools/__init__.py b/src/gptbot/tools/__init__.py index 8ade706..747e502 100644 --- a/src/gptbot/tools/__init__.py +++ b/src/gptbot/tools/__init__.py @@ -13,6 +13,7 @@ for tool in [ "imagine", "imagedescription", "wikipedia", + "datetime", ]: tool_class = getattr(import_module( "." + tool, "gptbot.tools"), tool.capitalize()) diff --git a/src/gptbot/tools/datetime.py b/src/gptbot/tools/datetime.py new file mode 100644 index 0000000..5d00305 --- /dev/null +++ b/src/gptbot/tools/datetime.py @@ -0,0 +1,16 @@ +from .base import BaseTool + +from datetime import datetime + +class Datetime(BaseTool): + DESCRIPTION = "Get the current date and time." + PARAMETERS = { + "type": "object", + "properties": { + }, + } + + async def run(self): + """Get the current date and time.""" + return f"""**Current date and time (UTC)** +{datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")}""" \ No newline at end of file