Skip to content

feat: add MiniMax image_generation provider - #23

Open
octo-patch wants to merge 2 commits into
sumelabs:mainfrom
octo-patch:octo/20260728-text-to-image-tool-recvq4C1kNSN61
Open

feat: add MiniMax image_generation provider#23
octo-patch wants to merge 2 commits into
sumelabs:mainfrom
octo-patch:octo/20260728-text-to-image-tool-recvq4C1kNSN61

Conversation

@octo-patch

Copy link
Copy Markdown

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 PROVIDER environment variable (grok default, or minimax).

MiniMax image_generation integration

  • Regional endpoints: global_en -> https://api.minimax.io/v1/image_generation and cn_zh -> https://api.minimaxi.com/v1/image_generation, selected via MINIMAX_REGION.
  • Models: image-01 (default) and image-01-live, selected via MINIMAX_MODEL.
  • Authorization: Bearer $MINIMAX_API_KEY.
  • Request fields: model, prompt, subject_reference, aspect_ratio, width, height, response_format, seed, n, prompt_optimizer (optional fields included only when provided).
  • Response parsing: data.image_urls[0] for the image URL, with base_resp.status_code (success = 0), metadata.success_count, and metadata.failed_count surfaced in the logs.

Files

  • scripts/clawra-selfie.ts and skill/scripts/clawra-selfie.ts (kept in sync): added generateImageMiniMax, provider dispatch in generateAndSend, MiniMax types, and updated CLI usage text.
  • scripts/clawra-selfie.sh and skill/scripts/clawra-selfie.sh (kept in sync): added the minimax provider branch with regional endpoint/model validation, request body built with the documented fields, and data.image_urls / base_resp.status_code / metadata parsing.
  • SKILL.md and skill/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 -n on both scripts/clawra-selfie.sh and skill/scripts/clawra-selfie.sh -> passed.
  • Verified provider validation paths: missing MINIMAX_API_KEY, invalid MINIMAX_REGION, and invalid MINIMAX_MODEL each exit with a clear error.
  • Verified MiniMax response parsing (data.image_urls, base_resp.status_code, metadata.success_count / failed_count) with a sample response.

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.
@octo-patch

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant