flowno.decorators.single_output
Single output node creation utilities for Flowno.
This module provides utilities for creating single output nodes, which are used
internally by the flowno.decorators.node
module. These utilities help
transform async functions or classes into DraftNode subclasses with single outputs.
For more information and examples, see the flowno.decorators.node
module.
- flowno.decorators.single_output.create_class_node_subclass_single(cls: type[ClassCall[Unpack, _ReturnT_co]], stream_in: list[str]) type[MonoNode[Unpack, tuple[_ReturnT_co]]] | type[StreamingNode[Unpack, tuple[_ReturnT_co]]] [source]
Create a DraftNode subclass for a class with a single output.
- Parameters:
cls – The class to transform
stream_in – List of input streams
- Returns:
A DraftNode subclass
- flowno.decorators.single_output.create_func_node_factory_single(func: Callable[[Unpack], Coroutine[object, object, _ReturnT_co]] | Callable[[Unpack], AsyncGenerator[_ReturnT_co, None]], stream_in: list[str]) type[DraftNode[Unpack, Tuple[_ReturnT_co]]] [source]
Create a DraftNode subclass for a function with a single output.
- Parameters:
func – The function to transform
stream_in – List of input streams
- Returns:
A DraftNode subclass