feat: add get_current_time built-in tool and timezone config

Fetches real time via HTTP Date header (works through proxy),
sets system clock, and returns formatted local time to the agent.
Also adds MIMI_TIMEZONE config and updates default model to claude-opus-4-5.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
crispyberry
2026-02-07 13:05:02 +08:00
parent 041fd6b59e
commit 78c7fc9b1a
6 changed files with 190 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
#include "tool_registry.h"
#include "tools/tool_web_search.h"
#include "tools/tool_get_time.h"
#include <string.h>
#include "esp_log.h"
@@ -65,6 +66,18 @@ esp_err_t tool_registry_init(void)
};
register_tool(&ws);
/* Register get_current_time */
mimi_tool_t gt = {
.name = "get_current_time",
.description = "Get the current date and time. Also sets the system clock. Call this when you need to know what time or date it is.",
.input_schema_json =
"{\"type\":\"object\","
"\"properties\":{},"
"\"required\":[]}",
.execute = tool_get_time_execute,
};
register_tool(&gt);
build_tools_json();
ESP_LOGI(TAG, "Tool registry initialized");