pygpt-net 2.6.21__py3-none-any.whl → 2.6.23__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.
- pygpt_net/CHANGELOG.txt +12 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +3 -1
- pygpt_net/controller/__init__.py +4 -8
- pygpt_net/controller/access/voice.py +2 -2
- pygpt_net/controller/agent/llama.py +3 -0
- pygpt_net/controller/assistant/batch.py +2 -3
- pygpt_net/controller/assistant/editor.py +2 -2
- pygpt_net/controller/assistant/files.py +2 -3
- pygpt_net/controller/assistant/store.py +2 -2
- pygpt_net/controller/audio/audio.py +2 -2
- pygpt_net/controller/chat/response.py +4 -0
- pygpt_net/controller/ctx/ctx.py +2 -1
- pygpt_net/controller/files/files.py +24 -55
- pygpt_net/controller/idx/indexer.py +85 -76
- pygpt_net/controller/lang/lang.py +52 -34
- pygpt_net/controller/model/importer.py +2 -2
- pygpt_net/controller/notepad/notepad.py +86 -84
- pygpt_net/controller/plugins/settings.py +3 -4
- pygpt_net/controller/settings/profile.py +105 -124
- pygpt_net/controller/theme/menu.py +154 -57
- pygpt_net/controller/theme/nodes.py +51 -44
- pygpt_net/controller/theme/theme.py +33 -9
- pygpt_net/controller/tools/tools.py +2 -2
- pygpt_net/controller/ui/tabs.py +2 -3
- pygpt_net/core/agents/observer/evaluation.py +2 -2
- pygpt_net/core/agents/runners/loop.py +1 -0
- pygpt_net/core/bridge/bridge.py +2 -0
- pygpt_net/core/ctx/container.py +13 -12
- pygpt_net/core/ctx/output.py +7 -4
- pygpt_net/core/debug/console/console.py +2 -2
- pygpt_net/core/filesystem/actions.py +1 -2
- pygpt_net/core/filesystem/opener.py +261 -0
- pygpt_net/core/filesystem/url.py +13 -10
- pygpt_net/core/platforms/platforms.py +5 -4
- pygpt_net/core/render/plain/helpers.py +2 -5
- pygpt_net/core/render/plain/renderer.py +26 -30
- pygpt_net/core/render/web/body.py +1 -1
- pygpt_net/core/settings/settings.py +43 -13
- pygpt_net/core/tabs/tabs.py +20 -13
- pygpt_net/data/config/config.json +4 -4
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/css/web-blocks.dark.css +7 -1
- pygpt_net/data/css/web-blocks.light.css +5 -2
- pygpt_net/data/css/web-chatgpt.dark.css +7 -1
- pygpt_net/data/css/web-chatgpt.light.css +3 -0
- pygpt_net/data/css/web-chatgpt_wide.dark.css +7 -1
- pygpt_net/data/css/web-chatgpt_wide.light.css +3 -0
- pygpt_net/data/locale/locale.de.ini +5 -1
- pygpt_net/data/locale/locale.en.ini +5 -1
- pygpt_net/data/locale/locale.es.ini +5 -1
- pygpt_net/data/locale/locale.fr.ini +5 -1
- pygpt_net/data/locale/locale.it.ini +5 -1
- pygpt_net/data/locale/locale.pl.ini +6 -4
- pygpt_net/data/locale/locale.uk.ini +5 -1
- pygpt_net/data/locale/locale.zh.ini +5 -1
- pygpt_net/plugin/twitter/plugin.py +2 -2
- pygpt_net/provider/core/config/patch.py +12 -1
- pygpt_net/tools/audio_transcriber/ui/dialogs.py +44 -54
- pygpt_net/tools/code_interpreter/body.py +1 -2
- pygpt_net/tools/code_interpreter/tool.py +7 -4
- pygpt_net/tools/code_interpreter/ui/html.py +1 -3
- pygpt_net/tools/code_interpreter/ui/widgets.py +2 -3
- pygpt_net/tools/html_canvas/ui/widgets.py +1 -3
- pygpt_net/tools/image_viewer/ui/dialogs.py +40 -37
- pygpt_net/tools/indexer/ui/widgets.py +2 -4
- pygpt_net/tools/media_player/tool.py +2 -5
- pygpt_net/tools/media_player/ui/widgets.py +60 -36
- pygpt_net/tools/text_editor/ui/widgets.py +18 -19
- pygpt_net/tools/translator/ui/widgets.py +39 -35
- pygpt_net/ui/base/context_menu.py +9 -4
- pygpt_net/ui/dialog/db.py +1 -3
- pygpt_net/ui/dialog/models.py +1 -3
- pygpt_net/ui/dialog/models_importer.py +2 -4
- pygpt_net/ui/dialogs.py +34 -30
- pygpt_net/ui/layout/chat/attachments.py +72 -84
- pygpt_net/ui/layout/chat/attachments_ctx.py +40 -44
- pygpt_net/ui/layout/chat/attachments_uploaded.py +36 -39
- pygpt_net/ui/layout/chat/calendar.py +100 -70
- pygpt_net/ui/layout/chat/chat.py +23 -17
- pygpt_net/ui/layout/chat/input.py +95 -118
- pygpt_net/ui/layout/chat/output.py +100 -162
- pygpt_net/ui/layout/chat/painter.py +89 -61
- pygpt_net/ui/layout/ctx/ctx_list.py +43 -52
- pygpt_net/ui/layout/status.py +23 -14
- pygpt_net/ui/layout/toolbox/agent.py +27 -38
- pygpt_net/ui/layout/toolbox/agent_llama.py +41 -45
- pygpt_net/ui/layout/toolbox/assistants.py +42 -38
- pygpt_net/ui/layout/toolbox/computer_env.py +32 -23
- pygpt_net/ui/layout/toolbox/footer.py +13 -16
- pygpt_net/ui/layout/toolbox/image.py +18 -21
- pygpt_net/ui/layout/toolbox/indexes.py +46 -89
- pygpt_net/ui/layout/toolbox/mode.py +20 -7
- pygpt_net/ui/layout/toolbox/model.py +12 -10
- pygpt_net/ui/layout/toolbox/presets.py +68 -52
- pygpt_net/ui/layout/toolbox/prompt.py +31 -58
- pygpt_net/ui/layout/toolbox/toolbox.py +25 -21
- pygpt_net/ui/layout/toolbox/vision.py +20 -22
- pygpt_net/ui/main.py +2 -4
- pygpt_net/ui/menu/about.py +64 -84
- pygpt_net/ui/menu/audio.py +87 -63
- pygpt_net/ui/menu/config.py +121 -127
- pygpt_net/ui/menu/debug.py +69 -76
- pygpt_net/ui/menu/file.py +32 -35
- pygpt_net/ui/menu/menu.py +2 -3
- pygpt_net/ui/menu/plugins.py +69 -33
- pygpt_net/ui/menu/theme.py +45 -46
- pygpt_net/ui/menu/tools.py +56 -60
- pygpt_net/ui/menu/video.py +20 -25
- pygpt_net/ui/tray.py +1 -2
- pygpt_net/ui/widget/audio/bar.py +1 -3
- pygpt_net/ui/widget/audio/input_button.py +3 -4
- pygpt_net/ui/widget/calendar/select.py +1 -2
- pygpt_net/ui/widget/dialog/base.py +12 -9
- pygpt_net/ui/widget/dialog/editor_file.py +20 -23
- pygpt_net/ui/widget/dialog/find.py +25 -24
- pygpt_net/ui/widget/dialog/profile.py +57 -53
- pygpt_net/ui/widget/draw/painter.py +62 -93
- pygpt_net/ui/widget/element/button.py +42 -30
- pygpt_net/ui/widget/element/checkbox.py +23 -15
- pygpt_net/ui/widget/element/group.py +6 -5
- pygpt_net/ui/widget/element/labels.py +1 -2
- pygpt_net/ui/widget/filesystem/explorer.py +93 -102
- pygpt_net/ui/widget/image/display.py +1 -2
- pygpt_net/ui/widget/lists/assistant.py +1 -2
- pygpt_net/ui/widget/lists/attachment.py +1 -2
- pygpt_net/ui/widget/lists/attachment_ctx.py +1 -2
- pygpt_net/ui/widget/lists/context.py +2 -4
- pygpt_net/ui/widget/lists/index.py +1 -2
- pygpt_net/ui/widget/lists/model.py +1 -2
- pygpt_net/ui/widget/lists/model_editor.py +1 -2
- pygpt_net/ui/widget/lists/model_importer.py +1 -2
- pygpt_net/ui/widget/lists/preset.py +1 -2
- pygpt_net/ui/widget/lists/preset_plugins.py +1 -2
- pygpt_net/ui/widget/lists/profile.py +1 -2
- pygpt_net/ui/widget/lists/uploaded.py +1 -2
- pygpt_net/ui/widget/option/checkbox.py +2 -4
- pygpt_net/ui/widget/option/checkbox_list.py +1 -4
- pygpt_net/ui/widget/option/cmd.py +1 -4
- pygpt_net/ui/widget/option/dictionary.py +25 -28
- pygpt_net/ui/widget/option/input.py +1 -3
- pygpt_net/ui/widget/tabs/Input.py +16 -12
- pygpt_net/ui/widget/tabs/body.py +5 -3
- pygpt_net/ui/widget/tabs/layout.py +41 -28
- pygpt_net/ui/widget/tabs/output.py +442 -85
- pygpt_net/ui/widget/textarea/calendar_note.py +1 -2
- pygpt_net/ui/widget/textarea/editor.py +41 -73
- pygpt_net/ui/widget/textarea/find.py +11 -10
- pygpt_net/ui/widget/textarea/html.py +3 -6
- pygpt_net/ui/widget/textarea/input.py +134 -69
- pygpt_net/ui/widget/textarea/notepad.py +54 -38
- pygpt_net/ui/widget/textarea/output.py +65 -54
- pygpt_net/ui/widget/textarea/search_input.py +5 -4
- pygpt_net/ui/widget/textarea/web.py +2 -4
- pygpt_net/ui/widget/vision/camera.py +2 -31
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/METADATA +38 -174
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/RECORD +160 -159
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/entry_points.txt +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtWidgets import QVBoxLayout, QWidget
|
|
@@ -17,6 +17,7 @@ from pygpt_net.utils import trans
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class Model:
|
|
20
|
+
|
|
20
21
|
def __init__(self, window=None):
|
|
21
22
|
"""
|
|
22
23
|
Toolbox UI
|
|
@@ -25,6 +26,7 @@ class Model:
|
|
|
25
26
|
"""
|
|
26
27
|
self.window = window
|
|
27
28
|
self.id = 'prompt.model'
|
|
29
|
+
self.label_key = f'{self.id}.label'
|
|
28
30
|
|
|
29
31
|
def setup(self) -> QWidget:
|
|
30
32
|
"""
|
|
@@ -42,19 +44,19 @@ class Model:
|
|
|
42
44
|
|
|
43
45
|
:return: QVBoxLayout
|
|
44
46
|
"""
|
|
45
|
-
|
|
47
|
+
nodes = self.window.ui.nodes
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
label = TitleLabel(trans("toolbox.model.label"))
|
|
50
|
+
label.setContentsMargins(5, 0, 0, 0)
|
|
51
|
+
nodes[self.label_key] = label
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
header_layout.setContentsMargins(5, 0, 0, 0)
|
|
53
|
+
combo = ModelCombo(self.window, self.id)
|
|
54
|
+
nodes[self.id] = combo
|
|
53
55
|
|
|
54
56
|
layout = QVBoxLayout()
|
|
55
|
-
layout.
|
|
56
|
-
layout.addWidget(
|
|
57
|
+
layout.addWidget(label)
|
|
58
|
+
layout.addWidget(combo)
|
|
57
59
|
layout.addStretch()
|
|
58
60
|
layout.setContentsMargins(2, 5, 5, 5)
|
|
59
61
|
|
|
60
|
-
return layout
|
|
62
|
+
return layout
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date: 2025.08.
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6 import QtCore
|
|
13
13
|
from PySide6.QtGui import QStandardItemModel, Qt, QIcon
|
|
14
|
-
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout, QPushButton,
|
|
14
|
+
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout, QPushButton, QWidget, QSizePolicy
|
|
15
15
|
|
|
16
16
|
from pygpt_net.core.types import (
|
|
17
17
|
MODE_AGENT,
|
|
@@ -19,9 +19,9 @@ from pygpt_net.core.types import (
|
|
|
19
19
|
)
|
|
20
20
|
from pygpt_net.ui.widget.element.labels import HelpLabel, TitleLabel
|
|
21
21
|
from pygpt_net.ui.widget.lists.preset import PresetList
|
|
22
|
+
|
|
22
23
|
from pygpt_net.ui.layout.toolbox.footer import Footer
|
|
23
24
|
from pygpt_net.utils import trans
|
|
24
|
-
import pygpt_net.icons_rc
|
|
25
25
|
|
|
26
26
|
class Presets:
|
|
27
27
|
def __init__(self, window=None):
|
|
@@ -34,11 +34,11 @@ class Presets:
|
|
|
34
34
|
self.footer = Footer(window)
|
|
35
35
|
self.id = 'preset.presets'
|
|
36
36
|
|
|
37
|
-
def setup(self) ->
|
|
37
|
+
def setup(self) -> QWidget:
|
|
38
38
|
"""
|
|
39
39
|
Setup presets
|
|
40
40
|
|
|
41
|
-
:return:
|
|
41
|
+
:return: QWidget
|
|
42
42
|
"""
|
|
43
43
|
presets = self.setup_presets()
|
|
44
44
|
|
|
@@ -55,41 +55,43 @@ class Presets:
|
|
|
55
55
|
|
|
56
56
|
:return: QVBoxLayout
|
|
57
57
|
"""
|
|
58
|
-
self.window.ui.nodes
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
nodes = self.window.ui.nodes
|
|
59
|
+
|
|
60
|
+
nodes['preset.presets.new'] = QPushButton(QIcon(":/icons/add.svg"), "")
|
|
61
|
+
nodes['preset.presets.new'].clicked.connect(
|
|
62
|
+
lambda _=False: self.window.controller.presets.editor.edit()
|
|
61
63
|
)
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
nodes['preset.presets.label'] = TitleLabel(trans("toolbox.presets.label"))
|
|
66
|
+
nodes['preset.agents.label'] = TitleLabel(trans("toolbox.agents.label"))
|
|
67
|
+
nodes['preset.experts.label'] = TitleLabel(trans("toolbox.experts.label"))
|
|
68
|
+
nodes['preset.presets.label'].setVisible(False)
|
|
69
|
+
nodes['preset.agents.label'].setVisible(False)
|
|
70
|
+
nodes['preset.experts.label'].setVisible(False)
|
|
69
71
|
|
|
70
72
|
header = QHBoxLayout()
|
|
71
|
-
header.addWidget(
|
|
72
|
-
header.addWidget(
|
|
73
|
-
header.addWidget(
|
|
74
|
-
header.addWidget(
|
|
73
|
+
header.addWidget(nodes['preset.presets.label'])
|
|
74
|
+
header.addWidget(nodes['preset.agents.label'])
|
|
75
|
+
header.addWidget(nodes['preset.experts.label'])
|
|
76
|
+
header.addWidget(nodes['preset.presets.new'], alignment=Qt.AlignRight)
|
|
75
77
|
header.setContentsMargins(5, 0, 0, 0)
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
nodes[self.id] = PresetList(self.window, self.id)
|
|
80
|
+
nodes[self.id].selection_locked = self.window.controller.presets.preset_change_locked
|
|
81
|
+
nodes[self.id].setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
nodes['tip.toolbox.presets'] = HelpLabel(trans('tip.toolbox.presets'), self.window)
|
|
84
|
+
nodes['tip.toolbox.presets'].setAlignment(Qt.AlignCenter)
|
|
83
85
|
|
|
84
86
|
layout = QVBoxLayout()
|
|
85
87
|
layout.addStretch()
|
|
86
88
|
layout.addLayout(header)
|
|
87
|
-
layout.addWidget(
|
|
88
|
-
layout.addWidget(
|
|
89
|
+
layout.addWidget(nodes[self.id], 1)
|
|
90
|
+
layout.addWidget(nodes['tip.toolbox.presets'])
|
|
89
91
|
layout.setContentsMargins(2, 5, 5, 5)
|
|
90
92
|
|
|
91
93
|
self.window.ui.models[self.id] = self.create_model(self.window)
|
|
92
|
-
|
|
94
|
+
nodes[self.id].setModel(self.window.ui.models[self.id])
|
|
93
95
|
|
|
94
96
|
return layout
|
|
95
97
|
|
|
@@ -108,38 +110,52 @@ class Presets:
|
|
|
108
110
|
:param data: Data to update
|
|
109
111
|
"""
|
|
110
112
|
mode = self.window.core.config.get('mode')
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
nodes = self.window.ui.nodes
|
|
114
|
+
models = self.window.ui.models
|
|
115
|
+
|
|
116
|
+
view = nodes[self.id]
|
|
117
|
+
model = models.get(self.id)
|
|
113
118
|
|
|
114
119
|
view.backup_selection()
|
|
115
120
|
|
|
116
121
|
if model is None:
|
|
117
122
|
model = self.create_model(self.window)
|
|
118
|
-
|
|
123
|
+
models[self.id] = model
|
|
119
124
|
view.setModel(model)
|
|
120
125
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
126
|
+
view.setUpdatesEnabled(False)
|
|
127
|
+
try:
|
|
128
|
+
if not data:
|
|
129
|
+
model.setRowCount(0)
|
|
130
|
+
else:
|
|
131
|
+
count = len(data)
|
|
132
|
+
model.setRowCount(count)
|
|
133
|
+
|
|
134
|
+
is_expert_mode = (mode == MODE_EXPERT)
|
|
135
|
+
is_agent_mode = (mode == MODE_AGENT)
|
|
136
|
+
count_experts = self.window.core.experts.count_experts if is_agent_mode else None
|
|
137
|
+
startswith_current = "current."
|
|
138
|
+
|
|
139
|
+
index_fn = model.index
|
|
140
|
+
set_item_data = model.setItemData
|
|
141
|
+
display_role = QtCore.Qt.DisplayRole
|
|
142
|
+
tooltip_role = QtCore.Qt.ToolTipRole
|
|
143
|
+
|
|
144
|
+
for i, (key, item) in enumerate(data.items()):
|
|
145
|
+
name = item.name
|
|
146
|
+
if is_expert_mode and item.enabled and not key.startswith(startswith_current):
|
|
147
|
+
name = "[x] " + name
|
|
148
|
+
elif is_agent_mode:
|
|
149
|
+
num_experts = count_experts(key)
|
|
150
|
+
if num_experts > 0:
|
|
151
|
+
name = f"{name} ({num_experts} experts)"
|
|
152
|
+
|
|
153
|
+
prompt = str(item.prompt)
|
|
154
|
+
tooltip = prompt if len(prompt) <= 80 else f"{prompt[:80]}..."
|
|
155
|
+
|
|
156
|
+
idx = index_fn(i, 0)
|
|
157
|
+
set_item_data(idx, {display_role: name, tooltip_role: tooltip})
|
|
158
|
+
finally:
|
|
159
|
+
view.setUpdatesEnabled(True)
|
|
144
160
|
|
|
145
161
|
view.restore_selection()
|
|
@@ -6,18 +6,16 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date: 2025.
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import Qt, QIcon
|
|
13
|
-
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout,
|
|
13
|
+
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout, QWidget, QSizePolicy
|
|
14
14
|
|
|
15
|
-
from pygpt_net.ui.widget.anims.toggles import AnimToggle
|
|
16
15
|
from pygpt_net.ui.widget.element.labels import HelpLabel, TitleLabel
|
|
17
16
|
from pygpt_net.ui.widget.option.prompt import PromptTextarea
|
|
18
17
|
from pygpt_net.ui.widget.option.toggle_label import ToggleLabel
|
|
19
18
|
from pygpt_net.utils import trans
|
|
20
|
-
import pygpt_net.icons_rc
|
|
21
19
|
|
|
22
20
|
class Prompt:
|
|
23
21
|
def __init__(self, window=None):
|
|
@@ -34,67 +32,42 @@ class Prompt:
|
|
|
34
32
|
|
|
35
33
|
:return: QWidget
|
|
36
34
|
"""
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
label_position="left",
|
|
40
|
-
icon = ":/icons/build.svg",
|
|
41
|
-
parent=self.window
|
|
42
|
-
)
|
|
43
|
-
self.window.ui.nodes['cmd.enabled'].box.stateChanged.connect(
|
|
44
|
-
lambda: self.window.controller.chat.common.toggle_cmd(self.window.ui.nodes['cmd.enabled'].box.isChecked())
|
|
45
|
-
)
|
|
46
|
-
self.window.ui.nodes['cmd.enabled'].box.setToolTip(trans('cmd.tip'))
|
|
47
|
-
self.window.ui.nodes['cmd.enabled'].box.setIcon(QIcon(":/icons/add.svg"))
|
|
35
|
+
w = self.window
|
|
36
|
+
nodes = w.ui.nodes
|
|
48
37
|
|
|
49
|
-
|
|
50
|
-
self.window.ui.nodes['toolbox.prompt.label'] = TitleLabel(trans("toolbox.prompt"))
|
|
38
|
+
nodes['toolbox.prompt.label'] = TitleLabel(trans("toolbox.prompt"))
|
|
51
39
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
nodes['cmd.enabled'] = ToggleLabel(
|
|
41
|
+
trans('cmd.enabled'),
|
|
42
|
+
label_position="left",
|
|
43
|
+
icon=":/icons/build.svg",
|
|
44
|
+
parent=w
|
|
45
|
+
)
|
|
46
|
+
box = nodes['cmd.enabled'].box
|
|
47
|
+
box.toggled.connect(w.controller.chat.common.toggle_cmd)
|
|
48
|
+
box.setToolTip(trans('cmd.tip'))
|
|
49
|
+
box.setIcon(QIcon(":/icons/add.svg"))
|
|
57
50
|
|
|
58
51
|
header_widget = QWidget()
|
|
59
|
-
header_widget
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
self.window.ui.nodes['preset.clear'].clicked.connect(
|
|
65
|
-
lambda: self.window.controller.presets.clear())
|
|
66
|
-
|
|
67
|
-
# use
|
|
68
|
-
self.window.ui.nodes['preset.use'] = QPushButton(trans('preset.use'))
|
|
69
|
-
self.window.ui.nodes['preset.use'].clicked.connect(
|
|
70
|
-
lambda: self.window.controller.presets.use())
|
|
71
|
-
self.window.ui.nodes['preset.use'].setVisible(False)
|
|
72
|
-
|
|
52
|
+
header_layout = QHBoxLayout(header_widget)
|
|
53
|
+
header_layout.addWidget(nodes['toolbox.prompt.label'])
|
|
54
|
+
header_layout.addStretch(1)
|
|
55
|
+
header_layout.addWidget(nodes['cmd.enabled'])
|
|
56
|
+
header_layout.setContentsMargins(5, 0, 10, 0)
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
#header.addStretch(1)
|
|
78
|
-
#header.addWidget(self.window.ui.nodes['preset.use'], alignment=Qt.AlignRight)
|
|
79
|
-
#header.addWidget(self.window.ui.nodes['preset.clear'], alignment=Qt.AlignRight)
|
|
80
|
-
"""
|
|
58
|
+
option = w.controller.presets.editor.get_option('prompt')
|
|
59
|
+
nodes['preset.prompt'] = PromptTextarea(w, 'preset', 'prompt', option)
|
|
60
|
+
nodes['preset.prompt'].setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
|
81
61
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
self.window.ui.nodes['preset.prompt'] = PromptTextarea(self.window, 'preset', 'prompt', option)
|
|
85
|
-
self.window.ui.nodes['preset.prompt'].setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
|
86
|
-
self.window.ui.nodes['tip.toolbox.prompt'] = HelpLabel(trans('tip.toolbox.prompt'), self.window)
|
|
87
|
-
self.window.ui.nodes['tip.toolbox.prompt'].setAlignment(Qt.AlignCenter)
|
|
62
|
+
nodes['tip.toolbox.prompt'] = HelpLabel(trans('tip.toolbox.prompt'), w)
|
|
63
|
+
nodes['tip.toolbox.prompt'].setAlignment(Qt.AlignCenter)
|
|
88
64
|
|
|
89
|
-
|
|
90
|
-
layout = QVBoxLayout()
|
|
65
|
+
layout_widget = QWidget()
|
|
66
|
+
layout = QVBoxLayout(layout_widget)
|
|
91
67
|
layout.addWidget(header_widget)
|
|
92
|
-
layout.addWidget(
|
|
93
|
-
layout.addWidget(
|
|
68
|
+
layout.addWidget(nodes['preset.prompt'])
|
|
69
|
+
layout.addWidget(nodes['tip.toolbox.prompt'])
|
|
94
70
|
layout.setContentsMargins(2, 5, 5, 5)
|
|
95
71
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
|
99
|
-
|
|
100
|
-
return widget
|
|
72
|
+
layout_widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
|
73
|
+
return layout_widget
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import Qt
|
|
@@ -46,34 +46,38 @@ class ToolboxMain:
|
|
|
46
46
|
:return: QSplitter
|
|
47
47
|
:rtype: QSplitter
|
|
48
48
|
"""
|
|
49
|
+
ui = self.window.ui
|
|
50
|
+
nodes = ui.nodes
|
|
51
|
+
|
|
49
52
|
# mode / model
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
tip = HelpLabel(trans('tip.toolbox.mode'), self.window)
|
|
54
|
+
tip.setAlignment(Qt.AlignCenter)
|
|
55
|
+
nodes['tip.toolbox.mode'] = tip
|
|
52
56
|
|
|
53
57
|
# presets / assistants
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
self.
|
|
58
|
+
toolbox_mode = QWidget(self.window)
|
|
59
|
+
layout = QVBoxLayout(toolbox_mode)
|
|
60
|
+
layout.addWidget(self.mode.setup()) # modes
|
|
61
|
+
layout.addWidget(self.model.setup()) # models
|
|
62
|
+
layout.addWidget(tip)
|
|
63
|
+
layout.addWidget(self.presets.setup(), 1) # presets / agents
|
|
64
|
+
layout.addWidget(self.assistants.setup(), 1) # assistants
|
|
65
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
toolbox_mode.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
|
68
|
+
nodes['toolbox.mode'] = toolbox_mode
|
|
69
|
+
nodes['toolbox.mode.layout'] = layout
|
|
65
70
|
|
|
66
|
-
|
|
71
|
+
bottom_widget = QWidget(self.window)
|
|
72
|
+
bottom = QVBoxLayout(bottom_widget)
|
|
67
73
|
bottom.addWidget(self.prompt.setup())
|
|
68
74
|
bottom.addWidget(self.footer.setup())
|
|
69
75
|
bottom.setContentsMargins(0, 0, 0, 0)
|
|
70
76
|
|
|
71
|
-
bottom_widget = QWidget()
|
|
72
|
-
bottom_widget.setLayout(bottom)
|
|
73
|
-
|
|
74
77
|
# rows
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
splitter = QSplitter(Qt.Vertical, self.window)
|
|
79
|
+
splitter.addWidget(toolbox_mode) # mode/model
|
|
80
|
+
splitter.addWidget(bottom_widget) # system prompt, footer (names, temp, logo, etc.)
|
|
81
|
+
ui.splitters['toolbox'] = splitter
|
|
78
82
|
|
|
79
|
-
return
|
|
83
|
+
return splitter
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtWidgets import QVBoxLayout, QLabel, QHBoxLayout, QWidget, QCheckBox
|
|
@@ -29,33 +29,31 @@ class Vision:
|
|
|
29
29
|
|
|
30
30
|
:return: QWidget
|
|
31
31
|
"""
|
|
32
|
-
|
|
33
|
-
self.window.
|
|
34
|
-
self.window.ui.nodes['vision.capture.enable'].stateChanged.connect(
|
|
35
|
-
lambda: self.window.controller.camera.toggle(self.window.ui.nodes['vision.capture.enable'].isChecked()))
|
|
36
|
-
self.window.ui.nodes['vision.capture.enable'].setToolTip(trans('vision.capture.enable.tooltip'))
|
|
32
|
+
nodes = self.window.ui.nodes
|
|
33
|
+
camera = self.window.controller.camera
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
self.window.ui.nodes['vision.capture.auto'].stateChanged.connect(
|
|
41
|
-
lambda: self.window.controller.camera.toggle_auto(self.window.ui.nodes['vision.capture.auto'].isChecked()))
|
|
42
|
-
self.window.ui.nodes['vision.capture.auto'].setToolTip(trans('vision.capture.auto.tooltip'))
|
|
35
|
+
nodes['vision.capture.options'] = QWidget()
|
|
36
|
+
options = nodes['vision.capture.options']
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
nodes['vision.capture.enable'] = QCheckBox(trans("vision.capture.enable"), parent=options)
|
|
39
|
+
nodes['vision.capture.enable'].toggled.connect(camera.toggle)
|
|
40
|
+
nodes['vision.capture.enable'].setToolTip(trans('vision.capture.enable.tooltip'))
|
|
41
|
+
|
|
42
|
+
nodes['vision.capture.auto'] = QCheckBox(trans("vision.capture.auto"), parent=options)
|
|
43
|
+
nodes['vision.capture.auto'].toggled.connect(camera.toggle_auto)
|
|
44
|
+
nodes['vision.capture.auto'].setToolTip(trans('vision.capture.auto.tooltip'))
|
|
45
|
+
|
|
46
|
+
nodes['vision.capture.label'] = QLabel(trans('vision.capture.options.title'), parent=options)
|
|
45
47
|
|
|
46
|
-
# checkbox options
|
|
47
48
|
cols = QHBoxLayout()
|
|
48
|
-
cols.addWidget(
|
|
49
|
-
cols.addWidget(
|
|
49
|
+
cols.addWidget(nodes['vision.capture.enable'])
|
|
50
|
+
cols.addWidget(nodes['vision.capture.auto'])
|
|
50
51
|
|
|
51
|
-
# rows
|
|
52
52
|
rows = QVBoxLayout()
|
|
53
|
-
rows.addWidget(
|
|
53
|
+
rows.addWidget(nodes['vision.capture.label'])
|
|
54
54
|
rows.addLayout(cols)
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
self.window.ui.nodes['vision.capture.options'].setLayout(rows)
|
|
59
|
-
self.window.ui.nodes['vision.capture.options'].setContentsMargins(0, 0, 0, 0)
|
|
56
|
+
options.setLayout(rows)
|
|
57
|
+
options.setContentsMargins(0, 0, 0, 0)
|
|
60
58
|
|
|
61
|
-
return
|
|
59
|
+
return options
|
pygpt_net/ui/main.py
CHANGED
|
@@ -6,15 +6,14 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date: 2025.08.
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import os
|
|
13
13
|
|
|
14
14
|
from PySide6.QtCore import QTimer, Signal, Slot, QThreadPool, QEvent, Qt, QLoggingCategory, QEventLoop
|
|
15
15
|
from PySide6.QtGui import QShortcut, QKeySequence
|
|
16
|
-
from
|
|
17
|
-
from PySide6.QtWidgets import QMainWindow
|
|
16
|
+
from PySide6.QtWidgets import QMainWindow, QApplication
|
|
18
17
|
from qt_material import QtStyleTools
|
|
19
18
|
|
|
20
19
|
from pygpt_net.core.events import BaseEvent, KernelEvent, ControlEvent
|
|
@@ -25,7 +24,6 @@ from pygpt_net.ui import UI
|
|
|
25
24
|
from pygpt_net.ui.widget.textarea.web import ChatWebOutput
|
|
26
25
|
from pygpt_net.utils import get_app_meta
|
|
27
26
|
|
|
28
|
-
|
|
29
27
|
class MainWindow(QMainWindow, QtStyleTools):
|
|
30
28
|
|
|
31
29
|
# states
|