feat(sdkx/llm): add image-generation adapters + align chat caps#72
Merged
Conversation
Catalog alignment (chat models, all text-only output): - openai / anthropic / deepseek / qwen / minimax (M2 chat) / bytedance (Doubao Seed chat) — DisabledCaps now also includes CapImageOutput and CapAudioOutput so the new output-modality capabilities introduced in sdk v0.2.8 default to "not supported" on every existing chat catalog rather than silently advertising image / audio output. Verified against each provider's current public model list (2026-04-30). New image-generation adapters (each implements llm.LLM and uses the public llm.NewOneChunkStream wrapper from sdk v0.2.8): - sdkx/llm/minimax/image — registers provider key "minimax-image" with image-01 / image-01-live; targets MiniMax's /v1/image_generation endpoint; handles subject_reference URLs for image-to-image. - sdkx/llm/bytedance/image — registers provider key "bytedance-image" with the Doubao Seedream 5.0 / 5.0-lite / 4.5 / 4.0 lineup; targets Volc Ark's /api/v3/images/generations endpoint; serializes single vs. multi reference images and enforces the refs+N <= 15 limit; surfaces optimize_prompt_mode / web_search / output_format via llm.WithExtra. - sdkx/llm/qwen/image — registers provider key "qwen-image" with the Qwen-Image 2.0 Pro / 2.0 / Max / Plus / qwen-image lineup; targets DashScope's /api/v1/services/aigc/multimodal-generation/generation endpoint; defaults to the Beijing region (https://dashscope.aliyuncs.com) with Singapore reachable via base_url override; rejects PartImage inputs with a typed validation error since image editing is on the separate qwen-image-edit endpoint not yet adapted. Each adapter ships with its own DisabledCaps profile (CapVision + CapImageOutput on, all chat-completion knobs off), structured errdefs error mapping for the provider's documented error codes, gofmt-stable doc.go, and unit tests against an httptest server. Bumps the sdk dependency to v0.2.8 to pick up the CapImageOutput / CapAudioOutput / ImageGenOptions / NewOneChunkStream surface. Co-authored-by: Cursor <cursoragent@cursor.com>
sdkx now requires sdk v0.2.8 (PR #71); the local replace makes the e2e module pick up that requirement transitively, so its indirect line needs syncing. CI was failing the 'go: updates to go.mod needed' check before this. Co-authored-by: Cursor <cursoragent@cursor.com>
…ed versions Only replace modules that have no published version we can pin against. sdk / sdkx / vessel are all published, so the e2e suite should depend on their tagged versions and treat in-flight library PRs as out-of-scope. Without this, every sdkx PR (e.g. #72 adding image adapters) would also need to bump the indirect sdk version pinned in this go.mod just to keep CI green — the canonical 'cross-module bleed' the auto-tag workflow already tries to prevent. cmd/vesseld stays replaced because it is intentionally never tagged as a Go module (ships as a binary, see auto-tag.yml). Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced May 7, 2026
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.
Summary
Builds on the new sdk/llm primitives shipped in
sdk/v0.2.8(#71)to deliver three production image-generation adapters and align
existing chat catalogs with the new output-modality capabilities.
Catalog alignment (chat models, text-only output)
openai/anthropic/deepseek/qwen/minimax(M2 chat)/
bytedance(Doubao Seed chat) —DisabledCapsnow alsodisables
CapImageOutputandCapAudioOutput. Without this, theblacklist semantics would silently advertise image / audio output
on every chat-only catalog. Verified against each provider's
current public model list (2026-04-30).
New image-generation adapters
minimax-imagesdkx/llm/minimax/image/v1/image_generationimage-01/image-01-live; subject_reference for i2ibytedance-imagesdkx/llm/bytedance/image/api/v3/images/generationsqwen-imagesdkx/llm/qwen/image/api/v1/services/aigc/multimodal-generation/generationPartImageinputs (t2i-only contract)Each adapter:
llm.LLMinterface.llm.NewOneChunkStreamhelper to satisfyllm.StreamMessage.DisabledCapsprofile (CapVision + CapImageOutputon, every chat-completion knob off).
errdefscategories.doc.goand a self-contained unittest suite using
httptest.Provider keys are deliberately distinct from chat keys
minimax-image(vsminimax),bytedance-image(vsbytedance),qwen-image(vsqwen). This keeps the capability matrix clean —chat catalogs advertise text-only output, image catalogs advertise
CapImageOutput. Same upstream API key works for both pools butthey are tracked independently for routing / rate-limit purposes.
Dependency bump
sdkx/go.mod:github.com/GizClaw/flowcraft/sdk→v0.2.8Pulls in the new
CapImageOutput/CapAudioOutput/ImageGenOptions/NewOneChunkStreamsurface that this PRconsumes.
Test plan
cd sdkx && GOWORK=off go vet ./...cd sdkx && GOWORK=off go test ./llm/... -count=1 -racetests/conformance/llm/image_test.go(5 scenarios × 3 providers, all green; saved sample images
verified visually).
Follow-ups
tests/conformance: bump sdkx pin to the upcoming sdkx tag anddrop the local
replacedirectives. Will land once auto-tagpublishes the sdkx version produced by this PR's merge.
Made with Cursor