feat: add working indicator and get_current_time to system prompt
Send "mimi😗is working..." to user when processing starts. List get_current_time in system prompt available tools so the agent knows to call it for time/date queries. Remove auto time fetch from system prompt builder — agent calls the tool on demand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "esp_log.h"
|
||||
#include "cJSON.h"
|
||||
|
||||
@@ -30,26 +29,18 @@ esp_err_t context_build_system_prompt(char *buf, size_t size)
|
||||
{
|
||||
size_t off = 0;
|
||||
|
||||
/* Identity header */
|
||||
time_t now;
|
||||
time(&now);
|
||||
struct tm tm;
|
||||
localtime_r(&now, &tm);
|
||||
char time_str[64];
|
||||
strftime(time_str, sizeof(time_str), "%Y-%m-%d %H:%M (%A)", &tm);
|
||||
|
||||
off += snprintf(buf + off, size - off,
|
||||
"# MimiClaw\n\n"
|
||||
"You are MimiClaw, a personal AI assistant running on an ESP32-S3 device.\n"
|
||||
"You communicate through Telegram and WebSocket.\n\n"
|
||||
"## Current Time\n%s\n\n"
|
||||
"Be helpful, accurate, and concise.\n\n"
|
||||
"## Available Tools\n"
|
||||
"You have access to the following tools:\n"
|
||||
"- web_search: Search the web for current information. "
|
||||
"Use this when you need up-to-date facts, news, weather, or anything beyond your training data.\n\n"
|
||||
"Use tools when needed. Provide your final answer as text after using tools.\n",
|
||||
time_str);
|
||||
"Use this when you need up-to-date facts, news, weather, or anything beyond your training data.\n"
|
||||
"- get_current_time: Get the current date and time. "
|
||||
"You do NOT have an internal clock — always use this tool when you need to know the time or date.\n\n"
|
||||
"Use tools when needed. Provide your final answer as text after using tools.\n");
|
||||
|
||||
/* Bootstrap files */
|
||||
off = append_file(buf, size, off, MIMI_SOUL_FILE, "Personality");
|
||||
|
||||
Reference in New Issue
Block a user