feat: add MiniMax image_generation provider - #23
Open
octo-patch wants to merge 2 commits into
Open
Conversation
Add MiniMax as an image generation provider alongside the existing
Grok Imagine (fal.ai) provider. The provider is selected with the
PROVIDER environment variable ("grok" default, or "minimax").
MiniMax integration covers the image_generation operation:
- Regional endpoints: global_en (api.minimax.io) and cn_zh
(api.minimaxi.com), selected via MINIMAX_REGION.
- Models: image-01 (default) and image-01-live.
- Bearer authorization with MINIMAX_API_KEY.
- Request fields: model, prompt, subject_reference, aspect_ratio,
width, height, response_format, seed, n, prompt_optimizer.
- Response parsing of data.image_urls, metadata.success_count,
metadata.failed_count, and base_resp.status_code.
Mirrors the changes across scripts/ and skill/scripts/ (TypeScript and
bash) and documents the provider in SKILL.md.
Author
|
I updated the mirrored MiniMax TypeScript and shell implementations to honor the documented region and model environment variables and to send a validated response_format. I ran TypeScript compilation, Bash syntax checks, diff checks, mirror comparisons, and mocked payload tests for both implementations. |
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.
Reason: Add MiniMax image_generation (image-01 / image-01-live) as a text-to-image provider alongside the existing Grok Imagine provider.
Changes
The selfie skill was hardcoded to xAI Grok Imagine through fal.ai. This adds MiniMax as a configurable image generation provider, selected via the
PROVIDERenvironment variable (grokdefault, orminimax).MiniMax image_generation integration
global_en->https://api.minimax.io/v1/image_generationandcn_zh->https://api.minimaxi.com/v1/image_generation, selected viaMINIMAX_REGION.image-01(default) andimage-01-live, selected viaMINIMAX_MODEL.Bearer $MINIMAX_API_KEY.model,prompt,subject_reference,aspect_ratio,width,height,response_format,seed,n,prompt_optimizer(optional fields included only when provided).data.image_urls[0]for the image URL, withbase_resp.status_code(success =0),metadata.success_count, andmetadata.failed_countsurfaced in the logs.Files
scripts/clawra-selfie.tsandskill/scripts/clawra-selfie.ts(kept in sync): addedgenerateImageMiniMax, provider dispatch ingenerateAndSend, MiniMax types, and updated CLI usage text.scripts/clawra-selfie.shandskill/scripts/clawra-selfie.sh(kept in sync): added theminimaxprovider branch with regional endpoint/model validation, request body built with the documented fields, anddata.image_urls/base_resp.status_code/metadataparsing.SKILL.mdandskill/SKILL.md(kept in sync): documented both providers, the MiniMax regional endpoints, models, request fields, and response fields.Checks
npx tsc --noEmit --target es2020 --module commonjs --moduleResolution node --esModuleInterop --skipLibCheck --strict scripts/clawra-selfie.ts-> passed (exit 0).bash -non bothscripts/clawra-selfie.shandskill/scripts/clawra-selfie.sh-> passed.MINIMAX_API_KEY, invalidMINIMAX_REGION, and invalidMINIMAX_MODELeach exit with a clear error.data.image_urls,base_resp.status_code,metadata.success_count/failed_count) with a sample response.