multimedia-backend-integrator

Guides adding new media generation backends to MassGen's unified generate_media tool.

1.1k|176|Updated Jul 18, 2025
One-click install
npx skills add https://github.com/massgen/MassGen --skill multimedia-backend-integrator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: multimedia-backend-integrator
Source: https://github.com/massgen/MassGen/tree/main/massgen/skills/multimedia-backend-integrator
Command: npx skills add https://github.com/massgen/MassGen --skill multimedia-backend-integrator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new image, video, or audio generation backend to MassGen's unified generate_media tool requires coordinated changes across registration, dispatch, selection, and documentation files, and missing any step causes silent failures like backends never being auto-selected.

Core Features & Use Cases

  • Complete Integration Checklist: Step-by-step tasks covering registration in _base.py, backend implementation, dispatcher updates, image-to-image support, documentation, and tests.
  • Continuation Store Patterns: Reference implementations for stateful backends (OpenAI, Gemini, Grok) with an LRU store template for iterative media editing.
  • Common Pitfalls Guide: Documents known failure modes such as missing priority list entries, sync SDK handling, ephemeral URLs, and falsy duration bugs.
  • Use Case: When integrating a new image generation API (e.g., a new provider's SDK) into MassGen, follow the checklist to register API keys, implement the generation function, wire up auto-selection, and add tests without breaking existing backend selection behavior.

Quick Start

Use the multimedia-backend-integrator skill to walk me through adding a new image generation backend to MassGen's generate_media tool.

Frequently Asked Questions about multimedia-backend-integrator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new image generation backend to MassGen?

Register the backend's API key, default model, and priority in _base.py, implement a _generate_image_{backend} function in _image.py, add a dispatcher branch, and update image-to-image support in generate_media.py. Finish with documentation and tests.

How does MassGen auto-select a media generation backend?

The _selector.py module picks the best backend by checking which API keys are present in the environment and consulting the BACKEND_PRIORITY list for each media type. Backends missing from the priority list are never auto-selected.

How do continuation stores work for iterative media editing?

Each backend uses a different pattern: OpenAI passes previous_response_id server-side, Gemini keeps chat objects in an in-memory store, and Grok stores base64 images. A provided LRU store template handles new backends with eviction at 50 items.

Why is my new backend never auto-selected in MassGen?

The most common cause is omitting the backend from the BACKEND_PRIORITY list, which means it only works when explicitly specified. Also verify the API key env var is registered in BACKEND_API_KEYS and the fallback chain in generate_media.py.

What tests are needed when adding a media generation backend?

Add tests for backend registration, auto-selection with single and multiple keys, SDK parameter mapping, output file writing, continuation flow, and error handling. Also update existing tests that assert priority list contents or clear environment variables.