text chat: expose image input (enable multimodal M3, incl. multi-image)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu từ src/commands/text/chat.ts, đặc biệt là parseMessages và trình dựng phần thân chat, sau đó kiểm tra src/utils/image.ts và cách xử lý vision describe image hiện có. Thêm đầu vào hình ảnh có thể lặp lại bằng đường dẫn cục bộ hoặc URL, tạo ra Anthropic image blocks, hỗ trợ nhiều hình ảnh và mặc định sử dụng MiniMax-M3 khi cần; hoàn thành khi chat văn bản có thể gửi một hoặc nhiều hình ảnh mà không cần tệp messages JSON.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
mmx text chat uses the multimodal MiniMax-M3 model by default, but the CLI exposes no image input flag. Users cannot send an image (let alone multiple images) to M3 through text chat without hand-writing a base64 messages JSON file. Since M3 is multimodal, this is a significant hidden capability.
Current behavior
mmx text chatonly accepts text:--message,--messages-file,--system. There is no--imageflag.parseMessages(src/commands/text/chat.ts) passescontentthrough asstring | ContentBlock[], so image blocks can reach the API via--messages-file— but the CLI does no image handling (no path→base64 conversion, unlikevision describe).- For single-image description there is
mmx vision describe(which hits/v1/coding_plan/vlm, single-image only). - No CLI path exists for multi-image input (compare/diff/joint analysis of 2+ images in one call), even though M3 supports it.
Expected behavior
A first-class image input on text chat, e.g.:
# single image
mmx text chat --model MiniMax-M3 --image ./photo.jpg --message "What breed is this dog?"
# multiple images (repeatable)
mmx text chat --model MiniMax-M3 \
--image ./before.png --image ./after.png \
--message "List every visual difference between these two."
The flag should accept local paths / http(s) URLs and auto base64-encode them (reusing toDataUri from src/utils/image.ts), then inject them as image content blocks alongside the text message.
Evidence — multi-image already works via M3
I verified that M3 accepts multiple images in one call through mmx text chat --messages-file. Example (CN region, API key auth):
node -e '
const fs = require("fs");
const img = (p) => ({ type: "image", source: { type: "base64", media_type: "image/png", data: fs.readFileSync(p).toString("base64") } });
fs.writeFileSync("/tmp/m.json", JSON.stringify([{
role: "user",
content: [
{ type: "text", text: "I am giving you TWO images. Describe one detail unique to each." },
img("/tmp/a.png"), img("/tmp/b.png")
]
}]));
'
mmx text chat --model MiniMax-M3 --messages-file /tmp/m.json --non-interactive --quiet
# → M3 correctly describes both images and distinguishes them
Format gotcha worth surfacing
mmx text chat posts to the Anthropic /messages endpoint (chatEndpoint returns ${baseUrl}/anthropic/v1/messages), not the OpenAI /chat/completions endpoint. So image content blocks must use the Anthropic shape:
// ❌ OpenAI shape — rejected: "unsupported content type 'image_url'"
{ "type": "image_url", "image_url": { "url": "data:..." } }
// ✅ Anthropic shape — works
{ "type": "image", "source": { "type": "base64", "media_type": "image/png", "data": "<base64>" } }
The OpenAI-compatible image format documented at https://platform.minimaxi.com/docs/api-reference/text-openai-api (type: "image_url") does not work through this CLI's text chat, because the CLI routes to the Anthropic endpoint. This mismatch took a while to debug — a --image flag that auto-formats correctly (or at least a doc note) would help a lot.
Suggested implementation
- Add a repeatable
--image <path-or-url>flag totext chat. - In
parseMessages/ the chat body builder, convert each--imageviatoDataUri, then append{ type: "image", source: { type: "base64", media_type, data } }blocks to the user message'scontent(convertingcontentfrom string to array when images are present). - When
--imageis present, default--modeltoMiniMax-M3if not set. - Optionally reuse the same
--imageflag on a futurevisionsubcommand for multi-image, since M3's chat path strictly supersedes the single-image/vlmendpoint for multi-image use cases.
Happy to open a PR if this design sounds reasonable.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.2k
- Fork
- 181
- Merge trung bình
- 9 giờ 4 phút
- Pull request đã merge (30 ngày)
- 13
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MiniMax-AI/cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
MiniMax-AI/cli#259 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
MiniMax-AI/cli#258 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
MiniMax-AI/cli#265 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
MiniMax-AI/cli#260 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
MiniMax-AI/cli#257 · 1 bình luận ·
Tất cả issue của MiniMax-AI/cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/inspector#2458 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carbon-design-system/ibm-products#9907 ·