Download source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/utils/get-datetime.ts from Yakimask/mimamo: direct link, hf CLI and curl.
- Browser
- Download file 779 Bytes
-
https://huggingface.co/Yakimask/mimamo/resolve/main/source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/utils/get-datetime.ts
- Command line
-
hf download hf://Yakimask/mimamo/source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/utils/get-datetime.ts
-
curl -L -o get-datetime.ts https://huggingface.co/Yakimask/mimamo/resolve/main/source/third_party/llama.cpp-1.0.0/tools/ui/src/lib/utils/get-datetime.ts
779 Bytes
| /** | |
| * Browser executor for the `get_datetime` tool. It runs in the browser, so it | |
| * reports the user's own clock and time zone instead of the server's UTC time - | |
| * a chat about "tomorrow" means the user's tomorrow, not the host's. | |
| * | |
| * @see buildGetDatetimeToolDefinition in constants/get-datetime.ts - tool schema sent to the LLM | |
| */ | |
| import { formatLocalIso } from './formatters'; | |
| import type { ToolExecutionResult } from '$lib/types'; | |
| /** The `result` field keeps the shape the `get_datetime` renderer already reads. */ | |
| export function executeGetDatetimeTool(): ToolExecutionResult { | |
| const now = new Date(); | |
| return { | |
| content: JSON.stringify({ | |
| result: formatLocalIso(now), | |
| timezone: Intl.DateTimeFormat().resolvedOptions().timeZone | |
| }), | |
| isError: false | |
| }; | |
| } | |