feat: add multimedia support for Telegram and Discord adapters#196
Open
slysian wants to merge 2 commits intoRightNow-AI:mainfrom
Open
feat: add multimedia support for Telegram and Discord adapters#196slysian wants to merge 2 commits intoRightNow-AI:mainfrom
slysian wants to merge 2 commits intoRightNow-AI:mainfrom
Conversation
Add comprehensive media handling for channel adapters: Telegram (receive): - Voice messages: download + transcribe via Groq Whisper (fallback: OpenAI Whisper) - Photos: download + recognize via Gemini Vision API - Documents: download + extract text content or recognize images Telegram & Discord (send): - File sending via multipart upload (sendDocument / Discord files API) - Image sending with optional captions Discord (receive): - Attachment processing: images via Gemini Vision, text files extracted - Mixed content (text + attachments) handled correctly Shared utilities (new media_utils module): - Gemini Vision image recognition - MIME type detection from magic bytes - Text file detection by extension/MIME - HTTP download helper - Attachment-to-text processing pipeline Closes RightNow-AI#158 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nurikk
reviewed
Mar 2, 2026
| }); | ||
|
|
||
| let url = format!( | ||
| "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key={gemini_key}" |
There was a problem hiding this comment.
it'll be better if we not hardcode model names and rely on global model resolution flow through config.toml
Replace hardcoded model names and API endpoints with LazyLock statics that read from environment variables at first use, with sensible defaults: - VISION_MODEL (default: gemini-2.5-flash) - VISION_API_BASE (default: generativelanguage.googleapis.com/v1beta) - GROQ_STT_MODEL (default: whisper-large-v3-turbo) - GROQ_STT_URL (default: api.groq.com/openai/v1/audio/transcriptions) - OPENAI_STT_MODEL (default: whisper-1) - OPENAI_STT_URL (default: api.openai.com/v1/audio/transcriptions) This allows users to swap models or providers without recompiling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comprehensive media handling for channel adapters:
Telegram (receive):
Telegram & Discord (send):
Discord (receive):
Shared utilities (new media_utils module):
Closes #158