Clean Versions
Browse files- LCToolFlow.py +2 -4
- run.py +9 -13
LCToolFlow.py
CHANGED
@@ -85,10 +85,8 @@ class LCToolFlow(AtomicFlow):
|
|
85 |
def run(self, input_message: FlowMessage):
|
86 |
""" This method runs the flow. It runs the backend on the input data.
|
87 |
|
88 |
-
:param
|
89 |
-
:type
|
90 |
-
:return: The output data of the flow.
|
91 |
-
:rtype: Dict[str, Any]
|
92 |
"""
|
93 |
input_data = input_message.data
|
94 |
observation = self.backend.run(tool_input=input_data)
|
|
|
85 |
def run(self, input_message: FlowMessage):
|
86 |
""" This method runs the flow. It runs the backend on the input data.
|
87 |
|
88 |
+
:param input_message: The input message of the flow.
|
89 |
+
:type input_message: FlowMessage
|
|
|
|
|
90 |
"""
|
91 |
input_data = input_message.data
|
92 |
observation = self.backend.run(tool_input=input_data)
|
run.py
CHANGED
@@ -45,24 +45,20 @@ if __name__ == "__main__":
|
|
45 |
#3. ~~~~ Serve The Flow ~~~~
|
46 |
serve_utils.serve_flow(
|
47 |
cl = cl,
|
48 |
-
|
49 |
-
|
50 |
-
default_state=None,
|
51 |
-
default_dispatch_point="coflows_dispatch"
|
52 |
)
|
53 |
|
54 |
#4. ~~~~~Start A Worker Thread~~~~~
|
55 |
-
run_dispatch_worker_thread(cl
|
56 |
|
57 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
58 |
-
proxy_flow
|
59 |
cl=cl,
|
60 |
-
|
61 |
-
|
62 |
-
config_overrides=
|
63 |
-
|
64 |
-
dispatch_point_override=None,
|
65 |
-
)
|
66 |
|
67 |
|
68 |
#6. ~~~ Get the data ~~~
|
@@ -97,4 +93,4 @@ if __name__ == "__main__":
|
|
97 |
|
98 |
|
99 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
100 |
-
# serve_utils.delete_served_flow(cl, "
|
|
|
45 |
#3. ~~~~ Serve The Flow ~~~~
|
46 |
serve_utils.serve_flow(
|
47 |
cl = cl,
|
48 |
+
flow_class_name="flow_modules.aiflows.LCToolFlowModule.LCToolFlow",
|
49 |
+
flow_endpoint="LCToolFlow",
|
|
|
|
|
50 |
)
|
51 |
|
52 |
#4. ~~~~~Start A Worker Thread~~~~~
|
53 |
+
run_dispatch_worker_thread(cl)
|
54 |
|
55 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
56 |
+
proxy_flow= serve_utils.get_flow_instance(
|
57 |
cl=cl,
|
58 |
+
flow_endpoint="LCToolFlow",
|
59 |
+
user_id="local",
|
60 |
+
config_overrides = cfg
|
61 |
+
)
|
|
|
|
|
62 |
|
63 |
|
64 |
#6. ~~~ Get the data ~~~
|
|
|
93 |
|
94 |
|
95 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
96 |
+
# serve_utils.delete_served_flow(cl, "LCToolFlow")
|