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
|
|
@@ -57,7 +57,7 @@ if __name__ == "__main__":
|
|
| 57 |
|
| 58 |
|
| 59 |
#3. ~~~~ Serve The Flow ~~~~
|
| 60 |
-
|
| 61 |
cl = cl,
|
| 62 |
flow_class_name="flow_modules.aiflows.VectorStoreFlowModule.ChromaDBFlow",
|
| 63 |
flow_endpoint="ChromaDBFlow",
|
|
@@ -68,7 +68,7 @@ if __name__ == "__main__":
|
|
| 68 |
|
| 69 |
|
| 70 |
#5 ~~~~~Mount the flow and get its proxy~~~~~~
|
| 71 |
-
proxy_flow_cdb=
|
| 72 |
cl=cl,
|
| 73 |
flow_endpoint="ChromaDBFlow",
|
| 74 |
user_id="local",
|
|
@@ -76,7 +76,7 @@ if __name__ == "__main__":
|
|
| 76 |
)
|
| 77 |
|
| 78 |
#3.(2) ~~~~ Serve The Flow ~~~~
|
| 79 |
-
|
| 80 |
cl = cl,
|
| 81 |
flow_class_name="flow_modules.aiflows.VectorStoreFlowModule.VectorStoreFlow",
|
| 82 |
flow_endpoint="VectorStoreFlow",
|
|
@@ -87,7 +87,7 @@ if __name__ == "__main__":
|
|
| 87 |
run_dispatch_worker_thread(cl)
|
| 88 |
|
| 89 |
#5.(2) ~~~~~Mount the flow and get its proxy~~~~~~
|
| 90 |
-
proxy_flow_vs=
|
| 91 |
cl=cl,
|
| 92 |
flow_endpoint="VectorStoreFlow",
|
| 93 |
user_id="local",
|
|
@@ -144,4 +144,4 @@ if __name__ == "__main__":
|
|
| 144 |
|
| 145 |
|
| 146 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
| 147 |
-
#
|
|
|
|
| 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
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
#3. ~~~~ Serve The Flow ~~~~
|
| 60 |
+
serving.serve_flow(
|
| 61 |
cl = cl,
|
| 62 |
flow_class_name="flow_modules.aiflows.VectorStoreFlowModule.ChromaDBFlow",
|
| 63 |
flow_endpoint="ChromaDBFlow",
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
#5 ~~~~~Mount the flow and get its proxy~~~~~~
|
| 71 |
+
proxy_flow_cdb= serving.get_flow_instance(
|
| 72 |
cl=cl,
|
| 73 |
flow_endpoint="ChromaDBFlow",
|
| 74 |
user_id="local",
|
|
|
|
| 76 |
)
|
| 77 |
|
| 78 |
#3.(2) ~~~~ Serve The Flow ~~~~
|
| 79 |
+
serving.serve_flow(
|
| 80 |
cl = cl,
|
| 81 |
flow_class_name="flow_modules.aiflows.VectorStoreFlowModule.VectorStoreFlow",
|
| 82 |
flow_endpoint="VectorStoreFlow",
|
|
|
|
| 87 |
run_dispatch_worker_thread(cl)
|
| 88 |
|
| 89 |
#5.(2) ~~~~~Mount the flow and get its proxy~~~~~~
|
| 90 |
+
proxy_flow_vs= serving.get_flow_instance(
|
| 91 |
cl=cl,
|
| 92 |
flow_endpoint="VectorStoreFlow",
|
| 93 |
user_id="local",
|
|
|
|
| 144 |
|
| 145 |
|
| 146 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
| 147 |
+
# serving.delete_served_flow(cl, "FlowModule")
|