blue-assistant 4.297.1__py3-none-any.whl → 4.307.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blue_assistant/.abcli/script/run.sh +1 -1
- blue_assistant/.abcli/tests/script_run.sh +2 -2
- blue_assistant/__init__.py +1 -1
- blue_assistant/script/actions/__init__.py +2 -2
- blue_assistant/script/actions/generate_image.py +4 -4
- blue_assistant/script/actions/generate_text.py +8 -4
- blue_assistant/script/actions/generic.py +3 -3
- blue_assistant/script/actions/web_crawl.py +3 -3
- blue_assistant/script/repository/__init__.py +4 -3
- blue_assistant/script/repository/base/classes.py +87 -29
- blue_assistant/script/repository/base/root.py +5 -0
- blue_assistant/script/repository/blue_amo/actions/__init__.py +2 -2
- blue_assistant/script/repository/blue_amo/actions/{slicing_into_frames.py → setting_frame_prompts.py} +5 -5
- blue_assistant/script/repository/blue_amo/classes.py +20 -34
- blue_assistant/script/repository/hue/classes.py +2 -2
- blue_assistant/script/repository/orbital_data_explorer/classes.py +2 -2
- {blue_assistant-4.297.1.dist-info → blue_assistant-4.307.1.dist-info}/METADATA +2 -2
- {blue_assistant-4.297.1.dist-info → blue_assistant-4.307.1.dist-info}/RECORD +21 -22
- blue_assistant/script/repository/generic/__init__.py +0 -1
- blue_assistant/script/repository/generic/classes.py +0 -88
- {blue_assistant-4.297.1.dist-info → blue_assistant-4.307.1.dist-info}/LICENSE +0 -0
- {blue_assistant-4.297.1.dist-info → blue_assistant-4.307.1.dist-info}/WHEEL +0 -0
- {blue_assistant-4.297.1.dist-info → blue_assistant-4.307.1.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ function blue_assistant_script_run() {
|
|
7
7
|
local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
|
8
8
|
|
9
9
|
local script_options=$2
|
10
|
-
local script_name=$(abcli_option "$script_options" script
|
10
|
+
local script_name=$(abcli_option "$script_options" script base)
|
11
11
|
|
12
12
|
local object_name=$(abcli_clarify_object $3 $script_name-$(abcli_string_timestamp_short))
|
13
13
|
[[ "$do_download" == 1 ]] &&
|
blue_assistant/__init__.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
from typing import Dict, Callable
|
2
2
|
|
3
|
-
from blue_assistant.script.repository.base.
|
3
|
+
from blue_assistant.script.repository.base.root import RootScript
|
4
4
|
from blue_assistant.script.actions.generic import generic_action
|
5
5
|
from blue_assistant.script.actions.generate_image import generate_image
|
6
6
|
from blue_assistant.script.actions.generate_text import generate_text
|
7
7
|
from blue_assistant.script.actions.web_crawl import web_crawl
|
8
8
|
|
9
9
|
|
10
|
-
dict_of_actions: Dict[str, Callable[[
|
10
|
+
dict_of_actions: Dict[str, Callable[[RootScript, str], bool]] = {
|
11
11
|
"generic": generic_action,
|
12
12
|
"generate_image": generate_image,
|
13
13
|
"generate_text": generate_text,
|
@@ -7,7 +7,7 @@ from blue_assistant.env import (
|
|
7
7
|
BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE,
|
8
8
|
BLUE_ASSISTANT_IMAGE_DEFAULT_QUALITY,
|
9
9
|
)
|
10
|
-
from blue_assistant.script.repository.base.
|
10
|
+
from blue_assistant.script.repository.base.root import RootScript
|
11
11
|
from blue_assistant.logger import logger
|
12
12
|
|
13
13
|
NAME = module.name(__file__, NAME)
|
@@ -15,15 +15,15 @@ NAME = module.name(__file__, NAME)
|
|
15
15
|
|
16
16
|
# https://platform.openai.com/docs/guides/images
|
17
17
|
def generate_image(
|
18
|
-
script:
|
18
|
+
script: RootScript,
|
19
19
|
node_name: str,
|
20
20
|
) -> bool:
|
21
|
-
logger.info(f"{NAME}:
|
21
|
+
logger.info(f"{NAME}: @ {node_name} ...")
|
22
22
|
|
23
23
|
filename = f"{node_name}.png"
|
24
24
|
|
25
25
|
success, _ = api.generate_image(
|
26
|
-
prompt=script.nodes[node_name]["prompt"],
|
26
|
+
prompt=script.apply_vars(script.nodes[node_name]["prompt"]),
|
27
27
|
filename=filename,
|
28
28
|
object_name=script.object_name,
|
29
29
|
model=BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL,
|
@@ -4,7 +4,7 @@ from blueness import module
|
|
4
4
|
from openai_commands.text_generation import api
|
5
5
|
|
6
6
|
from blue_assistant import NAME
|
7
|
-
from blue_assistant.script.repository.base.
|
7
|
+
from blue_assistant.script.repository.base.root import RootScript
|
8
8
|
from blue_assistant.env import (
|
9
9
|
BLUE_ASSISTANT_TEXT_DEFAULT_MODEL,
|
10
10
|
BLUE_ASSISTANT_TEXT_MAX_TOKENS,
|
@@ -16,13 +16,17 @@ NAME = module.name(__file__, NAME)
|
|
16
16
|
|
17
17
|
# https://platform.openai.com/docs/guides/text-generation
|
18
18
|
def generate_text(
|
19
|
-
script:
|
19
|
+
script: RootScript,
|
20
20
|
node_name: str,
|
21
21
|
) -> bool:
|
22
|
-
logger.info(f"{NAME}:
|
22
|
+
logger.info(f"{NAME}: @ {node_name} ...")
|
23
|
+
|
24
|
+
list_of_context_nodes = [node_name]
|
25
|
+
if script.nodes[node_name].get("use_context", False):
|
26
|
+
logger.info("📜 using context.")
|
27
|
+
list_of_context_nodes = script.get_context(node_name)
|
23
28
|
|
24
29
|
messages: List = []
|
25
|
-
list_of_context_nodes = script.get_context(node_name)
|
26
30
|
logger.info("node context: {}".format(" <- ".join(list_of_context_nodes)))
|
27
31
|
for context_node in reversed(list_of_context_nodes):
|
28
32
|
messages += [
|
@@ -1,15 +1,15 @@
|
|
1
1
|
from blueness import module
|
2
2
|
|
3
3
|
from blue_assistant import NAME
|
4
|
-
from blue_assistant.script.repository.base.
|
4
|
+
from blue_assistant.script.repository.base.root import RootScript
|
5
5
|
from blue_assistant.logger import logger
|
6
6
|
|
7
7
|
NAME = module.name(__file__, NAME)
|
8
8
|
|
9
9
|
|
10
10
|
def generic_action(
|
11
|
-
script:
|
11
|
+
script: RootScript,
|
12
12
|
node_name: str,
|
13
13
|
) -> bool:
|
14
|
-
logger.info(f"{NAME}:
|
14
|
+
logger.info(f"{NAME}: @ {node_name} ...")
|
15
15
|
return True
|
@@ -4,7 +4,7 @@ from blue_options.logger import log_list
|
|
4
4
|
|
5
5
|
from blue_assistant import NAME
|
6
6
|
from blue_assistant.web.crawl import crawl_list_of_urls
|
7
|
-
from blue_assistant.script.repository.base.
|
7
|
+
from blue_assistant.script.repository.base.root import RootScript
|
8
8
|
from blue_assistant.logger import logger
|
9
9
|
|
10
10
|
|
@@ -12,10 +12,10 @@ NAME = module.name(__file__, NAME)
|
|
12
12
|
|
13
13
|
|
14
14
|
def web_crawl(
|
15
|
-
script:
|
15
|
+
script: RootScript,
|
16
16
|
node_name: str,
|
17
17
|
) -> bool:
|
18
|
-
logger.info(f"{NAME}:
|
18
|
+
logger.info(f"{NAME}: @ {node_name} ...")
|
19
19
|
|
20
20
|
seed_url_var_name = script.nodes[node_name].get("seed_urls", "")
|
21
21
|
if not isinstance(seed_url_var_name, str):
|
@@ -1,14 +1,15 @@
|
|
1
1
|
from typing import List, Type
|
2
2
|
|
3
|
-
from blue_assistant.script.repository.
|
3
|
+
from blue_assistant.script.repository.base.root import RootScript
|
4
|
+
from blue_assistant.script.repository.base.classes import BaseScript
|
4
5
|
from blue_assistant.script.repository.blue_amo.classes import BlueAmoScript
|
5
6
|
from blue_assistant.script.repository.hue.classes import HueScript
|
6
7
|
from blue_assistant.script.repository.orbital_data_explorer.classes import (
|
7
8
|
OrbitalDataExplorerScript,
|
8
9
|
)
|
9
10
|
|
10
|
-
list_of_script_classes: List[Type[
|
11
|
-
|
11
|
+
list_of_script_classes: List[Type[RootScript]] = [
|
12
|
+
BaseScript,
|
12
13
|
BlueAmoScript,
|
13
14
|
HueScript,
|
14
15
|
OrbitalDataExplorerScript,
|
@@ -1,22 +1,26 @@
|
|
1
|
-
from typing import Dict, List
|
1
|
+
from typing import Dict, List, Callable
|
2
2
|
import os
|
3
3
|
import networkx as nx
|
4
4
|
from functools import reduce
|
5
|
+
from tqdm import tqdm
|
6
|
+
import copy
|
5
7
|
|
6
8
|
from blueness import module
|
7
|
-
from blue_objects import file, objects
|
9
|
+
from blue_objects import file, objects, path
|
8
10
|
from blue_objects.metadata import post_to_object
|
9
11
|
from blueflow.workflow import dot_file
|
10
12
|
|
11
13
|
from blue_assistant import NAME
|
14
|
+
from blue_assistant.script.repository.base.root import RootScript
|
15
|
+
from blue_assistant.script.actions import dict_of_actions
|
12
16
|
from blue_assistant.logger import logger
|
13
17
|
|
14
18
|
|
15
19
|
NAME = module.name(__file__, NAME)
|
16
20
|
|
17
21
|
|
18
|
-
class BaseScript:
|
19
|
-
name =
|
22
|
+
class BaseScript(RootScript):
|
23
|
+
name = path.name(file.path(__file__))
|
20
24
|
|
21
25
|
def __init__(
|
22
26
|
self,
|
@@ -30,6 +34,8 @@ class BaseScript:
|
|
30
34
|
|
31
35
|
self.verbose = verbose
|
32
36
|
|
37
|
+
self.dict_of_actions = copy.deepcopy(dict_of_actions)
|
38
|
+
|
33
39
|
metadata_filename = os.path.join(
|
34
40
|
file.path(__file__),
|
35
41
|
f"../{self.name}",
|
@@ -66,12 +72,12 @@ class BaseScript:
|
|
66
72
|
if self.test_mode:
|
67
73
|
logger.info("🧪 test mode is on.")
|
68
74
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
self.vars.update(updates)
|
75
|
+
if "test_mode" in self.script:
|
76
|
+
updates = self.script["test_mode"]
|
77
|
+
logger.info(f"🧪 vars.update({updates})")
|
78
|
+
self.vars.update(updates)
|
74
79
|
|
80
|
+
for node_name, node in self.nodes.items():
|
75
81
|
if "test_mode" in node:
|
76
82
|
updates = node["test_mode"]
|
77
83
|
logger.info(f"🧪 {node_name}.update({updates})")
|
@@ -85,9 +91,9 @@ class BaseScript:
|
|
85
91
|
)
|
86
92
|
|
87
93
|
logger.info(
|
88
|
-
"loaded {} var(s){}".format(
|
94
|
+
"loaded {} var(s): {}".format(
|
89
95
|
len(self.vars),
|
90
|
-
"
|
96
|
+
", ".join(self.vars.keys()),
|
91
97
|
)
|
92
98
|
)
|
93
99
|
if verbose:
|
@@ -108,9 +114,15 @@ class BaseScript:
|
|
108
114
|
for var_name, var_value in self.vars.items():
|
109
115
|
text = text.replace(f":::{var_name}", str(var_value))
|
110
116
|
|
117
|
+
for node_name, node in self.nodes.items():
|
118
|
+
text = text.replace(f":::{node_name}", node.get("output", ""))
|
119
|
+
|
111
120
|
return text
|
112
121
|
|
113
|
-
def generate_graph(
|
122
|
+
def generate_graph(
|
123
|
+
self,
|
124
|
+
verbose: bool = False,
|
125
|
+
) -> bool:
|
114
126
|
self.G: nx.DiGraph = nx.DiGraph()
|
115
127
|
|
116
128
|
list_of_nodes = list(self.nodes.keys())
|
@@ -118,12 +130,13 @@ class BaseScript:
|
|
118
130
|
list_of_nodes += node.get("depends-on", "").split(",")
|
119
131
|
|
120
132
|
list_of_nodes = list({node_name for node_name in list_of_nodes if node_name})
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
133
|
+
if verbose:
|
134
|
+
logger.info(
|
135
|
+
"{} node(s): {}".format(
|
136
|
+
len(list_of_nodes),
|
137
|
+
", ".join(list_of_nodes),
|
138
|
+
)
|
125
139
|
)
|
126
|
-
)
|
127
140
|
|
128
141
|
for node_name in list_of_nodes:
|
129
142
|
self.G.add_node(node_name)
|
@@ -145,23 +158,68 @@ class BaseScript:
|
|
145
158
|
[node_name],
|
146
159
|
)
|
147
160
|
|
148
|
-
def
|
161
|
+
def perform_action(
|
149
162
|
self,
|
163
|
+
node_name: str,
|
150
164
|
) -> bool:
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
self
|
165
|
+
action_name = self.nodes[node_name].get("action", "unknown")
|
166
|
+
logger.info(f"---- node: {node_name} ---- ")
|
167
|
+
|
168
|
+
if action_name in self.dict_of_actions:
|
169
|
+
return self.dict_of_actions[action_name](
|
170
|
+
script=self,
|
171
|
+
node_name=node_name,
|
157
172
|
)
|
158
|
-
)
|
159
173
|
|
160
|
-
|
174
|
+
logger.error(f"{action_name}: action not found.")
|
175
|
+
return False
|
176
|
+
|
177
|
+
def run(self) -> bool:
|
178
|
+
logger.info(f"{self.name}.run -> {self.object_name}")
|
179
|
+
|
180
|
+
success: bool = True
|
181
|
+
while (
|
182
|
+
not all(self.nodes[node].get("completed", False) for node in self.nodes)
|
183
|
+
and success
|
184
|
+
):
|
185
|
+
for node_name in tqdm(self.nodes):
|
186
|
+
if self.nodes[node_name].get("completed", False):
|
187
|
+
continue
|
188
|
+
|
189
|
+
if not self.nodes[node_name].get("runnable", True):
|
190
|
+
logger.info(f"Not runnable, skipped: {node_name}.")
|
191
|
+
self.nodes[node_name]["completed"] = True
|
192
|
+
continue
|
193
|
+
|
194
|
+
pending_dependencies = [
|
195
|
+
node_name_
|
196
|
+
for node_name_ in self.G.successors(node_name)
|
197
|
+
if not self.nodes[node_name_].get("completed", False)
|
198
|
+
]
|
199
|
+
if pending_dependencies:
|
200
|
+
logger.info(
|
201
|
+
'node "{}": {} pending dependenci(es): {}'.format(
|
202
|
+
node_name,
|
203
|
+
len(pending_dependencies),
|
204
|
+
", ".join(pending_dependencies),
|
205
|
+
)
|
206
|
+
)
|
207
|
+
continue
|
208
|
+
|
209
|
+
if not self.perform_action(node_name=node_name):
|
210
|
+
success = False
|
211
|
+
break
|
212
|
+
|
213
|
+
self.nodes[node_name]["completed"] = True
|
214
|
+
|
215
|
+
if not post_to_object(
|
161
216
|
self.object_name,
|
162
|
-
"
|
163
|
-
self.
|
164
|
-
)
|
217
|
+
"output",
|
218
|
+
self.metadata,
|
219
|
+
):
|
220
|
+
success = False
|
221
|
+
|
222
|
+
return success
|
165
223
|
|
166
224
|
def save_graph(self) -> bool:
|
167
225
|
return dot_file.save_to_file(
|
@@ -2,12 +2,12 @@ from typing import Dict, Callable
|
|
2
2
|
|
3
3
|
from blue_assistant.script.repository.base.classes import BaseScript
|
4
4
|
from blue_assistant.script.repository.blue_amo.actions import (
|
5
|
-
|
5
|
+
setting_frame_prompts,
|
6
6
|
stitching_the_frames,
|
7
7
|
)
|
8
8
|
|
9
9
|
|
10
10
|
dict_of_actions: Dict[str, Callable[[BaseScript, str], bool]] = {
|
11
|
-
"
|
11
|
+
"setting_frame_prompts": setting_frame_prompts.setting_frame_prompts,
|
12
12
|
"stitching_the_frames": stitching_the_frames.stitching_the_frames,
|
13
13
|
}
|
@@ -7,13 +7,13 @@ from blue_assistant.logger import logger
|
|
7
7
|
NAME = module.name(__file__, NAME)
|
8
8
|
|
9
9
|
|
10
|
-
def
|
10
|
+
def setting_frame_prompts(
|
11
11
|
script: BaseScript,
|
12
12
|
node_name: str,
|
13
13
|
) -> bool:
|
14
|
-
logger.info(
|
14
|
+
logger.info(NAME)
|
15
15
|
|
16
|
-
list_of_frame_prompts = script.nodes[
|
16
|
+
list_of_frame_prompts = script.nodes["slicing_into_frames"]["output"].split("---")
|
17
17
|
if len(list_of_frame_prompts) != script.vars["frame_count"]:
|
18
18
|
logger.warning(
|
19
19
|
"{} != {}, frame count doesn't match, bad AI! 😁".format(
|
@@ -31,8 +31,8 @@ def slicing_into_frames(
|
|
31
31
|
|
32
32
|
script.nodes[node_name]["prompt"] = (
|
33
33
|
script.nodes[node_name]["prompt"]
|
34
|
-
.replace(":::
|
35
|
-
.replace(":::
|
34
|
+
.replace(":::story_so_far", " ".join(list_of_frame_prompts[:index]))
|
35
|
+
.replace(":::story_of_this_frame", list_of_frame_prompts[index])
|
36
36
|
)
|
37
37
|
|
38
38
|
return True
|
@@ -4,14 +4,14 @@ from blueness import module
|
|
4
4
|
from blue_objects import file, path
|
5
5
|
|
6
6
|
from blue_assistant import NAME
|
7
|
-
from blue_assistant.script.repository.
|
7
|
+
from blue_assistant.script.repository.base.classes import BaseScript
|
8
8
|
from blue_assistant.script.repository.blue_amo.actions import dict_of_actions
|
9
9
|
from blue_assistant.logger import logger
|
10
10
|
|
11
11
|
NAME = module.name(__file__, NAME)
|
12
12
|
|
13
13
|
|
14
|
-
class BlueAmoScript(
|
14
|
+
class BlueAmoScript(BaseScript):
|
15
15
|
name = path.name(file.path(__file__))
|
16
16
|
|
17
17
|
def __init__(
|
@@ -26,56 +26,42 @@ class BlueAmoScript(GenericScript):
|
|
26
26
|
verbose=verbose,
|
27
27
|
)
|
28
28
|
|
29
|
-
|
30
|
-
self.vars["frame_count"] = 1
|
29
|
+
self.dict_of_actions.update(dict_of_actions)
|
31
30
|
|
32
|
-
|
31
|
+
def generate_graph(
|
32
|
+
self,
|
33
|
+
verbose: bool = False,
|
34
|
+
) -> bool:
|
35
|
+
if not super().generate_graph(verbose=verbose):
|
36
|
+
return False
|
37
|
+
|
38
|
+
map_node_name = "generating_the_frames"
|
33
39
|
logger.info(
|
34
40
|
"{}: expanding {} X {}...".format(
|
35
41
|
NAME,
|
36
|
-
|
42
|
+
map_node_name,
|
37
43
|
self.vars["frame_count"],
|
38
44
|
)
|
39
45
|
)
|
40
46
|
|
41
|
-
|
42
|
-
del self.nodes[
|
43
|
-
self.G.remove_node(
|
44
|
-
|
45
|
-
reduce_node = "stitching_the_frames"
|
46
|
-
self.G.add_node(reduce_node)
|
47
|
-
self.nodes[reduce_node] = {"action": "generic"}
|
47
|
+
map_node = self.nodes[map_node_name]
|
48
|
+
del self.nodes[map_node_name]
|
49
|
+
self.G.remove_node(map_node_name)
|
48
50
|
|
51
|
+
reduce_node_name = "stitching_the_frames"
|
49
52
|
for index in range(self.vars["frame_count"]):
|
50
53
|
node_name = f"generating_frame_{index+1:03d}"
|
51
54
|
|
52
|
-
self.nodes[node_name] = copy.deepcopy(
|
55
|
+
self.nodes[node_name] = copy.deepcopy(map_node)
|
53
56
|
|
54
57
|
self.G.add_node(node_name)
|
55
58
|
self.G.add_edge(
|
56
59
|
node_name,
|
57
|
-
"
|
60
|
+
"setting_frame_prompts",
|
58
61
|
)
|
59
62
|
self.G.add_edge(
|
60
|
-
|
63
|
+
reduce_node_name,
|
61
64
|
node_name,
|
62
65
|
)
|
63
66
|
|
64
|
-
|
65
|
-
|
66
|
-
def perform_action(
|
67
|
-
self,
|
68
|
-
node_name: str,
|
69
|
-
) -> bool:
|
70
|
-
if not super().perform_action(
|
71
|
-
node_name=node_name,
|
72
|
-
):
|
73
|
-
return False
|
74
|
-
|
75
|
-
if node_name in dict_of_actions:
|
76
|
-
return dict_of_actions[node_name](
|
77
|
-
script=self,
|
78
|
-
node_name=node_name,
|
79
|
-
)
|
80
|
-
|
81
|
-
return True
|
67
|
+
return self.save_graph()
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from blue_objects import file, path
|
2
2
|
|
3
|
-
from blue_assistant.script.repository.
|
3
|
+
from blue_assistant.script.repository.base.classes import BaseScript
|
4
4
|
|
5
5
|
|
6
|
-
class HueScript(
|
6
|
+
class HueScript(BaseScript):
|
7
7
|
name = path.name(file.path(__file__))
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from blue_objects import file, path
|
2
2
|
|
3
|
-
from blue_assistant.script.repository.
|
3
|
+
from blue_assistant.script.repository.base.classes import BaseScript
|
4
4
|
|
5
5
|
|
6
|
-
class OrbitalDataExplorerScript(
|
6
|
+
class OrbitalDataExplorerScript(BaseScript):
|
7
7
|
name = path.name(file.path(__file__))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: blue_assistant
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.307.1
|
4
4
|
Summary: 🧠 An AI Assistant.
|
5
5
|
Home-page: https://github.com/kamangir/blue-assistant
|
6
6
|
Author: Arash Abadpour (Kamangir)
|
@@ -124,4 +124,4 @@ Also home to [`@web`](https://raw.githubusercontent.com/kamangir/blue-assistant/
|
|
124
124
|
|
125
125
|
[](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [](https://pypi.org/project/blue-assistant/) [](https://pypistats.org/packages/blue-assistant)
|
126
126
|
|
127
|
-
built by 🌀 [`blue_options-4.240.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.
|
127
|
+
built by 🌀 [`blue_options-4.240.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.307.1`](https://github.com/kamangir/blue-assistant).
|
@@ -1,5 +1,5 @@
|
|
1
1
|
blue_assistant/README.py,sha256=EJORj3I5pucJplI86lrFaZBN5C9IYNgKoG_V7h27NHw,2586
|
2
|
-
blue_assistant/__init__.py,sha256=
|
2
|
+
blue_assistant/__init__.py,sha256=4nXZv5rPPASKgOKBQisBlassDX88WzJlwFFsjovEWNQ,311
|
3
3
|
blue_assistant/__main__.py,sha256=URtal70XZc0--3FDTYWcLtnGOqBYjMX9gt-L1k8hDXI,361
|
4
4
|
blue_assistant/config.env,sha256=npodyuuhkZUHUv9FnEiQQZkKxFbg8nQb1YpOCURqV3Y,301
|
5
5
|
blue_assistant/env.py,sha256=FTSdJ8-J4jAyI0-h3MBgOweQBWd3YEFIibBHSXpClrY,760
|
@@ -20,11 +20,11 @@ blue_assistant/.abcli/hue/create_user.sh,sha256=Nh8FhnGweB2JZB7SVh-6jp8ud5YHeJSa
|
|
20
20
|
blue_assistant/.abcli/hue/list.sh,sha256=ynptjPo6jZnwm-7wAVgGx-mZvyPKZ9b5JaJoY0xidCg,268
|
21
21
|
blue_assistant/.abcli/hue/set.sh,sha256=VcADsfbjjbrxIMX9cVVHeK0MH649ZRY29V8YDTgflms,266
|
22
22
|
blue_assistant/.abcli/script/list.sh,sha256=2lcVfqDfZP50NszF8o5YCo3TrJKeDc_qo7MTAF3XTGw,131
|
23
|
-
blue_assistant/.abcli/script/run.sh,sha256=
|
23
|
+
blue_assistant/.abcli/script/run.sh,sha256=1pzzzHeviUZ9tLJZrCsAleQgNfoq8hnlwPuBCY2Ofso,930
|
24
24
|
blue_assistant/.abcli/tests/README.sh,sha256=Qs0YUxVB1OZZ70Nqw2kT1LKXeUnC5-XfQRMfqb8Cbwg,152
|
25
25
|
blue_assistant/.abcli/tests/help.sh,sha256=7AAZzCEo5vZ1cBAMfj4virDClabaUMdOV-NqXSJQVUM,918
|
26
26
|
blue_assistant/.abcli/tests/script_list.sh,sha256=OVOwWO9wR0eeDZTM6uub-eTKbz3eswU3vEUPWXcK-gQ,178
|
27
|
-
blue_assistant/.abcli/tests/script_run.sh,sha256=
|
27
|
+
blue_assistant/.abcli/tests/script_run.sh,sha256=N0sg5j5a60x5v4V8PCEVjyjPP8xO-uC9JduSCBU0EyE,809
|
28
28
|
blue_assistant/.abcli/tests/version.sh,sha256=oR2rvYR8zi-0VDPIdPJsmsmWwYaamT8dmNTqUh3-8Gw,154
|
29
29
|
blue_assistant/.abcli/tests/web_crawl.sh,sha256=sz3LbpidWvjG7kQoWxQBtdBe5yntm14ylAUsgPJWhko,372
|
30
30
|
blue_assistant/.abcli/tests/web_fetch.sh,sha256=C8PFWlmRa9heNdP9yhshriCBKG1uUlps-oxhAM70AZI,312
|
@@ -39,35 +39,34 @@ blue_assistant/help/web.py,sha256=LNJRbMXipXUojJmmTghY9YAxFqPDLTCvcRCfpJrfgvk,91
|
|
39
39
|
blue_assistant/script/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
40
40
|
blue_assistant/script/__main__.py,sha256=eOSOo5yYTPMwIXZ0GkuWkmOcsDWrZtHvClyJizXSk2w,1657
|
41
41
|
blue_assistant/script/load.py,sha256=JsDY9T3HTM9vXngvKsA0Mt_erxAnRR_jI62-JhrOBMU,831
|
42
|
-
blue_assistant/script/actions/__init__.py,sha256=
|
43
|
-
blue_assistant/script/actions/generate_image.py,sha256=
|
44
|
-
blue_assistant/script/actions/generate_text.py,sha256=
|
45
|
-
blue_assistant/script/actions/generic.py,sha256=
|
46
|
-
blue_assistant/script/actions/web_crawl.py,sha256=
|
47
|
-
blue_assistant/script/repository/__init__.py,sha256=
|
42
|
+
blue_assistant/script/actions/__init__.py,sha256=rTJw42KtMcsOMU1Z-h1e5Nch2Iax-t2P84vPZ-ccR_c,573
|
43
|
+
blue_assistant/script/actions/generate_image.py,sha256=SJLKkeduWkJgN-0Y8H3ov8xSw3MBpmjQSBTR9vwXstA,1343
|
44
|
+
blue_assistant/script/actions/generate_text.py,sha256=LJmXHZBpLdMMnE5SJGbv03bELTlG1zLav8XW2QLtRWI,2023
|
45
|
+
blue_assistant/script/actions/generic.py,sha256=UkyaM16qXdmTAVfduo6niCpHk5nB7rir-9oIW1VdwOg,343
|
46
|
+
blue_assistant/script/actions/web_crawl.py,sha256=iA55aFt3K3RrlBgzPnMmLync5cl2mSR_JdokMmO_ATo,1446
|
47
|
+
blue_assistant/script/repository/__init__.py,sha256=zxqxFim6RdNhQLU3SWVytMwsf0NyhX1c_Mhi-ZUFi2w,658
|
48
48
|
blue_assistant/script/repository/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
49
|
-
blue_assistant/script/repository/base/classes.py,sha256=
|
49
|
+
blue_assistant/script/repository/base/classes.py,sha256=PpVwRQCT839jcxphLSBEBLCFujwH5zsL_e0ZyUhDPuc,7427
|
50
|
+
blue_assistant/script/repository/base/root.py,sha256=x0u6y-c3z3ar4gMEA08XodvUFdFhzD1mNs4htOwIJII,107
|
50
51
|
blue_assistant/script/repository/blue_amo/__init__.py,sha256=WjL9GIlN-DBnbUMJ8O_FxTp0rcVGlsIS3H9YtXEefTk,76
|
51
|
-
blue_assistant/script/repository/blue_amo/classes.py,sha256=
|
52
|
-
blue_assistant/script/repository/blue_amo/actions/__init__.py,sha256=
|
53
|
-
blue_assistant/script/repository/blue_amo/actions/
|
52
|
+
blue_assistant/script/repository/blue_amo/classes.py,sha256=9YMT8UdYMQ-bXkZ_Qv-Wv4xxVSczclKQZ0d4077y3jc,1771
|
53
|
+
blue_assistant/script/repository/blue_amo/actions/__init__.py,sha256=JE4XK5Do64kLfAUxKTa15vkqUQ5JMCiHZfm03blBxi8,438
|
54
|
+
blue_assistant/script/repository/blue_amo/actions/setting_frame_prompts.py,sha256=4YkEsWNhFg_5crYDMPglUVjlWpoG0ditKbUittYiFo4,1205
|
54
55
|
blue_assistant/script/repository/blue_amo/actions/stitching_the_frames.py,sha256=mbXriat6deEAmuo5Y1ValySnUXDENR7TZS_3nVPlQ6M,3622
|
55
|
-
blue_assistant/script/repository/generic/__init__.py,sha256=kLffGsQMQAFJTw6IZBE5eBxvshP1x9wwHHR4hsDJblo,75
|
56
|
-
blue_assistant/script/repository/generic/classes.py,sha256=VhZpyA0sOBSlamopRPJ1EyPTd0i5-LvTzCAYlBJR-Es,2589
|
57
56
|
blue_assistant/script/repository/hue/__init__.py,sha256=WjL9GIlN-DBnbUMJ8O_FxTp0rcVGlsIS3H9YtXEefTk,76
|
58
57
|
blue_assistant/script/repository/hue/__main__.py,sha256=jaesrONQsrpVdg8A7NzzT8xpsdXs5gmrywOTE_TWD6c,2321
|
59
58
|
blue_assistant/script/repository/hue/api.py,sha256=C3KzT_MG868gsznUXpwEbUleBjnJObWzZgzvN6wi3uo,4774
|
60
|
-
blue_assistant/script/repository/hue/classes.py,sha256=
|
59
|
+
blue_assistant/script/repository/hue/classes.py,sha256=AbihLKw4Ii9MHnCQj1qOrZiZhQh6LhbDcN3kLTigQ00,179
|
61
60
|
blue_assistant/script/repository/hue/colors.py,sha256=rUdtCroNAnzm1zUuVp8eVhvfIie1f7sd208ypsFAJ_w,625
|
62
61
|
blue_assistant/script/repository/orbital_data_explorer/__init__.py,sha256=yy5FtCeHlr9dRfqxw4QYWr7_yRjnQpwVyuAY2vLrh4Q,110
|
63
|
-
blue_assistant/script/repository/orbital_data_explorer/classes.py,sha256=
|
62
|
+
blue_assistant/script/repository/orbital_data_explorer/classes.py,sha256=Hx-74_wnWedidy9_WtR-dQLqLYK-GH-KshG1Ul8jnuY,195
|
64
63
|
blue_assistant/web/__init__.py,sha256=70_JSpnfX1mLm8Xv3xHIujfr2FfGeHPRs6HraWDP1XA,114
|
65
64
|
blue_assistant/web/__main__.py,sha256=aLkMmUpeWSOxa7YQVbtL90ZNbOcr1OeT0rymw90jx7A,1436
|
66
65
|
blue_assistant/web/crawl.py,sha256=S_Y-jZ_-K9Q2yLG6r-cdYphK4p0dXPluDap4h5jBLY0,3373
|
67
66
|
blue_assistant/web/fetch.py,sha256=meso5ssN6OEk2xcPo3VMmFsXLqPlBVZ2FxureWoIYag,2546
|
68
67
|
blue_assistant/web/functions.py,sha256=uJAC_kGOn2wA9AwOB_FB2f1dFYyNaEPPC42lN3klnFc,618
|
69
|
-
blue_assistant-4.
|
70
|
-
blue_assistant-4.
|
71
|
-
blue_assistant-4.
|
72
|
-
blue_assistant-4.
|
73
|
-
blue_assistant-4.
|
68
|
+
blue_assistant-4.307.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
|
69
|
+
blue_assistant-4.307.1.dist-info/METADATA,sha256=rmNwepvSbB5ifBsZjI89diZZHyzGZaQi4KpoHaebZGQ,5380
|
70
|
+
blue_assistant-4.307.1.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
71
|
+
blue_assistant-4.307.1.dist-info/top_level.txt,sha256=ud0BkBbdOVze13bNqHuhZj1rwCztaBtDf5ChEYzASOs,15
|
72
|
+
blue_assistant-4.307.1.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
from blue_assistant.script.repository.generic.classes import GenericScript
|
@@ -1,88 +0,0 @@
|
|
1
|
-
from typing import Dict, List
|
2
|
-
import os
|
3
|
-
from tqdm import tqdm
|
4
|
-
|
5
|
-
|
6
|
-
from blueness import module
|
7
|
-
from blue_objects import file, path
|
8
|
-
from blue_objects.metadata import post_to_object
|
9
|
-
|
10
|
-
from blue_assistant import NAME
|
11
|
-
from blue_assistant.script.repository.base.classes import BaseScript
|
12
|
-
from blue_assistant.script.actions import dict_of_actions
|
13
|
-
from blue_assistant.logger import logger
|
14
|
-
|
15
|
-
|
16
|
-
NAME = module.name(__file__, NAME)
|
17
|
-
|
18
|
-
|
19
|
-
class GenericScript(BaseScript):
|
20
|
-
name = path.name(file.path(__file__))
|
21
|
-
|
22
|
-
def perform_action(
|
23
|
-
self,
|
24
|
-
node_name: str,
|
25
|
-
) -> bool:
|
26
|
-
action_name = self.nodes[node_name].get("action", "unknown")
|
27
|
-
logger.info(f"---- node: {node_name} ---- ")
|
28
|
-
|
29
|
-
if action_name not in dict_of_actions:
|
30
|
-
logger.error(f"{action_name}: action not found.")
|
31
|
-
return False
|
32
|
-
|
33
|
-
return dict_of_actions[action_name](
|
34
|
-
script=self,
|
35
|
-
node_name=node_name,
|
36
|
-
)
|
37
|
-
|
38
|
-
def run(
|
39
|
-
self,
|
40
|
-
) -> bool:
|
41
|
-
if not super().run():
|
42
|
-
return False
|
43
|
-
|
44
|
-
success: bool = True
|
45
|
-
while (
|
46
|
-
not all(self.nodes[node].get("completed", False) for node in self.nodes)
|
47
|
-
and success
|
48
|
-
):
|
49
|
-
for node_name in tqdm(self.nodes):
|
50
|
-
if self.nodes[node_name].get("completed", False):
|
51
|
-
continue
|
52
|
-
|
53
|
-
if not self.nodes[node_name].get("runnable", True):
|
54
|
-
logger.info(f"Not runnable, skipped: {node_name}.")
|
55
|
-
self.nodes[node_name]["completed"] = True
|
56
|
-
continue
|
57
|
-
|
58
|
-
pending_dependencies = [
|
59
|
-
node_name_
|
60
|
-
for node_name_ in self.G.successors(node_name)
|
61
|
-
if not self.nodes[node_name_].get("completed", False)
|
62
|
-
]
|
63
|
-
if pending_dependencies:
|
64
|
-
logger.info(
|
65
|
-
'node "{}": {} pending dependenci(es): {}'.format(
|
66
|
-
node_name,
|
67
|
-
len(pending_dependencies),
|
68
|
-
", ".join(pending_dependencies),
|
69
|
-
)
|
70
|
-
)
|
71
|
-
continue
|
72
|
-
|
73
|
-
if not self.perform_action(
|
74
|
-
node_name=node_name,
|
75
|
-
):
|
76
|
-
success = False
|
77
|
-
break
|
78
|
-
|
79
|
-
self.nodes[node_name]["completed"] = True
|
80
|
-
|
81
|
-
if not post_to_object(
|
82
|
-
self.object_name,
|
83
|
-
"output",
|
84
|
-
self.metadata,
|
85
|
-
):
|
86
|
-
return False
|
87
|
-
|
88
|
-
return success
|
File without changes
|
File without changes
|
File without changes
|