feat: add ReAct agent loop and build-time config (mimi_secrets.h)

Rewrite agent_loop.c with ReAct tool use loop: LLM call → tool
execution → repeat until end_turn (max 10 iterations). Add tool
guidance to system prompt. Add set_search_key CLI command.

Add mimi_secrets.h for build-time credentials with highest priority
over NVS/CLI values. All modules (wifi, telegram, llm, proxy,
web_search) check build-time secrets first, fall back to NVS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
crispyberry
2026-02-07 00:37:43 +08:00
parent 2fe81b8ee1
commit 0e1da79b74
9 changed files with 255 additions and 57 deletions

View File

@@ -43,7 +43,12 @@ esp_err_t context_build_system_prompt(char *buf, size_t size)
"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",
"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);
/* Bootstrap files */