v1.1.0
Browse files
run.py
CHANGED
@@ -9,7 +9,7 @@ from aiflows.utils.general_helpers import read_yaml_file, quick_load_api_keys
|
|
9 |
from aiflows import logging
|
10 |
from aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
|
11 |
|
12 |
-
from aiflows.utils import
|
13 |
from aiflows.workers import run_dispatch_worker_thread
|
14 |
from aiflows.messages import FlowMessage
|
15 |
from aiflows.interfaces import KeyInterface
|
@@ -56,7 +56,7 @@ if __name__ == "__main__":
|
|
56 |
|
57 |
#3. ~~~~ Serve The Flow ~~~~
|
58 |
|
59 |
-
|
60 |
cl = cl,
|
61 |
flow_class_name="flow_modules.aiflows.ChatWithDemonstrationsFlowModule.ChatWithDemonstrationsFlow",
|
62 |
flow_endpoint="ChatWithDemonstrationsFlow",
|
@@ -67,7 +67,7 @@ if __name__ == "__main__":
|
|
67 |
run_dispatch_worker_thread(cl)
|
68 |
|
69 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
70 |
-
proxy_flow=
|
71 |
cl=cl,
|
72 |
flow_endpoint="ChatWithDemonstrationsFlow",
|
73 |
user_id="local",
|
@@ -102,4 +102,4 @@ if __name__ == "__main__":
|
|
102 |
|
103 |
|
104 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
105 |
-
#
|
|
|
9 |
from aiflows import logging
|
10 |
from aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
|
11 |
|
12 |
+
from aiflows.utils import serving
|
13 |
from aiflows.workers import run_dispatch_worker_thread
|
14 |
from aiflows.messages import FlowMessage
|
15 |
from aiflows.interfaces import KeyInterface
|
|
|
56 |
|
57 |
#3. ~~~~ Serve The Flow ~~~~
|
58 |
|
59 |
+
serving.recursive_serve_flow(
|
60 |
cl = cl,
|
61 |
flow_class_name="flow_modules.aiflows.ChatWithDemonstrationsFlowModule.ChatWithDemonstrationsFlow",
|
62 |
flow_endpoint="ChatWithDemonstrationsFlow",
|
|
|
67 |
run_dispatch_worker_thread(cl)
|
68 |
|
69 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
70 |
+
proxy_flow= serving.get_flow_instance(
|
71 |
cl=cl,
|
72 |
flow_endpoint="ChatWithDemonstrationsFlow",
|
73 |
user_id="local",
|
|
|
102 |
|
103 |
|
104 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
105 |
+
# serving.delete_served_flow(cl, "ChatWithDemonstrationFlowModule")
|