preview_flow
Check whether a flow can be wired together, and see what create_flow would produce — without creating anything. Returns compatibility, per-model wiring, required inputs and final outputs, plus the node structure and connections. Takes the same nodes and connections arguments as create_flow, so a hand-wired graph can be checked before it is created: a port-type mismatch comes back with the model's real port layout instead of a failed create.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodes | Yes | JSON array of models IN ORDER. Two formats: (1) SHORTHAND: '["ModelA","ModelB"]' (2) FULL: '[{"id":1,"type":"ai_model","model_id":"ModelA"}]'. Same as create_flow: FULL nodes may declare input/output nodes too ({"id":1,"type":"input","model_id":"Image-Loader"}), and the preview then reports that graph instead of generating one. | |
| connections | No | JSON array of explicit connections, same shape as create_flow: [{"out_node_id":1,"out_port_index":0,"in_node_id":2,"in_port_index":0}]. Pass the wiring you intend to create and the preview judges it by the same rules create_flow uses. | |
| include_optional | No | Whether to auto-generate input nodes for OPTIONAL model input ports. Default true: every optional port also gets its own loader node (e.g. a multimodal model with an optional image input gets an Image-Loader). Set false to scaffold only REQUIRED inputs. DECIDE this yourself from the task — you do not need the user to ask: set false when the goal clearly uses only some modalities (e.g. 'summarize this text' on a text+optional-image model → skip the image loader), or when the user's input_files cover only the required ports. Keep true when the goal is genuinely multimodal, when the user supplied inputs for optional ports, or when you are unsure — so no modality is silently dropped. When in doubt, leave it true (or omit). |