blue-assistant 4.66.1__tar.gz → 4.87.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.66.1/blue_assistant.egg-info → blue_assistant-4.87.1}/PKG-INFO +2 -2
  2. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/README.md +1 -1
  3. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/__init__.py +1 -1
  4. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/__main__.py +1 -1
  5. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/actions/functions.py +0 -26
  6. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/actions/generate_text.py +5 -5
  7. blue_assistant-4.87.1/blue_assistant/script/repository/blue_amo/classes.py +38 -0
  8. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/repository/generic/classes.py +31 -15
  9. {blue_assistant-4.66.1 → blue_assistant-4.87.1/blue_assistant.egg-info}/PKG-INFO +2 -2
  10. blue_assistant-4.66.1/blue_assistant/script/repository/blue_amo/classes.py +0 -9
  11. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/LICENSE +0 -0
  12. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/MANIFEST.in +0 -0
  13. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/abcli.sh +0 -0
  14. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/actions.sh +0 -0
  15. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/alias.sh +0 -0
  16. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/blue_assistant.sh +0 -0
  17. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/browse.sh +0 -0
  18. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/script/list.sh +0 -0
  19. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/script/run.sh +0 -0
  20. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/script.sh +0 -0
  21. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/tests/README.sh +0 -0
  22. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/tests/help.sh +0 -0
  23. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/tests/script_list.sh +0 -0
  24. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/tests/script_run.sh +0 -0
  25. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/.abcli/tests/version.sh +0 -0
  26. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/README.py +0 -0
  27. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/__main__.py +0 -0
  28. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/config.env +0 -0
  29. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/env.py +0 -0
  30. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/functions.py +0 -0
  31. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/help/__init__.py +0 -0
  32. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/help/__main__.py +0 -0
  33. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/help/functions.py +0 -0
  34. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/help/script.py +0 -0
  35. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/host.py +0 -0
  36. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/logger.py +0 -0
  37. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/sample.env +0 -0
  38. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/__init__.py +0 -0
  39. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/actions/__init__.py +0 -0
  40. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/actions/generate_image.py +0 -0
  41. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/actions/generic.py +0 -0
  42. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/actions/wip.py +0 -0
  43. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/load.py +0 -0
  44. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/repository/__init__.py +0 -0
  45. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/repository/blue_amo/__init__.py +0 -0
  46. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/repository/generic/__init__.py +0 -0
  47. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/repository/moon_datasets/__init__.py +0 -0
  48. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/script/repository/moon_datasets/classes.py +0 -0
  49. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant/urls.py +0 -0
  50. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant.egg-info/SOURCES.txt +0 -0
  51. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant.egg-info/dependency_links.txt +0 -0
  52. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant.egg-info/requires.txt +0 -0
  53. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/blue_assistant.egg-info/top_level.txt +0 -0
  54. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/pyproject.toml +0 -0
  55. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/requirements.txt +0 -0
  56. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/setup.cfg +0 -0
  57. {blue_assistant-4.66.1 → blue_assistant-4.87.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_assistant
3
- Version: 4.66.1
3
+ Version: 4.87.1
4
4
  Summary: 🧠 An AI Assistant.
5
5
  Home-page: https://github.com/kamangir/blue-assistant
6
6
  Author: Arash Abadpour (Kamangir)
@@ -72,4 +72,4 @@ graph LR
72
72
 
73
73
  [![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)
74
74
 
75
- built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.66.1`](https://github.com/kamangir/blue-assistant).
75
+ built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.87.1`](https://github.com/kamangir/blue-assistant).
@@ -28,4 +28,4 @@ graph LR
28
28
 
29
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)
30
30
 
31
- built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.66.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.87.1`](https://github.com/kamangir/blue-assistant).
@@ -4,7 +4,7 @@ ICON = "🧠"
4
4
 
5
5
  DESCRIPTION = f"{ICON} An AI Assistant."
6
6
 
7
- VERSION = "4.66.1"
7
+ VERSION = "4.87.1"
8
8
 
9
9
  REPO_NAME = "blue-assistant"
10
10
 
@@ -28,7 +28,7 @@ parser.add_argument(
28
28
  parser.add_argument(
29
29
  "--verbose",
30
30
  type=int,
31
- default=1,
31
+ default=0,
32
32
  help="0 | 1",
33
33
  )
34
34
  parser.add_argument(
@@ -20,29 +20,3 @@ def get_action_class(
20
20
 
21
21
  logger.error(f"{action_name}: action not found.")
22
22
  return False, GenericAction
23
-
24
-
25
- def perform_action(
26
- script: BaseScript,
27
- node_name: str,
28
- ) -> bool:
29
- action_name = script.nodes[node_name].get("action", "unknown")
30
-
31
- success, action_class = get_action_class(action_name=action_name)
32
- if not success:
33
- return success
34
-
35
- logger.info(
36
- "{}.perform_action: {} == {} on {}".format(
37
- NAME,
38
- action_name,
39
- action_class.__name__,
40
- node_name,
41
- )
42
- )
43
-
44
- action_object = action_class(
45
- script=script,
46
- )
47
-
48
- return action_object.perform(node_name=node_name)
@@ -29,9 +29,9 @@ class GenerateTextAction(GenericAction):
29
29
  return False
30
30
 
31
31
  messages: List = []
32
- node_history = self.script.get_history(node_name)
33
- logger.info("node history: {}".format(node_history))
34
- for successor in reversed(node_history):
32
+ node_context = self.script.get_history(node_name)
33
+ logger.info("node context: {}".format(" <- ".join(node_context)))
34
+ for successor in reversed(node_context):
35
35
  messages += [
36
36
  {
37
37
  "role": "user",
@@ -46,7 +46,7 @@ class GenerateTextAction(GenericAction):
46
46
  }
47
47
  ]
48
48
 
49
- if self.script.G.nodes[successor]["completed"]:
49
+ if self.script.nodes[successor]["completed"]:
50
50
  messages += [
51
51
  {
52
52
  "role": "assistant",
@@ -84,7 +84,7 @@ class GenerateTextAction(GenericAction):
84
84
  output = response.choices[0].message.content
85
85
  logger.info(f"🗣️ output: {output}")
86
86
 
87
- self.script.G.nodes[node_name]["output"] = output
87
+ self.script.nodes[node_name]["output"] = output
88
88
 
89
89
  var_name = self.script.nodes[node_name].get("output", "")
90
90
  if var_name:
@@ -0,0 +1,38 @@
1
+ from blue_objects import file, path
2
+ import copy
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__))
10
+
11
+ def __init__(
12
+ self,
13
+ object_name: str,
14
+ verbose: bool = False,
15
+ ):
16
+ super().__init__(
17
+ object_name=object_name,
18
+ verbose=verbose,
19
+ )
20
+
21
+ holder_node_name = "generating-the-frames"
22
+
23
+ holder_node = self.nodes[holder_node_name]
24
+ del self.nodes[holder_node_name]
25
+ self.G.remove_node(holder_node_name)
26
+
27
+ for index in range(self.vars["frame_count"]):
28
+ node_name = f"generating-frame-{index+1:03d}"
29
+
30
+ self.nodes[node_name] = copy.deepcopy(holder_node)
31
+
32
+ self.G.add_node(node_name)
33
+ self.G.add_edge(
34
+ node_name,
35
+ "slicing-into-frames",
36
+ )
37
+
38
+ assert self.save_graph()
@@ -9,7 +9,7 @@ from blue_objects.metadata import post_to_object
9
9
 
10
10
  from blue_assistant import NAME
11
11
  from blue_assistant.script.repository.base.classes import BaseScript
12
- from blue_assistant.script.actions.functions import perform_action
12
+ from blue_assistant.script.actions.functions import get_action_class
13
13
  from blue_assistant.logger import logger
14
14
 
15
15
 
@@ -19,26 +19,45 @@ NAME = module.name(__file__, NAME)
19
19
  class GenericScript(BaseScript):
20
20
  name = path.name(file.path(__file__))
21
21
 
22
+ def perform_action(
23
+ self,
24
+ node_name: str,
25
+ ) -> bool:
26
+ action_name = self.nodes[node_name].get("action", "unknown")
27
+
28
+ success, action_class = get_action_class(action_name=action_name)
29
+ if not success:
30
+ return success
31
+
32
+ logger.info(
33
+ "{}.perform_action: {} == {} on {}".format(
34
+ NAME,
35
+ action_name,
36
+ action_class.__name__,
37
+ node_name,
38
+ )
39
+ )
40
+
41
+ action_object = action_class(script=self)
42
+
43
+ return action_object.perform(node_name=node_name)
44
+
22
45
  def run(
23
46
  self,
24
47
  ) -> bool:
25
48
  if not super().run():
26
49
  return False
27
50
 
28
- metadata: Dict[Dict] = {"nodes": {}}
29
51
  success: bool = True
30
- while (
31
- not all(self.G.nodes[node]["completed"] for node in self.G.nodes)
32
- and success
33
- ):
34
- for node_name in tqdm(self.G.nodes):
35
- if self.G.nodes[node_name]["completed"]:
52
+ while not all(self.nodes[node]["completed"] for node in self.nodes) and success:
53
+ for node_name in tqdm(self.nodes):
54
+ if self.nodes[node_name]["completed"]:
36
55
  continue
37
56
 
38
57
  pending_dependencies = [
39
58
  node_name_
40
59
  for node_name_ in self.G.successors(node_name)
41
- if not self.G.nodes[node_name_]["completed"]
60
+ if not self.nodes[node_name_]["completed"]
42
61
  ]
43
62
  if pending_dependencies:
44
63
  logger.info(
@@ -50,19 +69,16 @@ class GenericScript(BaseScript):
50
69
  )
51
70
  continue
52
71
 
53
- if not perform_action(
54
- script=self,
55
- node_name=node_name,
56
- ):
72
+ if not self.perform_action(node_name=node_name):
57
73
  success = False
58
74
  break
59
75
 
60
- self.G.nodes[node_name]["completed"] = True
76
+ self.nodes[node_name]["completed"] = True
61
77
 
62
78
  if not post_to_object(
63
79
  self.object_name,
64
80
  "output",
65
- metadata,
81
+ self.metadata,
66
82
  ):
67
83
  return False
68
84
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_assistant
3
- Version: 4.66.1
3
+ Version: 4.87.1
4
4
  Summary: 🧠 An AI Assistant.
5
5
  Home-page: https://github.com/kamangir/blue-assistant
6
6
  Author: Arash Abadpour (Kamangir)
@@ -72,4 +72,4 @@ graph LR
72
72
 
73
73
  [![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)
74
74
 
75
- built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.66.1`](https://github.com/kamangir/blue-assistant).
75
+ built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.87.1`](https://github.com/kamangir/blue-assistant).
@@ -1,9 +0,0 @@
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__))
File without changes