Update run_planwriter.py
Browse files- run_planwriter.py +10 -12
run_planwriter.py
CHANGED
|
@@ -2,12 +2,13 @@ import os
|
|
| 2 |
|
| 3 |
import hydra
|
| 4 |
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
-
from
|
| 8 |
|
| 9 |
-
from
|
| 10 |
-
from
|
|
|
|
| 11 |
|
| 12 |
CACHING_PARAMETERS.do_caching = False # Set to True in order to disable caching
|
| 13 |
# clear_cache() # Uncomment this line to clear the cache
|
|
@@ -22,7 +23,7 @@ dependencies = [
|
|
| 22 |
{"url": "aiflows/ChatFlowModule", "revision": "a749ad10ed39776ba6721c37d0dc22af49ca0f17"},
|
| 23 |
]
|
| 24 |
|
| 25 |
-
from
|
| 26 |
|
| 27 |
flow_verse.sync_dependencies(dependencies)
|
| 28 |
|
|
@@ -32,15 +33,12 @@ if __name__ == "__main__":
|
|
| 32 |
api_information = [ApiInfo(backend_used="openai", api_key=os.getenv("OPENAI_API_KEY"))]
|
| 33 |
path_to_output_file = None
|
| 34 |
|
| 35 |
-
# ~~~ setting api information into config ~~~
|
| 36 |
current_dir = os.getcwd()
|
| 37 |
cfg_path = os.path.join(current_dir, "PlanWriterFlow.yaml")
|
| 38 |
cfg = read_yaml_file(cfg_path)
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
# # ~~~ setting memory file of planner (empty dict)~~~
|
| 43 |
-
# cfg["subflows_config"]["Executor"]["subflows_config"]["write_plan"]["memory_files"] = {}
|
| 44 |
|
| 45 |
# ~~~ instantiating the flow and input data ~~~
|
| 46 |
PlanWriterFlow = hydra.utils.instantiate(cfg, _recursive_=False, _convert_="partial")
|
|
|
|
| 2 |
|
| 3 |
import hydra
|
| 4 |
|
| 5 |
+
from aiflows.backends.api_info import ApiInfo
|
| 6 |
+
from aiflows.messages import InputMessage
|
| 7 |
+
from aiflows.utils.general_helpers import read_yaml_file
|
| 8 |
|
| 9 |
+
from aiflows import logging
|
| 10 |
+
from aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
|
| 11 |
+
from aiflows.utils.general_helpers import update_api_infos
|
| 12 |
|
| 13 |
CACHING_PARAMETERS.do_caching = False # Set to True in order to disable caching
|
| 14 |
# clear_cache() # Uncomment this line to clear the cache
|
|
|
|
| 23 |
{"url": "aiflows/ChatFlowModule", "revision": "a749ad10ed39776ba6721c37d0dc22af49ca0f17"},
|
| 24 |
]
|
| 25 |
|
| 26 |
+
from aiflows import flow_verse
|
| 27 |
|
| 28 |
flow_verse.sync_dependencies(dependencies)
|
| 29 |
|
|
|
|
| 33 |
api_information = [ApiInfo(backend_used="openai", api_key=os.getenv("OPENAI_API_KEY"))]
|
| 34 |
path_to_output_file = None
|
| 35 |
|
|
|
|
| 36 |
current_dir = os.getcwd()
|
| 37 |
cfg_path = os.path.join(current_dir, "PlanWriterFlow.yaml")
|
| 38 |
cfg = read_yaml_file(cfg_path)
|
| 39 |
+
|
| 40 |
+
# ~~~ setting api information into config ~~~
|
| 41 |
+
update_api_infos(cfg, api_information)
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# ~~~ instantiating the flow and input data ~~~
|
| 44 |
PlanWriterFlow = hydra.utils.instantiate(cfg, _recursive_=False, _convert_="partial")
|