13 lines
320 B
Python
13 lines
320 B
Python
from datetime import datetime
|
|
|
|
from tools.registry import tool_registry
|
|
|
|
|
|
@tool_registry.register(
|
|
name="get_current_time",
|
|
description="获取当前日期和时间",
|
|
parameters={"type": "object", "properties": {}},
|
|
)
|
|
def get_current_time() -> str:
|
|
return datetime.now().strftime("%Y-%m-%d %H:%M:%S %A")
|