v1.1.0
Browse files
run.py
CHANGED
|
@@ -11,7 +11,7 @@ from aiflows.utils.general_helpers import read_yaml_file, quick_load_api_keys
|
|
| 11 |
from aiflows import logging
|
| 12 |
from aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
|
| 13 |
|
| 14 |
-
from aiflows.utils import
|
| 15 |
from aiflows.workers import run_dispatch_worker_thread
|
| 16 |
from aiflows.messages import FlowMessage
|
| 17 |
from aiflows.interfaces import KeyInterface
|
|
@@ -60,19 +60,19 @@ if __name__ == "__main__":
|
|
| 60 |
#3. ~~~~ Serve The Flow ~~~~
|
| 61 |
|
| 62 |
|
| 63 |
-
#
|
| 64 |
# cl = cl,
|
| 65 |
# flow_class_name="flow_modules.aiflows.ControllerExecutorFlowModule.WikiSearchAtomicFlow",
|
| 66 |
# flow_endpoint="WikiSearchAtomicFlow",
|
| 67 |
# )
|
| 68 |
|
| 69 |
-
#
|
| 70 |
# cl = cl,
|
| 71 |
# flow_class_name="flow_modules.aiflows.ControllerExecutorFlowModule.ControllerAtomicFlow",
|
| 72 |
# flow_endpoint="ControllerAtomicFlow",
|
| 73 |
# )
|
| 74 |
|
| 75 |
-
|
| 76 |
cl = cl,
|
| 77 |
flow_class_name="flow_modules.aiflows.ControllerExecutorFlowModule.ControllerExecutorFlow",
|
| 78 |
flow_endpoint="ControllerExecutorFlow",
|
|
@@ -82,7 +82,7 @@ if __name__ == "__main__":
|
|
| 82 |
run_dispatch_worker_thread(cl)
|
| 83 |
|
| 84 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
| 85 |
-
proxy_flow=
|
| 86 |
cl=cl,
|
| 87 |
flow_endpoint="ControllerExecutorFlow",
|
| 88 |
user_id="local",
|
|
@@ -127,5 +127,5 @@ if __name__ == "__main__":
|
|
| 127 |
|
| 128 |
|
| 129 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
| 130 |
-
#
|
| 131 |
|
|
|
|
| 11 |
from aiflows import logging
|
| 12 |
from aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
|
| 13 |
|
| 14 |
+
from aiflows.utils import serving
|
| 15 |
from aiflows.workers import run_dispatch_worker_thread
|
| 16 |
from aiflows.messages import FlowMessage
|
| 17 |
from aiflows.interfaces import KeyInterface
|
|
|
|
| 60 |
#3. ~~~~ Serve The Flow ~~~~
|
| 61 |
|
| 62 |
|
| 63 |
+
# serving.recursive_serve_flow(
|
| 64 |
# cl = cl,
|
| 65 |
# flow_class_name="flow_modules.aiflows.ControllerExecutorFlowModule.WikiSearchAtomicFlow",
|
| 66 |
# flow_endpoint="WikiSearchAtomicFlow",
|
| 67 |
# )
|
| 68 |
|
| 69 |
+
# serving.serve_flow(
|
| 70 |
# cl = cl,
|
| 71 |
# flow_class_name="flow_modules.aiflows.ControllerExecutorFlowModule.ControllerAtomicFlow",
|
| 72 |
# flow_endpoint="ControllerAtomicFlow",
|
| 73 |
# )
|
| 74 |
|
| 75 |
+
serving.recursive_serve_flow(
|
| 76 |
cl = cl,
|
| 77 |
flow_class_name="flow_modules.aiflows.ControllerExecutorFlowModule.ControllerExecutorFlow",
|
| 78 |
flow_endpoint="ControllerExecutorFlow",
|
|
|
|
| 82 |
run_dispatch_worker_thread(cl)
|
| 83 |
|
| 84 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
| 85 |
+
proxy_flow= serving.get_flow_instance(
|
| 86 |
cl=cl,
|
| 87 |
flow_endpoint="ControllerExecutorFlow",
|
| 88 |
user_id="local",
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
| 130 |
+
# serving.delete_served_flow(cl, "FlowModule")
|
| 131 |
|