# mini_bot — optional environment variables. # Copy to .env (gitignored) and fill in what you need. # Loaded by scripts/watchdog.sh on bot startup. # ---------- Azure Cognitive Services Speech (TTS) ---------- # Free tier (F0): 500,000 characters/month neural voices. # 1. Go to https://portal.azure.com → 创建资源 → 搜索 "Speech" → # 选 "Speech services" → 价格层 "Free F0" → 创建。 # 2. 创建好后进入资源 → 左侧 "密钥和终结点" → 复制 KEY1 + 位置/区域。 # 3. 区域格式:eastasia, eastus, westus2, southeastasia, japaneast 等。 # 4. 填到下面两行,重启 bot:scripts/stop.sh && nohup scripts/watchdog.sh & # 5. 进群发 /tts engine 会显示 azure;/tts style 会自动切到 Azure 预设。 AZURE_SPEECH_KEY= AZURE_SPEECH_REGION= # Optional: change the default voice (when no per-chat voice is set). # Popular: zh-CN-XiaoxiaoNeural / zh-CN-YunxiNeural / en-US-JennyNeural AZURE_SPEECH_VOICE=zh-CN-XiaoxiaoNeural # ---------- TTS engine override ---------- # If you have BOTH say (macOS) and azure, the bot prefers azure when # the Azure vars are set. To force "say" anyway, uncomment: # TTS_ENGINE=say # ---------- ASR (语音识别 / Speech-to-Text) ---------- # Voice messages are transcribed to text before being sent to the model. # Without a backend, voice notes can't be understood (the bot will say so). # Auto-detect priority: openai → azure → whisper-cpp → faster-whisper. # Force one with ASR_ENGINE (openai|azure|whisper-cpp|faster-whisper). # ASR_ENGINE=whisper-cpp # # Optional language hint (empty = auto-detect; helps short/noisy clips): # zh = Chinese, en = English, ja = Japanese, ... # ASR_LANG= # # -- Backend 1: OpenAI Whisper API (cloud, accurate, ~$0.006/min) -- # Reuses OPENAI_API_KEY. Optional OPENAI_BASE_URL for proxies/compatibles. # OPENAI_API_KEY= # OPENAI_BASE_URL=https://api.openai.com/v1 # OPENAI_ASR_MODEL=whisper-1 # or gpt-4o-mini-transcribe # # -- Backend 2: Azure Speech-to-Text (cloud) -- # Reuses AZURE_SPEECH_KEY + AZURE_SPEECH_REGION above. Best for clips < 60s. # (No extra vars needed; defaults language to zh-CN when ASR_LANG is empty.) # # -- Backend 3: whisper.cpp (local, offline, free) -- # brew install whisper-cpp # provides whisper-cli # mkdir -p ~/.qoder/models/whisper && cd $_ # # small (~488MB, fast) or medium (~1.5GB, more accurate for Chinese): # curl -LO https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin # curl -LO https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium.bin # WHISPER_CPP_MODEL=/Users/you/.qoder/models/whisper/ggml-medium.bin # WHISPER_CPP_BEAM_SIZE=8 # default 8; higher = slower but more accurate # WHISPER_CPP_INITIAL_PROMPT=以下是普通话的句子。 # context hint for language/style # # -- Backend 4: faster-whisper (local python, offline, free) -- # pip install faster-whisper # needs ctranslate2 wheels for your python # FASTER_WHISPER_MODEL=base # tiny|base|small|medium|large-v3 # ---------- Fuyao AI Gateway (私有推理网关) ---------- # Fuyao 模型通过 opencode 运行,API key 配置在 ~/.config/opencode/opencode.json # 而非此文件。详见 README.md「Fuyao 私有推理网关」章节。 # OPENCODE_BIN=opencode # 可选:自定义 opencode 路径 # ---------- API Server (OpenAI-compatible 代理模式) ---------- # 启动后 mini_bot 提供一个 OpenAI 兼容的 HTTP API,外部工具(opencode、IDE 等) # 可直连使用 mini_bot 支持的所有模型,无需走飞书消息通道。 # Fuyao 模型直连网关(支持 streaming),qodercli 模型通过 qodercli -p 桥接。 # BOT_API_SERVER=1 # BOT_API_PORT=9877 # FUYAO_API_KEY= # Fuyao 网关 API key # FUYAO_BASE_URL=https://fuyao-ai-gateway.xiaopeng.link/v1