Media Understanding (Inbound)
Mayros reply pipeline चलने से पहले inbound media को summarize कर सकता है (image/audio/video)। यह auto‑detect करता है जब local tools या provider keys उपलब्ध हों, और disabled या customized किया जा सकता है। यदि understanding off है, तो models अभी भी सामान्य रूप से original files/URLs प्राप्त करते हैं।
लक्ष्य
- वैकल्पिक: तेज़ routing + बेहतर command parsing के लिए inbound media को short text में pre‑digest करें।
- Model को original media delivery preserve करें (हमेशा)।
- Provider APIs और CLI fallbacks का समर्थन करें।
- Ordered fallback (error/size/timeout) के साथ कई models की अनुमति दें।
High‑level व्यवहार
- Inbound attachments collect करें (
MediaPaths,MediaUrls,MediaTypes)। - प्रत्येक enabled capability (image/audio/video) के लिए, policy के अनुसार attachments select करें (डिफ़ॉल्ट: first)।
- पहली eligible model entry चुनें (size + capability + auth)।
- यदि model fail होता है या media बहुत बड़ा है, तो अगली entry पर fall back करें।
- Success पर:
Body[Image],[Audio]या[Video]block बन जाती है।- Audio
{{Transcript}}set करता है; command parsing caption text का उपयोग करता है जब present हो, अन्यथा transcript। - Captions को block के अंदर
User text:के रूप में preserved किया जाता है।
यदि understanding fail होता है या disabled है, तो reply flow original body + attachments के साथ continue होता है।
Config अवलोकन
tools.media shared models और per‑capability overrides का समर्थन करता है:
tools.media.models: shared model list (capabilitiesका उपयोग करके gate करें)।tools.media.image/tools.media.audio/tools.media.video:- defaults (
prompt,maxChars,maxBytes,timeoutSeconds,language) - provider overrides (
baseUrl,headers,providerOptions) tools.media.audio.providerOptions.deepgramके माध्यम से Deepgram audio विकल्प- वैकल्पिक per‑capability
modelslist (shared models से पहले preferred) attachmentspolicy (mode,maxAttachments,prefer)scope(channel/chatType/session key द्वारा वैकल्पिक gating)
- defaults (
tools.media.concurrency: max concurrent capability runs (डिफ़ॉल्ट 2)।
Defaults और limits
अनुशंसित defaults:
maxChars: image/video के लिए 500 (short, command‑friendly)maxChars: audio के लिए unset (full transcript जब तक limit set न हो)maxBytes:- image: 10MB
- audio: 20MB
- video: 50MB
नियम:
- यदि media
maxBytesसे अधिक है, तो उस model को skip किया जाता है और अगला model try किया जाता है। - यदि model
maxCharsसे अधिक return करता है, तो output trimmed है।
Auto-detect media understanding (डिफ़ॉल्ट)
यदि tools.media.<capability>.enabled false पर सेट नहीं है और आपने
models configure नहीं किए हैं, तो Mayros इस क्रम में auto-detect करता है और पहले
working विकल्प पर रुकता है:
- Local CLIs (केवल audio; यदि installed हों)
sherpa-onnx-offline(SHERPA_ONNX_MODEL_DIRकी आवश्यकता)whisper-cli(whisper-cpp)whisper(Python CLI)
- Gemini CLI (
gemini)read_many_filesका उपयोग करके - Provider keys
- Audio: OpenAI → Groq → Deepgram → Google
- Image: OpenAI → Anthropic → Google → MiniMax
- Video: Google
Auto-detection को disable करने के लिए, सेट करें:
json5{ tools: { media: { audio: { enabled: false, }, }, }, }
Provider support matrix (Mayros integrations)
| Capability | Provider integration | नोट्स |
|---|---|---|
| Image | OpenAI / Anthropic / Google / अन्य pi-ai के माध्यम से | Registry में कोई भी image-capable model काम करता है। |
| Audio | OpenAI, Groq, Deepgram, Google | Provider transcription (Whisper/Deepgram/Gemini)। |
| Video | Google (Gemini API) | Provider video understanding। |
अनुशंसित providers
Image
- यदि यह images को support करता है तो अपने active model को prefer करें।
- अच्छे defaults:
openai/gpt-5.2,anthropic/claude-opus-4-6,google/gemini-3-pro-preview।
Audio
openai/gpt-4o-mini-transcribe,groq/whisper-large-v3-turboयाdeepgram/nova-3।- CLI fallback:
whisper-cli(whisper-cpp) याwhisper।
Video
google/gemini-3-flash-preview(fast),google/gemini-3-pro-preview(richer)।- CLI fallback:
geminiCLI (video/audio परread_fileको support करता है)।
Attachment policy
Per‑capability attachments controls करता है कि कौन से attachments processed हैं:
mode:first(डिफ़ॉल्ट) याallmaxAttachments: processed संख्या cap करें (डिफ़ॉल्ट 1)prefer:first,last,path,url
जब mode: "all", तो outputs को [Image 1/2], [Audio 2/2], आदि label किया जाता है।