Add media file support for LLM prompter#580
Merged
Conversation
…ideo/audio Co-authored-by: sal-uva <10960315+sal-uva@users.noreply.github.com>
…defaults, and error detection comments Co-authored-by: sal-uva <10960315+sal-uva@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add media support for LLM prompter
Add media file support for LLM prompter
Mar 9, 2026
…taset, where multiple media files belong to one post id
Member
|
This should be mergeable. Not all vendors support video and audio, but that's acceptable in my opinion. LLM prompter is now quite bulky and should be refactored, but maybe that's for another day. |
There was a problem hiding this comment.
Pull request overview
This PR extends the llm-prompter processor to support media-archive parent datasets (ZIPs containing image/video/audio), enabling multimodal prompting using locally extracted media files in addition to existing URL-based media inputs.
Changes:
- Add ZIP media-archive compatibility and a dedicated processing path in
LLMPrompter(options/UI + iteration + annotation mapping). - Extend
LLMAdaptermultimodal support to accept local media file paths (base64-encoded) alongside media URLs, with provider-specific formatting. - Minor UI/UX tweaks for annotation rendering and link wrapping, plus marking
AudioExtractorZIP outputs asmedia_type="audio".
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
common/lib/llm.py |
Adds local media_files support for multimodal prompts and provider-specific content block formatting. |
processors/machine_learning/llm_prompter.py |
Adds media-archive dataset compatibility, media-specific options, and a ZIP iteration + LLM prompting path. |
processors/audio/audio_extractor.py |
Marks resulting ZIP datasets as audio media type. |
common/assets/llms.json |
Updates/renames several predefined model IDs and model card links. |
webtool/templates/explorer/item-annotations.html |
Uses item_id consistently in DOM ids/classes and avoids variable shadowing. |
webtool/static/css/explorer-annotation-generic.css |
Improves wrapping behavior for long annotation label/link text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… accurately show the processed items
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.
Extends
llm-prompterto work with parent datasets that are media archives (zip files from image downloaders or media imports), not just text-based CSV/NDJSON datasets.common/lib/llm.pycreate_multimodal_content()now acceptsmedia_files(local paths, base64-encoded) alongside existingmedia_urls_format_media_block()— new helper for provider-specific content blocks:imageblocks for images,documentblocks for video/audioinput_audioformat for audioimage_urlwrappergenerate_text()gainsmedia_filesparameter to pass local file pathsprocessors/machine_learning/llm_prompter.pyis_compatible_with()— acceptszipdatasets withmedia_typein(image, video, audio)get_options()— when parent is a media archive:process()— new media archive code path: iterates zip contents, skips metadata files, base64-encodes each media file, sends to LLM viamedia_filesparam. Catches model incompatibility errors (e.g. non-vision model receiving images) with clear user-facing messages.validate_query()— relaxes column bracket requirement for media archives; allows empty user prompt when system prompt is providedAll existing text-based processing behavior is preserved in the
elsebranch. All models and custom model IDs remain available — incompatibility is caught at generation time rather than upfront.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.