Qwen3.5-VL block: accept selectors for prompt / system_prompt#2408
Draft
nathan-marraccini wants to merge 1 commit into
Draft
Qwen3.5-VL block: accept selectors for prompt / system_prompt#2408nathan-marraccini wants to merge 1 commit into
nathan-marraccini wants to merge 1 commit into
Conversation
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>
6c05c9e to
cf1e969
Compare
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.
What
Make the
promptandsystem_promptfields on theroboflow_core/qwen3_5vl@v1block accept workflow selector references ($inputs.X,$steps.X.Y), not just literal strings.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_defaultsflow couldn't thread user-supplied prompts through.This is the exact mechanism that already works for SAM3's
classesfield, 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_versionon this very block, andpromptfield 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/describenow reportsreference: true+ the selectorpatternonpromptandsystem_prompt, same asmodel_version.tests/.../foundation/test_qwen3_5vl.py) covering literal,$inputs.X, and$steps.X.Yreferences, 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