Skip to content

Qwen3.5-VL block: accept selectors for prompt / system_prompt#2408

Draft
nathan-marraccini wants to merge 1 commit into
mainfrom
qwen3-5vl-selector-prompts
Draft

Qwen3.5-VL block: accept selectors for prompt / system_prompt#2408
nathan-marraccini wants to merge 1 commit into
mainfrom
qwen3-5vl-selector-prompts

Conversation

@nathan-marraccini
Copy link
Copy Markdown
Contributor

What

Make the prompt and system_prompt fields on the roboflow_core/qwen3_5vl@v1 block accept workflow selector references ($inputs.X, $steps.X.Y), not just literal strings.

prompt: Optional[Union[Selector(kind=[STRING_KIND]), str]]
system_prompt: Optional[Union[Selector(kind=[STRING_KIND]), str]]

Why

Both fields were declared as plain Optional[str], so they only accepted literal strings. When a forked workflow step references $inputs.prompt, the block received the literal text "$inputs.prompt" instead of the resolved value — so the platform's fork-with-input_defaults flow couldn't thread user-supplied prompts through.

This is the exact mechanism that already works for SAM3's classes field, and it unblocks the Add Qwen 3.5 VL to open-source models page PR on the platform side (roboflow/roboflow#11713): the endpoint modal's System Prompt / Prompt inputs can only reach the block once these fields accept selectors.

Approach

This is the same Union[Selector(...), str] pattern already used by:

  • model_version on this very block, and
  • the prompt field on the GLM-OCR block.

Literal strings still validate, so the change is backwards compatible and needs no new block version. run() is unchanged — the execution engine resolves selectors before invoking it, so it still receives a plain string.

Verification

  • /workflows/blocks/describe now reports reference: true + the selector pattern on prompt and system_prompt, same as model_version.
  • Added manifest unit tests (tests/.../foundation/test_qwen3_5vl.py) covering literal, $inputs.X, and $steps.X.Y references, optional defaults, and the schema advertising selector support. 5/5 passing locally.

Deploy note

Once merged + released + deployed to the inference servers, the platform PR (#11713) lights up with no platform-side changes.

🤖 Generated with Claude Code

The prompt and system_prompt fields were declared as plain Optional[str],
so they only accepted literal strings — a workflow step referencing
$inputs.prompt would receive the literal text "$inputs.prompt" instead of
the resolved value. This blocks the platform's fork-with-input_defaults
flow from threading user-supplied prompts through (the same flow that
already works for SAM3's classes).

Widen both fields to Optional[Union[Selector(kind=[STRING_KIND]), str]],
matching the pattern already used by model_version here and by the GLM-OCR
prompt field. Literal strings still validate, so this is backwards
compatible and needs no new block version. run() is unchanged — the engine
resolves selectors before invoking it.

Adds manifest unit tests covering literal, $inputs, and $steps references
and asserting the schema advertises selector support (reference: true).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nathan-marraccini nathan-marraccini force-pushed the qwen3-5vl-selector-prompts branch from 6c05c9e to cf1e969 Compare June 3, 2026 15:28
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