Skip to content

fix: inline http(s) image URLs for Moonshot vision models#2931

Merged
ProgrammerIn-wonderland merged 1 commit intoHeyPuter:mainfrom
devareddy05:fix/moonshot-vision-inline-http-image-urls
May 6, 2026
Merged

fix: inline http(s) image URLs for Moonshot vision models#2931
ProgrammerIn-wonderland merged 1 commit intoHeyPuter:mainfrom
devareddy05:fix/moonshot-vision-inline-http-image-urls

Conversation

@devareddy05
Copy link
Copy Markdown
Contributor

Fixes #2929.

Moonshot/Kimi vision API only accepts base64 data URIs or file-id refs, not http(s) URLs (docs). So puter.ai.chat(..., "https://...img", { model: "moonshotai/moonshot-v1-128k-vision-preview" }) failed at the upstream and bubbled up as All providers failed (Moonshot is the only provider for these models).

Inlines http(s) image URLs to base64 via the existing SSRF-guarded secureFetch before the request. Gated on model.modalities.input including 'image' — text-only requests untouched. Failures fall back to inline text-error blocks, same convention as openai/fileUpload.ts. Adds 6 unit tests.

@ProgrammerIn-wonderland ProgrammerIn-wonderland merged commit 7a1a885 into HeyPuter:main May 6, 2026
1 check passed
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.

All providers failed error for moonshotai vision model

2 participants