Audio / Voice Notes

क्या काम करता है

  • Media understanding (audio): यदि audio understanding enabled है (या auto‑detected), तो Mayros:
    1. पहला audio attachment (local path या URL) locate करता है और यदि आवश्यक हो तो इसे download करता है।
    2. प्रत्येक model entry को भेजने से पहले maxBytes enforce करता है।
    3. क्रम में पहली eligible model entry चलाता है (provider या CLI)।
    4. यदि यह fail या skip करता है (size/timeout), तो यह अगली entry try करता है।
    5. Success पर, यह Body को [Audio] block से replace करता है और {{Transcript}} set करता है।
  • Command parsing: जब transcription succeed होता है, तो CommandBody/RawBody को transcript पर सेट किया जाता है ताकि slash commands अभी भी काम करें।
  • Verbose logging: --verbose में, हम log करते हैं कि transcription कब चलता है और कब यह body को replace करता है।

Auto-detection (डिफ़ॉल्ट)

यदि आप models कॉन्फ़िगर नहीं करते और tools.media.audio.enabled false पर सेट नहीं है, तो Mayros इस क्रम में auto-detect करता है और पहले working विकल्प पर रुकता है:

  1. Local CLIs (यदि installed हैं)
    • sherpa-onnx-offline (SHERPA_ONNX_MODEL_DIR की आवश्यकता)
    • whisper-cli (whisper-cpp से)
    • whisper (Python CLI)
  2. Gemini CLI (gemini) read_many_files का उपयोग करके
  3. Provider keys (OpenAI → Groq → Deepgram → Google)

Auto-detection को disable करने के लिए, tools.media.audio.enabled: false सेट करें। Customize करने के लिए, tools.media.audio.models सेट करें।

Config उदाहरण

Provider + CLI fallback (OpenAI + Whisper CLI)

json5
{
  tools: {
    media: {
      audio: {
        enabled: true,
        maxBytes: 20971520,
        models: [
          { provider: "openai", model: "gpt-4o-mini-transcribe" },
          {
            type: "cli",
            command: "whisper",
            args: ["--model", "base", "{{MediaPath}}"],
            timeoutSeconds: 45,
          },
        ],
      },
    },
  },
}

Provider-only (Deepgram)

json5
{
  tools: {
    media: {
      audio: {
        enabled: true,
        models: [{ provider: "deepgram", model: "nova-3" }],
      },
    },
  },
}

नोट्स और limits

  • Provider auth standard model auth order का पालन करता है (auth profiles, env vars, models.providers.*.apiKey)।
  • Deepgram DEEPGRAM_API_KEY pick करता है जब provider: "deepgram" का उपयोग किया जाता है।
  • डिफ़ॉल्ट size cap 20MB (tools.media.audio.maxBytes) है।
  • OpenAI auto डिफ़ॉल्ट gpt-4o-mini-transcribe है; उच्च accuracy के लिए model: "gpt-4o-transcribe" सेट करें।
  • tools.media.audio.attachments का उपयोग करके कई voice notes process करें (mode: "all" + maxAttachments)।
  • Transcript templates के लिए {{Transcript}} के रूप में उपलब्ध है।

Groups में Mention Detection

जब किसी group chat के लिए requireMention: true सेट हो, तो Mayros अब mentions की जांच करने से पहले audio transcribe करता है। यह voice notes को तब भी process करने की अनुमति देता है जब उनमें mentions हों।

यह कैसे काम करता है:

  1. यदि किसी voice message में कोई text body नहीं है और group mentions की आवश्यकता है, तो Mayros एक "preflight" transcription करता है।
  2. Transcript को mention patterns (जैसे @BotName, emoji triggers) के लिए check किया जाता है।
  3. यदि एक mention मिलता है, तो संदेश पूर्ण reply pipeline के माध्यम से आगे बढ़ता है।
  4. Transcript का उपयोग mention detection के लिए किया जाता है ताकि voice notes mention gate पास कर सकें।

उदाहरण: एक user Telegram group में एक voice note भेजता है जिसमें "Hey @Claude, what's the weather?" कहा गया है और requireMention: true है। Voice note transcribed है, mention detected है, और agent reply करता है।