diff --git a/tool/current-time/src/main/java/ru/ldeloff/currenttime/tool/CurrentTimeTool.java b/tool/current-time/src/main/java/ru/ldeloff/currenttime/tool/CurrentTimeTool.java new file mode 100644 index 0000000..e747fcc --- /dev/null +++ b/tool/current-time/src/main/java/ru/ldeloff/currenttime/tool/CurrentTimeTool.java @@ -0,0 +1,18 @@ +package ru.ldeloff.currenttime.tool; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.ai.tool.annotation.Tool; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +@Slf4j +@Component +public class CurrentTimeTool { + + @Tool(description = "Get the current date in the ISO-8601 format yyyy-MM-dd HH:MM:ss") + String getCurrentDate() { + log.info("Getting current datetime: {}", LocalDateTime.now()); + return LocalDateTime.now().toString(); + } +} \ No newline at end of file