flowno.decorators.node_meta_multiple_dec
Node meta decoration for multiple-output Flowno nodes.
This module provides the node_meta_multiple_dec class, which handles the decorator logic for multiple-output node cases in the Flowno framework: - @node(multiple_outputs=True) - @node(multiple_outputs=True, stream_in=[…])
This is an internal implementation detail used by the flowno.decorators.node
decorator, not meant to be used directly. See the node decorator documentation for
complete usage information and examples.
- class flowno.decorators.node_meta_multiple_dec.node_meta_multiple_dec(stream_in: list[str] = [])[source]
- Handles the decorator logic for multiple-output cases:
@node(multiple_outputs=True)
@node(multiple_outputs=True, stream_in=…)
This class is returned by the @node() function when called with multiple_outputs=True, and implements __call__ to handle the actual function decoration. It creates appropriate DraftNode subclasses based on the decorated function and specified parameters.
- Parameters:
stream_in – List of parameter names that should be treated as streaming inputs
- Returns:
When called with a function, returns a DraftNode subclass factory for that function that preserves the tuple structure of multiple return values
- __call__(func: Callable[[Unpack], Coroutine[Any, Any, _ReturnTupleT_co]] | Callable[[Unpack], AsyncGenerator[_ReturnTupleT_co, None]]) type[DraftNode[Unpack, _ReturnTupleT_co]] [source]
Apply the decorator to the given function.
This method is called when the decorator is applied to a function. It delegates to create_func_node_factory_multiple to create a DraftNode subclass that preserves the tuple structure of multiple return values.
- Parameters:
func – The function to transform into a node
- Returns:
A DraftNode subclass factory for the decorated function