mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-18 19:34:39 +01:00
19 lines
404 B
Python
19 lines
404 B
Python
from datetime import datetime
|
|
|
|
tool = {
|
|
"type": "function",
|
|
"function": {
|
|
"name": "get_datetime",
|
|
"description": "Get the current date and time.",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {},
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
def execute(arguments):
|
|
now = datetime.now()
|
|
return {"date": now.strftime("%Y-%m-%d"), "time": now.strftime("%I:%M %p")}
|