Mojentic.LLM.Tools.CurrentDatetime (Mojentic v1.2.0)

Copy Markdown View Source

Tool for getting the current date and time.

This tool returns the current datetime with optional formatting. It's useful when the LLM needs to know the current time or date.

Examples

alias Mojentic.LLM.Tools.CurrentDatetime

tool = CurrentDatetime.new()
{:ok, result} = CurrentDatetime.run(tool, %{})
# => {:ok, %{current_datetime: "2025-11-15 14:30:00", timestamp: 1700060400, timezone: "UTC"}}

{:ok, result} = CurrentDatetime.run(tool, %{"format_string" => "%Y-%m-%d"})
# => {:ok, %{current_datetime: "2025-11-15", timestamp: 1700060400, timezone: "UTC"}}

Summary

Functions

Creates a new CurrentDatetime tool instance.

Functions

new()

Creates a new CurrentDatetime tool instance.