feat: implemented transient arguement for the coindex.flow_def decorator #1100
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.
Issue : #998
I have successfully implemented the transient argument for the @cocoindex.flow_def decorator as requested.
Updated flow_def decorator
Updated open_flow function
Updated _create_lazy_function
Created TransientFlowWrapper class
Now users can create transient flows like this :
@cocoindex.flow_def(name="MyFlow", transient=True)
def my_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
# Flow definition that works with inputs and produces outputs
# but doesn't maintain persistent state
pass