blue-assistant 4.43.1__tar.gz → 4.53.1__tar.gz

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.
Files changed (57) hide show
  1. {blue_assistant-4.43.1/blue_assistant.egg-info → blue_assistant-4.53.1}/PKG-INFO +5 -2
  2. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/README.md +4 -1
  3. blue_assistant-4.53.1/blue_assistant/.abcli/script/list.sh +7 -0
  4. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/tests/help.sh +1 -0
  5. blue_assistant-4.53.1/blue_assistant/.abcli/tests/script_list.sh +8 -0
  6. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/tests/script_run.sh +3 -3
  7. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/__init__.py +1 -1
  8. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/help/script.py +25 -1
  9. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/__main__.py +15 -4
  10. blue_assistant-4.53.1/blue_assistant/script/actions/__init__.py +40 -0
  11. blue_assistant-4.53.1/blue_assistant/script/actions/generate_image.py +21 -0
  12. blue_assistant-4.53.1/blue_assistant/script/actions/generate_text.py +21 -0
  13. blue_assistant-4.53.1/blue_assistant/script/actions/generic.py +25 -0
  14. blue_assistant-4.53.1/blue_assistant/script/actions/wip.py +7 -0
  15. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/repository/__init__.py +2 -0
  16. blue_assistant-4.53.1/blue_assistant/script/repository/blue_amo/classes.py +9 -0
  17. blue_assistant-4.53.1/blue_assistant/script/repository/generic/classes.py +104 -0
  18. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/repository/moon_datasets/classes.py +0 -9
  19. {blue_assistant-4.43.1 → blue_assistant-4.53.1/blue_assistant.egg-info}/PKG-INFO +5 -2
  20. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant.egg-info/SOURCES.txt +7 -0
  21. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/setup.py +1 -0
  22. blue_assistant-4.43.1/blue_assistant/script/repository/blue_amo/classes.py +0 -42
  23. blue_assistant-4.43.1/blue_assistant/script/repository/generic/classes.py +0 -51
  24. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/LICENSE +0 -0
  25. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/MANIFEST.in +0 -0
  26. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/abcli.sh +0 -0
  27. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/actions.sh +0 -0
  28. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/alias.sh +0 -0
  29. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/blue_assistant.sh +0 -0
  30. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/browse.sh +0 -0
  31. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/script/run.sh +0 -0
  32. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/script.sh +0 -0
  33. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/tests/README.sh +0 -0
  34. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/.abcli/tests/version.sh +0 -0
  35. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/README.py +0 -0
  36. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/__main__.py +0 -0
  37. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/config.env +0 -0
  38. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/env.py +0 -0
  39. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/functions.py +0 -0
  40. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/help/__init__.py +0 -0
  41. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/help/__main__.py +0 -0
  42. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/help/functions.py +0 -0
  43. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/host.py +0 -0
  44. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/logger.py +0 -0
  45. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/sample.env +0 -0
  46. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/__init__.py +0 -0
  47. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/load.py +0 -0
  48. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/repository/blue_amo/__init__.py +0 -0
  49. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/repository/generic/__init__.py +0 -0
  50. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/script/repository/moon_datasets/__init__.py +0 -0
  51. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant/urls.py +0 -0
  52. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant.egg-info/dependency_links.txt +0 -0
  53. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant.egg-info/requires.txt +0 -0
  54. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/blue_assistant.egg-info/top_level.txt +0 -0
  55. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/pyproject.toml +0 -0
  56. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/requirements.txt +0 -0
  57. {blue_assistant-4.43.1 → blue_assistant-4.53.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_assistant
3
- Version: 4.43.1
3
+ Version: 4.53.1
4
4
  Summary: 🧠 An AI Assistant.
5
5
  Home-page: https://github.com/kamangir/blue-assistant
6
6
  Author: Arash Abadpour (Kamangir)
@@ -48,11 +48,14 @@ pip install blue-assistant
48
48
 
49
49
  ```mermaid
50
50
  graph LR
51
+ assistant_script_list["@assistant<br>script<br>list"]
51
52
  assistant_script_run["@assistant<br>script<br>run -<br>&lt;script&gt;<br>&lt;object-name&gt;"]
52
53
 
53
54
  script["📜 script"]:::folder
54
55
  object["📂 object"]:::folder
55
56
 
57
+ script --> assistant_script_list
58
+
56
59
  script --> assistant_script_run
57
60
  object --> assistant_script_run
58
61
  assistant_script_run --> object
@@ -65,4 +68,4 @@ graph LR
65
68
 
66
69
  [![pylint](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-assistant.svg)](https://pypi.org/project/blue-assistant/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-assistant)](https://pypistats.org/packages/blue-assistant)
67
70
 
68
- built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.43.1`](https://github.com/kamangir/blue-assistant).
71
+ built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.53.1`](https://github.com/kamangir/blue-assistant).
@@ -8,11 +8,14 @@ pip install blue-assistant
8
8
 
9
9
  ```mermaid
10
10
  graph LR
11
+ assistant_script_list["@assistant<br>script<br>list"]
11
12
  assistant_script_run["@assistant<br>script<br>run -<br>&lt;script&gt;<br>&lt;object-name&gt;"]
12
13
 
13
14
  script["📜 script"]:::folder
14
15
  object["📂 object"]:::folder
15
16
 
17
+ script --> assistant_script_list
18
+
16
19
  script --> assistant_script_run
17
20
  object --> assistant_script_run
18
21
  assistant_script_run --> object
@@ -25,4 +28,4 @@ graph LR
25
28
 
26
29
  [![pylint](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-assistant.svg)](https://pypi.org/project/blue-assistant/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-assistant)](https://pypistats.org/packages/blue-assistant)
27
30
 
28
- built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.43.1`](https://github.com/kamangir/blue-assistant).
31
+ built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.53.1`](https://github.com/kamangir/blue-assistant).
@@ -0,0 +1,7 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_assistant_script_list() {
4
+ python3 -m blue_assistant.script \
5
+ list \
6
+ "$@"
7
+ }
@@ -20,6 +20,7 @@ function test_blue_assistant_help() {
20
20
  "@assistant browse" \
21
21
  \
22
22
  "@assistant script" \
23
+ "@assistant script list" \
23
24
  "@assistant script run" \
24
25
  \
25
26
  "blue_assistant"; do
@@ -0,0 +1,8 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_blue_assistant_script_list() {
4
+ abcli_assert "$(blue_assistant_script_list \
5
+ --delim + \
6
+ --log 0)" \
7
+ - non-empty
8
+ }
@@ -2,9 +2,9 @@
2
2
 
3
3
  function test_blue_assistant_script_run() {
4
4
  local options=$1
5
- local list_of_script_name=$(python3 -m blue_assistant.script \
6
- get_list_of \
7
- --delim +)
5
+ local list_of_script_name=$(blue_assistant_script_list \
6
+ --delim + \
7
+ --log 0)
8
8
  list_of_script_name=$(abcli_option "$options" script $list_of_script_name)
9
9
 
10
10
  local script_name
@@ -4,7 +4,7 @@ ICON = "🧠"
4
4
 
5
5
  DESCRIPTION = f"{ICON} An AI Assistant."
6
6
 
7
- VERSION = "4.43.1"
7
+ VERSION = "4.53.1"
8
8
 
9
9
  REPO_NAME = "blue-assistant"
10
10
 
@@ -5,6 +5,27 @@ from blue_options.terminal import show_usage, xtra
5
5
  from blue_assistant.script.repository import list_of_script_names
6
6
 
7
7
 
8
+ def help_list(
9
+ tokens: List[str],
10
+ mono: bool,
11
+ ) -> str:
12
+ args = [
13
+ "[--delim +]",
14
+ "[--log 0]",
15
+ ]
16
+
17
+ return show_usage(
18
+ [
19
+ "@assistant",
20
+ "script",
21
+ "list",
22
+ ]
23
+ + args,
24
+ "list scripts.",
25
+ mono=mono,
26
+ )
27
+
28
+
8
29
  def help_run(
9
30
  tokens: List[str],
10
31
  mono: bool,
@@ -33,4 +54,7 @@ def help_run(
33
54
  )
34
55
 
35
56
 
36
- help_functions = {"run": help_run}
57
+ help_functions = {
58
+ "list": help_list,
59
+ "run": help_run,
60
+ }
@@ -14,7 +14,7 @@ parser = argparse.ArgumentParser(NAME)
14
14
  parser.add_argument(
15
15
  "task",
16
16
  type=str,
17
- help="get_list_of | run",
17
+ help="list | run",
18
18
  )
19
19
  parser.add_argument(
20
20
  "--script_name",
@@ -34,16 +34,27 @@ parser.add_argument(
34
34
  parser.add_argument(
35
35
  "--delim",
36
36
  type=str,
37
- default="+",
37
+ default=", ",
38
+ )
39
+ parser.add_argument(
40
+ "--log",
41
+ type=int,
42
+ default=1,
43
+ help="0 | 1",
38
44
  )
39
45
  args = parser.parse_args()
40
46
 
41
47
  delim = " " if args.delim == "space" else args.delim
42
48
 
43
49
  success = False
44
- if args.task == "get_list_of":
50
+ if args.task == "list":
45
51
  success = True
46
- print(delim.join(list_of_script_names))
52
+ if args.log:
53
+ logger.info(f"{len(list_of_script_names)} script(s)")
54
+ for index, script_name in enumerate(list_of_script_names):
55
+ logger.info(f"#{index + 1: 3d}: {script_name}")
56
+ else:
57
+ print(delim.join(list_of_script_names))
47
58
  elif args.task == "run":
48
59
  success, script = load_script(
49
60
  script_name=args.script_name,
@@ -0,0 +1,40 @@
1
+ from typing import List, Dict, Tuple, Type
2
+
3
+ from blue_assistant.script.actions.generic import GenericAction
4
+ from blue_assistant.script.actions.generate_image import GenerateImageAction
5
+ from blue_assistant.script.actions.generate_text import GenerateTextAction
6
+ from blue_assistant.script.actions.wip import WorkInProgressAction
7
+ from blue_assistant.logger import logger
8
+
9
+ list_of_actions: List[GenericAction] = [
10
+ GenericAction,
11
+ GenerateImageAction,
12
+ GenerateTextAction,
13
+ WorkInProgressAction,
14
+ ]
15
+
16
+
17
+ def get_action_class(
18
+ action_name: str,
19
+ ) -> Tuple[bool, Type[GenericAction]]:
20
+ for action_class in list_of_actions:
21
+ if action_class.name == action_name:
22
+ return True, action_class
23
+
24
+ logger.error(f"{action_name}: action not found.")
25
+ return False, GenericAction
26
+
27
+
28
+ def perform_action(
29
+ action_name: str,
30
+ node: Dict,
31
+ ) -> Tuple[bool, Dict]:
32
+ success, action_class = get_action_class(action_name=action_name)
33
+ if not success:
34
+ return False, {
35
+ "error": f"{action_name}: action not found.",
36
+ }
37
+
38
+ action_object = action_class(node=node)
39
+
40
+ return action_object.perform()
@@ -0,0 +1,21 @@
1
+ from typing import Dict, Tuple
2
+
3
+ from blue_objects import file
4
+
5
+ from blue_assistant.script.actions.generic import GenericAction
6
+ from blue_assistant.logger import logger
7
+
8
+
9
+ class GenerateImageAction(GenericAction):
10
+ name = file.name(__file__)
11
+
12
+ def perform(self) -> Tuple[bool, Dict]:
13
+ success, generic_metadata = super().perform()
14
+ if not success:
15
+ return success, generic_metadata
16
+
17
+ logger.info(f"🪄 generating image ...: {self.node}")
18
+ metadata = {}
19
+
20
+ metadata.update(generic_metadata)
21
+ return True, metadata
@@ -0,0 +1,21 @@
1
+ from typing import Dict, Tuple
2
+
3
+ from blue_objects import file
4
+
5
+ from blue_assistant.script.actions.generic import GenericAction
6
+ from blue_assistant.logger import logger
7
+
8
+
9
+ class GenerateTextAction(GenericAction):
10
+ name = file.name(__file__)
11
+
12
+ def perform(self) -> Tuple[bool, Dict]:
13
+ success, generic_metadata = super().perform()
14
+ if not success:
15
+ return success, generic_metadata
16
+
17
+ logger.info(f"🪄 generating text ...: {self.node}")
18
+ metadata = {}
19
+
20
+ metadata.update(generic_metadata)
21
+ return True, metadata
@@ -0,0 +1,25 @@
1
+ from typing import Dict, Tuple
2
+
3
+ from blueness import module
4
+ from blue_objects import file
5
+
6
+ from blue_assistant import NAME
7
+ from blue_assistant.logger import logger
8
+
9
+ NAME = module.name(__file__, NAME)
10
+
11
+
12
+ class GenericAction:
13
+ name = file.name(__file__)
14
+
15
+ def __init__(self, node: Dict):
16
+ self.node = node
17
+
18
+ def perform(self) -> Tuple[bool, Dict]:
19
+ logger.info(
20
+ "{}.perform({}) ...".format(
21
+ NAME,
22
+ self.__class__.__name__,
23
+ ),
24
+ )
25
+ return True, {}
@@ -0,0 +1,7 @@
1
+ from blue_objects import file
2
+
3
+ from blue_assistant.script.actions.generic import GenericAction
4
+
5
+
6
+ class WorkInProgressAction(GenericAction):
7
+ name = file.name(__file__)
@@ -2,11 +2,13 @@ from typing import List, Type
2
2
 
3
3
  from blue_assistant.script.repository.generic import GenericScript
4
4
  from blue_assistant.script.repository.blue_amo.classes import BlueAmoScript
5
+ from blue_assistant.script.repository.hue.classes import HueScript
5
6
  from blue_assistant.script.repository.moon_datasets.classes import MiningOnMoonScript
6
7
 
7
8
  list_of_script_classes: List[Type[GenericScript]] = [
8
9
  GenericScript,
9
10
  BlueAmoScript,
11
+ HueScript,
10
12
  MiningOnMoonScript,
11
13
  ]
12
14
 
@@ -0,0 +1,9 @@
1
+ from blue_objects import file, path
2
+
3
+
4
+ from blue_assistant.script.repository.generic.classes import GenericScript
5
+ from blue_assistant.logger import logger
6
+
7
+
8
+ class BlueAmoScript(GenericScript):
9
+ name = path.name(file.path(__file__))
@@ -0,0 +1,104 @@
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.actions import perform_action
12
+ from blue_assistant.logger import logger
13
+
14
+
15
+ NAME = module.name(__file__, NAME)
16
+
17
+
18
+ class GenericScript:
19
+ name = path.name(file.path(__file__))
20
+
21
+ def __init__(
22
+ self,
23
+ verbose: bool = False,
24
+ ):
25
+ self.verbose = verbose
26
+
27
+ metadata_filename = os.path.join(
28
+ file.path(__file__),
29
+ f"../{self.name}",
30
+ "metadata.yaml",
31
+ )
32
+ self.metadata: Dict
33
+ success, self.metadata = file.load_yaml(metadata_filename)
34
+ assert success, f"cannot load {self.name}/metadata.yaml"
35
+
36
+ logger.info("loaded {} node(s)".format(len(self.nodes)))
37
+
38
+ logger.info("loaded {} variable(s)".format(len(self.vars)))
39
+ if verbose:
40
+ for var_name, var_value in self.vars.items():
41
+ logger.info("{}: {}".format(var_name, var_value))
42
+
43
+ @property
44
+ def script(self) -> str:
45
+ return self.metadata.get("script", {})
46
+
47
+ @property
48
+ def nodes(self) -> str:
49
+ return self.metadata.get("script", {}).get("nodes", [])
50
+
51
+ @property
52
+ def vars(self) -> str:
53
+ return self.metadata.get("script", {}).get("vars", {})
54
+
55
+ def run(
56
+ self,
57
+ object_name: str,
58
+ ) -> bool:
59
+ logger.info(
60
+ "{}.run: {}:{} -> {}".format(
61
+ NAME,
62
+ self.__class__.__name__,
63
+ self.name,
64
+ object_name,
65
+ )
66
+ )
67
+
68
+ if not post_to_object(
69
+ object_name,
70
+ "script",
71
+ self.script,
72
+ ):
73
+ return False
74
+
75
+ metadata: Dict[Dict] = {"nodes": {}}
76
+ success: bool = True
77
+ for node_name, node in tqdm(self.nodes.items()):
78
+ logger.info(
79
+ "{}{}".format(
80
+ node_name,
81
+ f": {node}" if self.verbose else " ...",
82
+ )
83
+ )
84
+
85
+ assert isinstance(node, dict)
86
+ success, output = perform_action(
87
+ action_name=node.get("action", "unknown"),
88
+ node=node,
89
+ )
90
+ metadata["nodes"][node_name] = {
91
+ "success": success,
92
+ "output": output,
93
+ }
94
+ if not success:
95
+ break
96
+
97
+ if not post_to_object(
98
+ object_name,
99
+ "output",
100
+ metadata,
101
+ ):
102
+ return False
103
+
104
+ return success
@@ -1,6 +1,3 @@
1
- from typing import Dict
2
- from tqdm import tqdm
3
-
4
1
  from blue_objects import file, path
5
2
 
6
3
  from blue_assistant.script.repository.generic.classes import GenericScript
@@ -8,9 +5,3 @@ from blue_assistant.script.repository.generic.classes import GenericScript
8
5
 
9
6
  class MiningOnMoonScript(GenericScript):
10
7
  name = path.name(file.path(__file__))
11
-
12
- def __init__(
13
- self,
14
- verbose: bool = False,
15
- ):
16
- super().__init__(verbose=verbose)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_assistant
3
- Version: 4.43.1
3
+ Version: 4.53.1
4
4
  Summary: 🧠 An AI Assistant.
5
5
  Home-page: https://github.com/kamangir/blue-assistant
6
6
  Author: Arash Abadpour (Kamangir)
@@ -48,11 +48,14 @@ pip install blue-assistant
48
48
 
49
49
  ```mermaid
50
50
  graph LR
51
+ assistant_script_list["@assistant<br>script<br>list"]
51
52
  assistant_script_run["@assistant<br>script<br>run -<br>&lt;script&gt;<br>&lt;object-name&gt;"]
52
53
 
53
54
  script["📜 script"]:::folder
54
55
  object["📂 object"]:::folder
55
56
 
57
+ script --> assistant_script_list
58
+
56
59
  script --> assistant_script_run
57
60
  object --> assistant_script_run
58
61
  assistant_script_run --> object
@@ -65,4 +68,4 @@ graph LR
65
68
 
66
69
  [![pylint](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-assistant.svg)](https://pypi.org/project/blue-assistant/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-assistant)](https://pypistats.org/packages/blue-assistant)
67
70
 
68
- built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.43.1`](https://github.com/kamangir/blue-assistant).
71
+ built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.53.1`](https://github.com/kamangir/blue-assistant).
@@ -25,9 +25,11 @@ blue_assistant/.abcli/alias.sh
25
25
  blue_assistant/.abcli/blue_assistant.sh
26
26
  blue_assistant/.abcli/browse.sh
27
27
  blue_assistant/.abcli/script.sh
28
+ blue_assistant/.abcli/script/list.sh
28
29
  blue_assistant/.abcli/script/run.sh
29
30
  blue_assistant/.abcli/tests/README.sh
30
31
  blue_assistant/.abcli/tests/help.sh
32
+ blue_assistant/.abcli/tests/script_list.sh
31
33
  blue_assistant/.abcli/tests/script_run.sh
32
34
  blue_assistant/.abcli/tests/version.sh
33
35
  blue_assistant/help/__init__.py
@@ -37,6 +39,11 @@ blue_assistant/help/script.py
37
39
  blue_assistant/script/__init__.py
38
40
  blue_assistant/script/__main__.py
39
41
  blue_assistant/script/load.py
42
+ blue_assistant/script/actions/__init__.py
43
+ blue_assistant/script/actions/generate_image.py
44
+ blue_assistant/script/actions/generate_text.py
45
+ blue_assistant/script/actions/generic.py
46
+ blue_assistant/script/actions/wip.py
40
47
  blue_assistant/script/repository/__init__.py
41
48
  blue_assistant/script/repository/blue_amo/__init__.py
42
49
  blue_assistant/script/repository/blue_amo/classes.py
@@ -11,6 +11,7 @@ setup(
11
11
  NAME,
12
12
  f"{NAME}.help",
13
13
  f"{NAME}.script",
14
+ f"{NAME}.script.actions",
14
15
  f"{NAME}.script.repository",
15
16
  f"{NAME}.script.repository.blue_amo",
16
17
  f"{NAME}.script.repository.generic",
@@ -1,42 +0,0 @@
1
- from typing import Dict
2
- from tqdm import tqdm
3
-
4
- from blue_objects import file, path
5
- from blue_objects.metadata import post_to_object
6
-
7
- from blue_assistant.script.repository.generic.classes import GenericScript
8
- from blue_assistant.logger import logger
9
-
10
-
11
- class BlueAmoScript(GenericScript):
12
- name = path.name(file.path(__file__))
13
-
14
- def __init__(
15
- self,
16
- verbose: bool = False,
17
- ):
18
- super().__init__(verbose=verbose)
19
-
20
- def run(
21
- self,
22
- object_name: str,
23
- ) -> bool:
24
- if not super().run(object_name=object_name):
25
- return False
26
-
27
- metadata: Dict[Dict] = {"nodes": {}}
28
- for node_name, node in tqdm(self.script["nodes"].items()):
29
- logger.info(
30
- "{}{}".format(
31
- node_name,
32
- f": {node}" if self.verbose else " ...",
33
- )
34
- )
35
-
36
- metadata["nodes"][node_name] = "..."
37
-
38
- return post_to_object(
39
- object_name,
40
- "output",
41
- metadata,
42
- )
@@ -1,51 +0,0 @@
1
- import os
2
-
3
- from blueness import module
4
- from blue_objects import file, path
5
- from blue_objects.metadata import post_to_object
6
-
7
- from blue_assistant import NAME
8
- from blue_assistant.logger import logger
9
-
10
-
11
- NAME = module.name(__file__, NAME)
12
-
13
-
14
- class GenericScript:
15
- name = path.name(file.path(__file__))
16
-
17
- def __init__(
18
- self,
19
- verbose: bool = False,
20
- ):
21
- self.verbose = verbose
22
-
23
- metadata_filename = os.path.join(
24
- file.path(__file__),
25
- f"../{self.name}",
26
- "metadata.yaml",
27
- )
28
- success, self.metadata = file.load_yaml(metadata_filename)
29
-
30
- self.script = self.metadata.get("script", [])
31
-
32
- assert success, f"cannot load {self.name}/metadata.yaml"
33
-
34
- def run(
35
- self,
36
- object_name: str,
37
- ) -> bool:
38
- logger.info(
39
- "{}.run: {}:{} -> {}".format(
40
- NAME,
41
- self.__class__.__name__,
42
- self.name,
43
- object_name,
44
- )
45
- )
46
-
47
- return post_to_object(
48
- object_name,
49
- "input",
50
- self.script,
51
- )
File without changes