/*
 * secrets.h  —  MaTouch AI ESP32-S3 2.8"  (Robojax.com)
 *
 * Fill these in, then KEEP THIS TAB CLOSED WHILE FILMING.
 * Rotate every key after the video is published, whether or not you think one
 * was visible on screen. Keys leak from thumbnails, reflections and B-roll.
 *
 * This file is only needed by 04_Voice_Assistant and 05_Vision_AI.
 * 01, 02 and 03 run with no internet and no keys at all.
 */

#pragma once

/* ===========================================================================
 * WIFI
 * The ESP32-S3 is 2.4 GHz ONLY. It cannot see a 5 GHz SSID.
 * On an Asus router, if "Smart Connect" is merging the 2.4 and 5 GHz bands
 * under one name, either turn Smart Connect off or give the 2.4 GHz band its
 * own SSID. This is the single most common reason these sketches "hang on
 * connecting" for viewers.
 * =========================================================================== */
#define WIFI_SSID       "your-2.4GHz-network"
#define WIFI_PASS       "your-wifi-password"

/* ===========================================================================
 * AZURE AI SPEECH  —  used for speech-to-text AND text-to-speech
 *
 * Portal: https://portal.azure.com  ->  Create a "Speech service" resource.
 * The free F0 tier is enough for this video (5 hours STT + 0.5M TTS chars/month).
 *
 * From the resource's "Keys and Endpoint" page you need TWO things:
 *   AZURE_SPEECH_KEY  - either KEY 1 or KEY 2
 *   AZURE_REGION      - the Location/Region, lowercase, no spaces
 *                       e.g. "eastus", "westeurope", "canadacentral"
 *
 * AZURE_STT_HOST is your resource's custom subdomain host. It looks like
 *   <your-resource-name>.cognitiveservices.azure.com
 * If your resource has no custom subdomain, use the regional form instead:
 *   <region>.stt.speech.microsoft.com
 * (either form works - the sketch detects which one you used and builds the
 *  matching URL path automatically)
 *
 * COMMON TRAP: the key must come from a *Speech service* resource. A key from
 * a Translator / Language / other Cognitive Services resource is also 84
 * characters and also "valid" - but every Speech call returns 401. If TTS
 * gives 401 while the token test passes, you have the wrong resource type.
 * =========================================================================== */
#define AZURE_SPEECH_KEY  "put-your-azure-speech-key-here"
#define AZURE_REGION      "eastus"
#define AZURE_STT_HOST    "your-resource-name.cognitiveservices.azure.com"

// Recognition language for speech-to-text, e.g. "en-US", "en-GB", "fa-IR", "de-DE"
#define AZURE_STT_LANG    "en-US"

// The voice that reads answers aloud. Full list:
//   https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts
// A few good ones: en-US-AriaNeural, en-US-GuyNeural,
//                  en-GB-SoniaNeural, en-US-JennyNeural
#define AZURE_TTS_VOICE   "en-US-AriaNeural"
#define AZURE_TTS_LANG    "en-US"

/* ===========================================================================
 * DEEPSEEK  —  the conversation "brain" (text only)
 *
 * Portal: https://platform.deepseek.com
 *
 * IMPORTANT, and the reason most DeepSeek tutorials online are now broken:
 * the old model names "deepseek-chat" and "deepseek-reasoner" were RETIRED on
 * 24 July 2026. If you use them you get a 400 error. The current names are:
 *
 *   deepseek-v4-flash  - cheap and fast. Correct choice for a voice assistant.
 *   deepseek-v4-pro    - stronger reasoning, ~3x the price. Overkill here.
 *
 * DeepSeek's API is TEXT ONLY - it cannot accept images. That is why the
 * vision demo (05) uses OpenAI instead.
 * =========================================================================== */
#define DEEPSEEK_KEY      "sk-put-your-deepseek-key-here"
#define DEEPSEEK_HOST     "api.deepseek.com"
#define DEEPSEEK_MODEL    "deepseek-v4-flash"

/* ===========================================================================
 * OPENAI  —  used only for the vision demo (05)
 *
 * Portal: https://platform.openai.com/api-keys
 *
 * Pick any current model that accepts image input. Cheaper tiers are plenty
 * for "what object is this". If a model name ever 404s, list what your account
 * can actually see with:
 *     curl https://api.openai.com/v1/models -H "Authorization: Bearer $KEY"
 * =========================================================================== */
#define OPENAI_KEY        "sk-put-your-openai-key-here"
#define OPENAI_HOST       "api.openai.com"
#define OPENAI_MODEL      "gpt-5.4-mini"

/* ===========================================================================
 * ASSISTANT PERSONALITY
 * Keep replies SHORT. Every extra sentence is extra seconds of the board
 * talking on camera, extra tokens, and extra text to fit on a 320x240 screen.
 * =========================================================================== */
#define SYSTEM_PROMPT \
  "You are a helpful assistant built into a small ESP32 device with a tiny " \
  "screen and a speaker. Answer in at most two short sentences. Never use " \
  "markdown, bullet points, emoji or special characters - your reply is read " \
  "aloud and drawn as plain text."

// Hard cap on the reply length. IMPORTANT: deepseek-v4-flash is a REASONING
// model - it spends 60-100 tokens "thinking" BEFORE the answer, and that
// thinking counts against max_tokens. Set this too low (e.g. 120) and the
// budget is eaten by reasoning, the answer comes back EMPTY, and the board
// says nothing. 400 leaves room for thinking + a two-sentence answer.
// (Verified by test_apis.ps1: 85 reasoning tokens + 13 answer tokens, 2.1 s.)
#define LLM_MAX_TOKENS  400
