blue-assistant 4.137.1__tar.gz → 4.142.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.
- {blue_assistant-4.137.1/blue_assistant.egg-info → blue_assistant-4.142.1}/PKG-INFO +2 -2
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/README.md +1 -1
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/__init__.py +1 -1
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/config.env +1 -1
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/env.py +3 -3
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/actions/generate_image.py +7 -14
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/actions/generate_text.py +11 -31
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/base/classes.py +2 -2
- {blue_assistant-4.137.1 → blue_assistant-4.142.1/blue_assistant.egg-info}/PKG-INFO +2 -2
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/LICENSE +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/MANIFEST.in +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/abcli.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/actions.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/alias.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/blue_assistant.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/browse.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/script/list.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/script/run.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/script.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/tests/README.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/tests/help.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/tests/script_list.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/tests/script_run.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/tests/version.sh +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/README.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/__main__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/functions.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/help/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/help/__main__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/help/functions.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/help/script.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/host.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/logger.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/sample.env +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/__main__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/actions/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/actions/generic.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/actions/skip.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/load.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/base/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/blue_amo/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/blue_amo/actions/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/blue_amo/actions/slicing_into_frames.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/blue_amo/actions/stitching_the_frames.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/blue_amo/classes.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/generic/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/generic/classes.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/hue/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/hue/classes.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/orbital_data_explorer/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/orbital_data_explorer/actions/__init__.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/orbital_data_explorer/actions/researching_the_questions.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/orbital_data_explorer/classes.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/urls.py +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant.egg-info/SOURCES.txt +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant.egg-info/dependency_links.txt +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant.egg-info/requires.txt +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant.egg-info/top_level.txt +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/pyproject.toml +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/requirements.txt +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/setup.cfg +0 -0
- {blue_assistant-4.137.1 → blue_assistant-4.142.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: blue_assistant
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.142.1
|
4
4
|
Summary: 🧠 An AI Assistant.
|
5
5
|
Home-page: https://github.com/kamangir/blue-assistant
|
6
6
|
Author: Arash Abadpour (Kamangir)
|
@@ -76,4 +76,4 @@ graph LR
|
|
76
76
|
|
77
77
|
[](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)
|
78
78
|
|
79
|
-
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.
|
79
|
+
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.142.1`](https://github.com/kamangir/blue-assistant).
|
@@ -32,4 +32,4 @@ graph LR
|
|
32
32
|
|
33
33
|
[](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)
|
34
34
|
|
35
|
-
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.
|
35
|
+
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.142.1`](https://github.com/kamangir/blue-assistant).
|
@@ -10,11 +10,11 @@ BLUE_ASSISTANT_TEXT_DEFAULT_MODEL = os.getenv(
|
|
10
10
|
"",
|
11
11
|
)
|
12
12
|
|
13
|
-
|
13
|
+
BLUE_ASSISTANT_TEXT_MAX_TOKENS_str = os.getenv("BLUE_ASSISTANT_TEXT_MAX_TOKENS", "")
|
14
14
|
try:
|
15
|
-
|
15
|
+
BLUE_ASSISTANT_TEXT_MAX_TOKENS = int(BLUE_ASSISTANT_TEXT_MAX_TOKENS_str)
|
16
16
|
except Exception:
|
17
|
-
|
17
|
+
BLUE_ASSISTANT_TEXT_MAX_TOKENS = 2000
|
18
18
|
|
19
19
|
|
20
20
|
BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL = os.getenv(
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/actions/generate_image.py
RENAMED
@@ -1,6 +1,5 @@
|
|
1
1
|
from blueness import module
|
2
|
-
from
|
3
|
-
from openai_commands.image_generation.api import OpenAIImageGenerator
|
2
|
+
from openai_commands.image_generation import api
|
4
3
|
|
5
4
|
from blue_assistant import NAME
|
6
5
|
from blue_assistant.env import (
|
@@ -21,20 +20,13 @@ def generate_image(
|
|
21
20
|
) -> bool:
|
22
21
|
logger.info(f"{NAME}: {script} @ {node_name} ...")
|
23
22
|
|
24
|
-
generator = OpenAIImageGenerator(
|
25
|
-
model=BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL,
|
26
|
-
verbose=script.verbose,
|
27
|
-
)
|
28
|
-
|
29
23
|
filename = f"{node_name}.png"
|
30
24
|
|
31
|
-
success =
|
25
|
+
success, _ = api.generate_image(
|
32
26
|
prompt=script.nodes[node_name]["prompt"],
|
33
|
-
filename=
|
34
|
-
|
35
|
-
|
36
|
-
create=True,
|
37
|
-
),
|
27
|
+
filename=filename,
|
28
|
+
object_name=script.object_name,
|
29
|
+
model=BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL,
|
38
30
|
quality=(BLUE_ASSISTANT_IMAGE_DEFAULT_QUALITY if script.test_mode else "hd"),
|
39
31
|
size=(BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE if script.test_mode else "1792x1024"),
|
40
32
|
sign_with_prompt=False,
|
@@ -44,7 +36,8 @@ def generate_image(
|
|
44
36
|
script.nodes[node_name]["prompt"],
|
45
37
|
)
|
46
38
|
],
|
47
|
-
|
39
|
+
verbose=script.verbose,
|
40
|
+
)
|
48
41
|
|
49
42
|
if success:
|
50
43
|
script.nodes[node_name]["filename"] = filename
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/actions/generate_text.py
RENAMED
@@ -1,15 +1,13 @@
|
|
1
1
|
from typing import List
|
2
|
-
from openai import OpenAI
|
3
|
-
import pprint
|
4
2
|
|
5
3
|
from blueness import module
|
6
|
-
from openai_commands.
|
4
|
+
from openai_commands.text_generation import api
|
7
5
|
|
8
6
|
from blue_assistant import NAME
|
9
7
|
from blue_assistant.script.repository.base.classes import BaseScript
|
10
8
|
from blue_assistant.env import (
|
11
9
|
BLUE_ASSISTANT_TEXT_DEFAULT_MODEL,
|
12
|
-
|
10
|
+
BLUE_ASSISTANT_TEXT_MAX_TOKENS,
|
13
11
|
)
|
14
12
|
from blue_assistant.logger import logger
|
15
13
|
|
@@ -21,14 +19,10 @@ def generate_text(
|
|
21
19
|
script: BaseScript,
|
22
20
|
node_name: str,
|
23
21
|
) -> bool:
|
24
|
-
if not OPENAI_API_KEY:
|
25
|
-
logger.error("OPENAI_API_KEY is not set.")
|
26
|
-
return False
|
27
|
-
|
28
22
|
logger.info(f"{NAME}: {script} @ {node_name} ...")
|
29
23
|
|
30
24
|
messages: List = []
|
31
|
-
list_of_context_nodes = script.
|
25
|
+
list_of_context_nodes = script.get_context(node_name)
|
32
26
|
logger.info("node context: {}".format(" <- ".join(list_of_context_nodes)))
|
33
27
|
for context_node in reversed(list_of_context_nodes):
|
34
28
|
messages += [
|
@@ -56,29 +50,15 @@ def generate_text(
|
|
56
50
|
}
|
57
51
|
]
|
58
52
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
model=BLUE_ASSISTANT_TEXT_DEFAULT_MODEL,
|
68
|
-
max_tokens=BLUE_ASSISTANT_TEXT_MAX_TOKEN,
|
69
|
-
)
|
70
|
-
except Exception as e:
|
71
|
-
logger.error(str(e))
|
72
|
-
return False
|
73
|
-
|
74
|
-
if script.verbose:
|
75
|
-
logger.info("response: {}".format(response))
|
76
|
-
|
77
|
-
if not response.choices:
|
78
|
-
logger.error("no choice.")
|
79
|
-
return False
|
53
|
+
success, output, _ = api.generate_text(
|
54
|
+
messages=messages,
|
55
|
+
model=BLUE_ASSISTANT_TEXT_DEFAULT_MODEL,
|
56
|
+
max_tokens=BLUE_ASSISTANT_TEXT_MAX_TOKENS,
|
57
|
+
verbose=script.verbose,
|
58
|
+
)
|
59
|
+
if not success:
|
60
|
+
return success
|
80
61
|
|
81
|
-
output = response.choices[0].message.content
|
82
62
|
logger.info(f"🗣️ output: {output}")
|
83
63
|
script.nodes[node_name]["output"] = output
|
84
64
|
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/base/classes.py
RENAMED
@@ -81,13 +81,13 @@ class BaseScript:
|
|
81
81
|
|
82
82
|
return self.save_graph()
|
83
83
|
|
84
|
-
def
|
84
|
+
def get_context(
|
85
85
|
self,
|
86
86
|
node_name: str,
|
87
87
|
) -> List[str]:
|
88
88
|
return reduce(
|
89
89
|
lambda x, y: x + y,
|
90
|
-
[self.
|
90
|
+
[self.get_context(successor) for successor in self.G.successors(node_name)],
|
91
91
|
[node_name],
|
92
92
|
)
|
93
93
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: blue_assistant
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.142.1
|
4
4
|
Summary: 🧠 An AI Assistant.
|
5
5
|
Home-page: https://github.com/kamangir/blue-assistant
|
6
6
|
Author: Arash Abadpour (Kamangir)
|
@@ -76,4 +76,4 @@ graph LR
|
|
76
76
|
|
77
77
|
[](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)
|
78
78
|
|
79
|
-
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.
|
79
|
+
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.142.1`](https://github.com/kamangir/blue-assistant).
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/.abcli/tests/script_list.sh
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/__init__.py
RENAMED
File without changes
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/base/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/hue/__init__.py
RENAMED
File without changes
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant/script/repository/hue/classes.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.137.1 → blue_assistant-4.142.1}/blue_assistant.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|