Haolong Li
commited on
Commit
·
c2e606e
1
Parent(s):
113647d
Upload 3 files
Browse files- DoNothingAtomicFlow.py +26 -0
- DoNothingAtomicFlow.yaml +3 -0
- __init__.py +1 -0
DoNothingAtomicFlow.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import traceback
|
| 2 |
+
from copy import deepcopy
|
| 3 |
+
from typing import Dict, Any
|
| 4 |
+
|
| 5 |
+
from flows.base_flows import AtomicFlow
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class DoNothingAtomicFlow(AtomicFlow):
|
| 9 |
+
def __init__(self,
|
| 10 |
+
**kwargs):
|
| 11 |
+
super().__init__(**kwargs)
|
| 12 |
+
|
| 13 |
+
@classmethod
|
| 14 |
+
def instantiate_from_config(cls, config):
|
| 15 |
+
flow_config = deepcopy(config)
|
| 16 |
+
|
| 17 |
+
kwargs = {"flow_config": flow_config}
|
| 18 |
+
|
| 19 |
+
# ~~~ Instantiate flow ~~~
|
| 20 |
+
return cls(**kwargs)
|
| 21 |
+
|
| 22 |
+
def run(
|
| 23 |
+
self,
|
| 24 |
+
input_data: Dict[str, Any]):
|
| 25 |
+
response = input_data.copy()
|
| 26 |
+
return {"donothing_output": response}
|
DoNothingAtomicFlow.yaml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: "DoNothingAtomicFlow"
|
| 2 |
+
description: "A flow that returns exactly the input data"
|
| 3 |
+
|
__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from DoNothingAtomicFlow import DoNothingAtomicFlow
|