pygpt-net 2.7.4__py3-none-any.whl → 2.7.5__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 +7 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app_core.py +4 -2
- pygpt_net/controller/__init__.py +5 -1
- pygpt_net/controller/assistant/assistant.py +1 -4
- pygpt_net/controller/assistant/batch.py +5 -504
- pygpt_net/controller/assistant/editor.py +5 -5
- pygpt_net/controller/assistant/files.py +16 -16
- pygpt_net/controller/chat/handler/google_stream.py +307 -1
- pygpt_net/controller/chat/handler/worker.py +8 -1
- pygpt_net/controller/chat/image.py +2 -2
- pygpt_net/controller/dialogs/confirm.py +73 -101
- pygpt_net/controller/lang/mapping.py +9 -9
- pygpt_net/controller/painter/capture.py +50 -1
- pygpt_net/controller/presets/presets.py +2 -1
- pygpt_net/controller/remote_store/__init__.py +12 -0
- pygpt_net/{provider/core/assistant_file/db_sqlite → controller/remote_store/google}/__init__.py +2 -2
- pygpt_net/controller/remote_store/google/batch.py +402 -0
- pygpt_net/controller/remote_store/google/store.py +615 -0
- pygpt_net/controller/remote_store/openai/__init__.py +12 -0
- pygpt_net/controller/remote_store/openai/batch.py +524 -0
- pygpt_net/controller/{assistant → remote_store/openai}/store.py +63 -60
- pygpt_net/controller/remote_store/remote_store.py +35 -0
- pygpt_net/controller/ui/ui.py +20 -1
- pygpt_net/core/assistants/assistants.py +3 -15
- pygpt_net/core/db/database.py +5 -3
- pygpt_net/core/locale/placeholder.py +35 -0
- pygpt_net/core/remote_store/__init__.py +12 -0
- pygpt_net/core/remote_store/google/__init__.py +11 -0
- pygpt_net/core/remote_store/google/files.py +224 -0
- pygpt_net/core/remote_store/google/store.py +248 -0
- pygpt_net/core/remote_store/openai/__init__.py +11 -0
- pygpt_net/core/{assistants → remote_store/openai}/files.py +26 -19
- pygpt_net/core/{assistants → remote_store/openai}/store.py +32 -15
- pygpt_net/core/remote_store/remote_store.py +24 -0
- pygpt_net/data/config/config.json +8 -4
- pygpt_net/data/config/models.json +77 -3
- pygpt_net/data/config/settings.json +45 -0
- pygpt_net/data/locale/locale.de.ini +41 -41
- pygpt_net/data/locale/locale.en.ini +53 -43
- pygpt_net/data/locale/locale.es.ini +41 -41
- pygpt_net/data/locale/locale.fr.ini +41 -41
- pygpt_net/data/locale/locale.it.ini +41 -41
- pygpt_net/data/locale/locale.pl.ini +42 -42
- pygpt_net/data/locale/locale.uk.ini +41 -41
- pygpt_net/data/locale/locale.zh.ini +41 -41
- pygpt_net/data/locale/plugin.cmd_history.de.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.en.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.es.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.fr.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.it.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.pl.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.uk.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_history.zh.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_mouse_control.en.ini +14 -0
- pygpt_net/data/locale/plugin.cmd_web.de.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.en.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.es.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.fr.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.it.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.pl.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.uk.ini +1 -1
- pygpt_net/data/locale/plugin.cmd_web.zh.ini +1 -1
- pygpt_net/data/locale/plugin.idx_llama_index.de.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.en.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.es.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.fr.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.it.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.pl.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.uk.ini +2 -2
- pygpt_net/data/locale/plugin.idx_llama_index.zh.ini +2 -2
- pygpt_net/item/assistant.py +1 -211
- pygpt_net/item/ctx.py +3 -1
- pygpt_net/item/store.py +238 -0
- pygpt_net/migrations/Version20260102190000.py +35 -0
- pygpt_net/migrations/__init__.py +3 -1
- pygpt_net/plugin/cmd_mouse_control/config.py +470 -1
- pygpt_net/plugin/cmd_mouse_control/plugin.py +488 -22
- pygpt_net/plugin/cmd_mouse_control/worker.py +464 -87
- pygpt_net/plugin/cmd_mouse_control/worker_sandbox.py +729 -0
- pygpt_net/plugin/idx_llama_index/config.py +2 -2
- pygpt_net/provider/api/google/__init__.py +16 -54
- pygpt_net/provider/api/google/chat.py +546 -129
- pygpt_net/provider/api/google/computer.py +190 -0
- pygpt_net/provider/api/google/realtime/realtime.py +2 -2
- pygpt_net/provider/api/google/remote_tools.py +93 -0
- pygpt_net/provider/api/google/store.py +546 -0
- pygpt_net/provider/api/google/worker/__init__.py +0 -0
- pygpt_net/provider/api/google/worker/importer.py +392 -0
- pygpt_net/provider/api/openai/computer.py +10 -1
- pygpt_net/provider/api/openai/store.py +6 -6
- pygpt_net/provider/api/openai/worker/importer.py +24 -24
- pygpt_net/provider/core/config/patch.py +16 -1
- pygpt_net/provider/core/config/patches/patch_before_2_6_42.py +3 -3
- pygpt_net/provider/core/model/patch.py +17 -3
- pygpt_net/provider/core/preset/json_file.py +13 -7
- pygpt_net/provider/core/{assistant_file → remote_file}/__init__.py +1 -1
- pygpt_net/provider/core/{assistant_file → remote_file}/base.py +9 -9
- pygpt_net/provider/core/remote_file/db_sqlite/__init__.py +12 -0
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/patch.py +1 -1
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/provider.py +23 -20
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/storage.py +35 -27
- pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/utils.py +5 -4
- pygpt_net/provider/core/{assistant_store → remote_store}/__init__.py +1 -1
- pygpt_net/provider/core/{assistant_store → remote_store}/base.py +10 -10
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/__init__.py +1 -1
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/patch.py +1 -1
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/provider.py +16 -15
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/storage.py +30 -23
- pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/utils.py +5 -4
- pygpt_net/provider/core/{assistant_store → remote_store}/json_file.py +9 -9
- pygpt_net/provider/llms/google.py +2 -2
- pygpt_net/ui/base/config_dialog.py +3 -2
- pygpt_net/ui/dialog/assistant.py +3 -3
- pygpt_net/ui/dialog/plugins.py +3 -1
- pygpt_net/ui/dialog/remote_store_google.py +539 -0
- pygpt_net/ui/dialog/{assistant_store.py → remote_store_openai.py} +95 -95
- pygpt_net/ui/dialogs.py +5 -3
- pygpt_net/ui/layout/chat/attachments_uploaded.py +3 -3
- pygpt_net/ui/layout/toolbox/computer_env.py +26 -8
- pygpt_net/ui/menu/tools.py +13 -5
- pygpt_net/ui/widget/dialog/remote_store_google.py +56 -0
- pygpt_net/ui/widget/dialog/{assistant_store.py → remote_store_openai.py} +9 -9
- pygpt_net/ui/widget/element/button.py +4 -4
- pygpt_net/ui/widget/lists/remote_store_google.py +248 -0
- pygpt_net/ui/widget/lists/{assistant_store.py → remote_store_openai.py} +21 -21
- pygpt_net/ui/widget/option/checkbox_list.py +47 -9
- pygpt_net/ui/widget/option/combo.py +39 -3
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.5.dist-info}/METADATA +33 -2
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.5.dist-info}/RECORD +133 -108
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.5.dist-info}/LICENSE +0 -0
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.5.dist-info}/WHEEL +0 -0
- {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.5.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: 2026.01.02 19:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import copy
|
|
@@ -16,10 +16,10 @@ from PySide6.QtGui import QStandardItemModel, QAction, QIcon
|
|
|
16
16
|
from PySide6.QtWidgets import QPushButton, QHBoxLayout, QLabel, QVBoxLayout, QScrollArea, QWidget, QTabWidget, QFrame, \
|
|
17
17
|
QSplitter, QSizePolicy, QMenuBar, QCheckBox, QMenu, QListView
|
|
18
18
|
|
|
19
|
-
from pygpt_net.ui.widget.dialog.
|
|
19
|
+
from pygpt_net.ui.widget.dialog.remote_store_openai import RemoteStoreOpenAIDialog
|
|
20
20
|
from pygpt_net.ui.widget.element.group import CollapsedGroup
|
|
21
21
|
from pygpt_net.ui.widget.element.labels import UrlLabel
|
|
22
|
-
from pygpt_net.ui.widget.lists.
|
|
22
|
+
from pygpt_net.ui.widget.lists.remote_store_openai import RemoteStoreOpenAIEditorList
|
|
23
23
|
from pygpt_net.ui.widget.option.checkbox import OptionCheckbox
|
|
24
24
|
from pygpt_net.ui.widget.option.checkbox_list import OptionCheckboxList
|
|
25
25
|
from pygpt_net.ui.widget.option.combo import OptionCombo
|
|
@@ -30,7 +30,7 @@ from pygpt_net.ui.widget.option.textarea import OptionTextarea
|
|
|
30
30
|
from pygpt_net.utils import trans
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
class
|
|
33
|
+
class RemoteStoreOpenAI:
|
|
34
34
|
def __init__(self, window=None):
|
|
35
35
|
"""
|
|
36
36
|
Assistant vector store editor dialog
|
|
@@ -38,7 +38,7 @@ class AssistantVectorStore:
|
|
|
38
38
|
:param window: Window instance
|
|
39
39
|
"""
|
|
40
40
|
self.window = window
|
|
41
|
-
self.dialog_id = "
|
|
41
|
+
self.dialog_id = "remote_store.openai"
|
|
42
42
|
|
|
43
43
|
def setup(self, idx=None):
|
|
44
44
|
"""
|
|
@@ -53,43 +53,43 @@ class AssistantVectorStore:
|
|
|
53
53
|
controller = self.window.controller
|
|
54
54
|
core = self.window.core
|
|
55
55
|
|
|
56
|
-
nodes['
|
|
57
|
-
nodes['
|
|
58
|
-
nodes['
|
|
59
|
-
nodes['
|
|
56
|
+
nodes['remote_store.openai.btn.new'] = QPushButton(trans("dialog.remote_store.btn.new"))
|
|
57
|
+
nodes['remote_store.openai.btn.save'] = QPushButton(trans("dialog.remote_store.btn.save"))
|
|
58
|
+
nodes['remote_store.openai.btn.refresh_status'] = QPushButton(QIcon(":/icons/reload.svg"), "")
|
|
59
|
+
nodes['remote_store.openai.btn.close'] = QPushButton(trans("dialog.remote_store.btn.close"))
|
|
60
60
|
|
|
61
|
-
nodes['
|
|
62
|
-
trans("dialog.
|
|
61
|
+
nodes['remote_store.openai.btn.refresh_status'].setToolTip(
|
|
62
|
+
trans("dialog.remote_store.btn.refresh_status")
|
|
63
63
|
)
|
|
64
|
-
nodes['
|
|
64
|
+
nodes['remote_store.openai.btn.refresh_status'].setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
|
65
65
|
|
|
66
|
-
nodes['
|
|
67
|
-
nodes['
|
|
66
|
+
nodes['remote_store.openai.btn.upload.files'] = QPushButton(trans("dialog.remote_store.btn.upload.files"))
|
|
67
|
+
nodes['remote_store.openai.btn.upload.dir'] = QPushButton(trans("dialog.remote_store.btn.upload.dir"))
|
|
68
68
|
|
|
69
|
-
nodes['
|
|
70
|
-
nodes['
|
|
71
|
-
nodes['
|
|
72
|
-
controller.
|
|
69
|
+
nodes['remote_store.openai.hide_thread'] = QCheckBox(trans("remote_store.openai.hide_threads"))
|
|
70
|
+
nodes['remote_store.openai.hide_thread'].setChecked(bool(core.config.get("remote_store.openai.hide_threads")))
|
|
71
|
+
nodes['remote_store.openai.hide_thread'].toggled.connect(
|
|
72
|
+
controller.remote_store.openai.set_hide_thread
|
|
73
73
|
)
|
|
74
74
|
|
|
75
|
-
nodes['
|
|
76
|
-
nodes['
|
|
77
|
-
nodes['
|
|
78
|
-
nodes['
|
|
79
|
-
nodes['
|
|
80
|
-
nodes['
|
|
75
|
+
nodes['remote_store.openai.btn.new'].clicked.connect(controller.remote_store.openai.new)
|
|
76
|
+
nodes['remote_store.openai.btn.save'].clicked.connect(controller.remote_store.openai.save_btn)
|
|
77
|
+
nodes['remote_store.openai.btn.close'].clicked.connect(controller.remote_store.openai.close)
|
|
78
|
+
nodes['remote_store.openai.btn.refresh_status'].clicked.connect(controller.remote_store.openai.refresh_status)
|
|
79
|
+
nodes['remote_store.openai.btn.upload.files'].clicked.connect(controller.remote_store.openai.batch.open_upload_files)
|
|
80
|
+
nodes['remote_store.openai.btn.upload.dir'].clicked.connect(controller.remote_store.openai.batch.open_upload_dir)
|
|
81
81
|
|
|
82
|
-
nodes['
|
|
83
|
-
nodes['
|
|
84
|
-
nodes['
|
|
82
|
+
nodes['remote_store.openai.btn.new'].setAutoDefault(False)
|
|
83
|
+
nodes['remote_store.openai.btn.refresh_status'].setAutoDefault(False)
|
|
84
|
+
nodes['remote_store.openai.btn.save'].setAutoDefault(True)
|
|
85
85
|
|
|
86
86
|
footer = QHBoxLayout()
|
|
87
|
-
footer.addWidget(nodes['
|
|
88
|
-
footer.addWidget(nodes['
|
|
87
|
+
footer.addWidget(nodes['remote_store.openai.btn.close'])
|
|
88
|
+
footer.addWidget(nodes['remote_store.openai.btn.save'])
|
|
89
89
|
|
|
90
|
-
ui.tabs['
|
|
90
|
+
ui.tabs['remote_store.openai'] = QTabWidget()
|
|
91
91
|
|
|
92
|
-
parent_id = "
|
|
92
|
+
parent_id = "remote_store.openai"
|
|
93
93
|
|
|
94
94
|
scroll = QScrollArea()
|
|
95
95
|
scroll.setWidgetResizable(True)
|
|
@@ -98,7 +98,7 @@ class AssistantVectorStore:
|
|
|
98
98
|
if parent_id not in ui.config:
|
|
99
99
|
ui.config[parent_id] = {}
|
|
100
100
|
|
|
101
|
-
options = copy.deepcopy(controller.
|
|
101
|
+
options = copy.deepcopy(controller.remote_store.openai.get_options())
|
|
102
102
|
widgets = self.build_widgets(options)
|
|
103
103
|
advanced_keys = [k for k, v in options.items() if v.get('advanced')]
|
|
104
104
|
|
|
@@ -111,7 +111,7 @@ class AssistantVectorStore:
|
|
|
111
111
|
content.addLayout(self.add_option(widgets[key], options[key]))
|
|
112
112
|
|
|
113
113
|
if advanced_keys:
|
|
114
|
-
group_id = '
|
|
114
|
+
group_id = 'remote_store.openai.advanced'
|
|
115
115
|
ui.groups[group_id] = CollapsedGroup(self.window, group_id, None, False, None)
|
|
116
116
|
ui.groups[group_id].box.setText(trans('settings.advanced.collapse'))
|
|
117
117
|
for key in widgets:
|
|
@@ -134,21 +134,21 @@ class AssistantVectorStore:
|
|
|
134
134
|
area_widget = QWidget()
|
|
135
135
|
area_widget.setLayout(area)
|
|
136
136
|
|
|
137
|
-
list_id = '
|
|
138
|
-
nodes[list_id] =
|
|
137
|
+
list_id = 'remote_store.openai.list'
|
|
138
|
+
nodes[list_id] = RemoteStoreOpenAIEditorList(self.window, list_id)
|
|
139
139
|
models[list_id] = self.create_model(self.window)
|
|
140
140
|
nodes[list_id].setModel(models[list_id])
|
|
141
141
|
nodes[list_id].setMinimumWidth(250)
|
|
142
142
|
|
|
143
143
|
left_layout = QVBoxLayout()
|
|
144
|
-
left_layout.addWidget(nodes['
|
|
144
|
+
left_layout.addWidget(nodes['remote_store.openai.btn.new'])
|
|
145
145
|
left_layout.addWidget(nodes[list_id])
|
|
146
|
-
left_layout.addWidget(nodes['
|
|
146
|
+
left_layout.addWidget(nodes['remote_store.openai.hide_thread'])
|
|
147
147
|
left_layout.setContentsMargins(0, 0, 0, 0)
|
|
148
148
|
left_widget = QWidget()
|
|
149
149
|
left_widget.setLayout(left_layout)
|
|
150
150
|
|
|
151
|
-
self.update_list(list_id, core.
|
|
151
|
+
self.update_list(list_id, core.remote_store.openai.items)
|
|
152
152
|
|
|
153
153
|
# ==================== Files panel ====================
|
|
154
154
|
files_panel = QVBoxLayout()
|
|
@@ -156,7 +156,7 @@ class AssistantVectorStore:
|
|
|
156
156
|
files_label.setStyleSheet("font-weight: bold;")
|
|
157
157
|
files_panel.addWidget(files_label)
|
|
158
158
|
|
|
159
|
-
files_list_id = '
|
|
159
|
+
files_list_id = 'remote_store.openai.files.list'
|
|
160
160
|
nodes[files_list_id] = QListView()
|
|
161
161
|
nodes[files_list_id].setEditTriggers(QListView.NoEditTriggers)
|
|
162
162
|
nodes[files_list_id].setSelectionMode(QListView.SingleSelection)
|
|
@@ -169,9 +169,9 @@ class AssistantVectorStore:
|
|
|
169
169
|
|
|
170
170
|
files_bottom = QHBoxLayout()
|
|
171
171
|
files_bottom.setContentsMargins(0, 0, 0, 0)
|
|
172
|
-
files_bottom.addWidget(nodes['
|
|
173
|
-
files_bottom.addWidget(nodes['
|
|
174
|
-
files_bottom.addWidget(nodes['
|
|
172
|
+
files_bottom.addWidget(nodes['remote_store.openai.btn.upload.files'])
|
|
173
|
+
files_bottom.addWidget(nodes['remote_store.openai.btn.upload.dir'])
|
|
174
|
+
files_bottom.addWidget(nodes['remote_store.openai.btn.refresh_status'])
|
|
175
175
|
|
|
176
176
|
files_panel.addWidget(nodes[files_list_id])
|
|
177
177
|
files_panel.setContentsMargins(0, 0, 0, 5)
|
|
@@ -180,22 +180,22 @@ class AssistantVectorStore:
|
|
|
180
180
|
files_widget.setLayout(files_panel)
|
|
181
181
|
# ========================================================================
|
|
182
182
|
|
|
183
|
-
splitters['dialog.
|
|
184
|
-
splitters['dialog.
|
|
183
|
+
splitters['dialog.remote_store.openai'] = QSplitter(Qt.Horizontal)
|
|
184
|
+
splitters['dialog.remote_store.openai'].addWidget(left_widget)
|
|
185
185
|
|
|
186
|
-
splitters['dialog.
|
|
187
|
-
splitters['dialog.
|
|
188
|
-
splitters['dialog.
|
|
189
|
-
splitters['dialog.
|
|
190
|
-
splitters['dialog.
|
|
186
|
+
splitters['dialog.remote_store.openai.right'] = QSplitter(Qt.Horizontal)
|
|
187
|
+
splitters['dialog.remote_store.openai.right'].addWidget(files_widget)
|
|
188
|
+
splitters['dialog.remote_store.openai.right'].addWidget(area_widget)
|
|
189
|
+
splitters['dialog.remote_store.openai.right'].setStretchFactor(1, 7)
|
|
190
|
+
splitters['dialog.remote_store.openai.right'].setStretchFactor(0, 3)
|
|
191
191
|
|
|
192
|
-
splitters['dialog.
|
|
193
|
-
splitters['dialog.
|
|
194
|
-
splitters['dialog.
|
|
195
|
-
splitters['dialog.
|
|
192
|
+
splitters['dialog.remote_store.openai'].addWidget(splitters['dialog.remote_store.openai.right'])
|
|
193
|
+
splitters['dialog.remote_store.openai'].setStretchFactor(0, 2)
|
|
194
|
+
splitters['dialog.remote_store.openai'].setStretchFactor(1, 8)
|
|
195
|
+
splitters['dialog.remote_store.openai'].setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
|
196
196
|
|
|
197
197
|
main_layout = QHBoxLayout()
|
|
198
|
-
main_layout.addWidget(splitters['dialog.
|
|
198
|
+
main_layout.addWidget(splitters['dialog.remote_store.openai'])
|
|
199
199
|
main_layout.setContentsMargins(0, 0, 0, 0)
|
|
200
200
|
|
|
201
201
|
layout = QVBoxLayout()
|
|
@@ -204,21 +204,21 @@ class AssistantVectorStore:
|
|
|
204
204
|
|
|
205
205
|
layout.setMenuBar(self.setup_menu())
|
|
206
206
|
|
|
207
|
-
ui.dialog[self.dialog_id] =
|
|
207
|
+
ui.dialog[self.dialog_id] = RemoteStoreOpenAIDialog(self.window, self.dialog_id)
|
|
208
208
|
ui.dialog[self.dialog_id].setLayout(layout)
|
|
209
|
-
ui.dialog[self.dialog_id].setWindowTitle(trans('dialog.
|
|
209
|
+
ui.dialog[self.dialog_id].setWindowTitle(trans('dialog.remote_store.openai'))
|
|
210
210
|
|
|
211
211
|
if idx is not None:
|
|
212
212
|
try:
|
|
213
|
-
controller.
|
|
213
|
+
controller.remote_store.openai.set_by_tab(idx)
|
|
214
214
|
except Exception as e:
|
|
215
215
|
print('Failed restore store editor tab: {}'.format(idx))
|
|
216
216
|
else:
|
|
217
|
-
if controller.
|
|
218
|
-
controller.
|
|
217
|
+
if controller.remote_store.openai.current is None:
|
|
218
|
+
controller.remote_store.openai.set_by_tab(0)
|
|
219
219
|
|
|
220
220
|
try:
|
|
221
|
-
controller.
|
|
221
|
+
controller.remote_store.openai.update_files_list()
|
|
222
222
|
except Exception:
|
|
223
223
|
pass
|
|
224
224
|
|
|
@@ -232,99 +232,99 @@ class AssistantVectorStore:
|
|
|
232
232
|
self.menu_bar = QMenuBar()
|
|
233
233
|
|
|
234
234
|
self.menu = {}
|
|
235
|
-
self.menu["current"] = self.menu_bar.addMenu(trans("dialog.
|
|
236
|
-
self.menu["all"] = self.menu_bar.addMenu(trans("dialog.
|
|
235
|
+
self.menu["current"] = self.menu_bar.addMenu(trans("dialog.remote_store.menu.current"))
|
|
236
|
+
self.menu["all"] = self.menu_bar.addMenu(trans("dialog.remote_store.menu.all"))
|
|
237
237
|
|
|
238
238
|
self.actions["current.import_files"] = QAction(QIcon(":/icons/download.svg"),
|
|
239
|
-
trans("dialog.
|
|
239
|
+
trans("dialog.remote_store.menu.current.import_files"),
|
|
240
240
|
self.menu_bar)
|
|
241
241
|
self.actions["current.import_files"].triggered.connect(
|
|
242
|
-
lambda: self.window.controller.
|
|
243
|
-
self.window.controller.
|
|
242
|
+
lambda: self.window.controller.remote_store.openai.batch.import_store_files(
|
|
243
|
+
self.window.controller.remote_store.openai.current
|
|
244
244
|
)
|
|
245
245
|
)
|
|
246
246
|
|
|
247
247
|
self.actions["current.refresh_store"] = QAction(QIcon(":/icons/reload.svg"),
|
|
248
|
-
trans("dialog.
|
|
248
|
+
trans("dialog.remote_store.menu.current.refresh_store"),
|
|
249
249
|
self.menu_bar)
|
|
250
250
|
self.actions["current.refresh_store"].triggered.connect(
|
|
251
|
-
self.window.controller.
|
|
251
|
+
self.window.controller.remote_store.openai.refresh_status
|
|
252
252
|
)
|
|
253
253
|
|
|
254
254
|
self.actions["current.clear_files"] = QAction(QIcon(":/icons/close.svg"),
|
|
255
|
-
trans("dialog.
|
|
255
|
+
trans("dialog.remote_store.menu.current.clear_files"),
|
|
256
256
|
self.menu_bar)
|
|
257
257
|
self.actions["current.clear_files"].triggered.connect(
|
|
258
|
-
lambda: self.window.controller.
|
|
259
|
-
self.window.controller.
|
|
258
|
+
lambda: self.window.controller.remote_store.openai.batch.clear_store_files(
|
|
259
|
+
self.window.controller.remote_store.openai.current
|
|
260
260
|
)
|
|
261
261
|
)
|
|
262
262
|
|
|
263
263
|
self.actions["current.truncate_files"] = QAction(QIcon(":/icons/delete.svg"),
|
|
264
|
-
trans("dialog.
|
|
264
|
+
trans("dialog.remote_store.menu.current.truncate_files"),
|
|
265
265
|
self.menu_bar)
|
|
266
266
|
self.actions["current.truncate_files"].triggered.connect(
|
|
267
|
-
lambda: self.window.controller.
|
|
268
|
-
self.window.controller.
|
|
267
|
+
lambda: self.window.controller.remote_store.openai.batch.truncate_store_files(
|
|
268
|
+
self.window.controller.remote_store.openai.current
|
|
269
269
|
)
|
|
270
270
|
)
|
|
271
271
|
|
|
272
272
|
self.actions["current.delete"] = QAction(QIcon(":/icons/delete.svg"),
|
|
273
|
-
trans("dialog.
|
|
273
|
+
trans("dialog.remote_store.menu.current.delete"),
|
|
274
274
|
self.menu_bar)
|
|
275
275
|
self.actions["current.delete"].triggered.connect(
|
|
276
|
-
lambda: self.window.controller.
|
|
277
|
-
self.window.controller.
|
|
276
|
+
lambda: self.window.controller.remote_store.openai.delete(
|
|
277
|
+
self.window.controller.remote_store.openai.current
|
|
278
278
|
)
|
|
279
279
|
)
|
|
280
280
|
|
|
281
281
|
self.actions["all.import_all"] = QAction(QIcon(":/icons/download.svg"),
|
|
282
|
-
trans("dialog.
|
|
282
|
+
trans("dialog.remote_store.menu.all.import_all"),
|
|
283
283
|
self.menu_bar)
|
|
284
284
|
self.actions["all.import_all"].triggered.connect(
|
|
285
|
-
self.window.controller.
|
|
285
|
+
self.window.controller.remote_store.openai.batch.import_stores
|
|
286
286
|
)
|
|
287
287
|
|
|
288
288
|
self.actions["all.import_files"] = QAction(QIcon(":/icons/download.svg"),
|
|
289
|
-
trans("dialog.
|
|
289
|
+
trans("dialog.remote_store.menu.all.import_files"),
|
|
290
290
|
self.menu_bar)
|
|
291
291
|
self.actions["all.import_files"].triggered.connect(
|
|
292
|
-
self.window.controller.
|
|
292
|
+
self.window.controller.remote_store.openai.batch.import_files
|
|
293
293
|
)
|
|
294
294
|
|
|
295
295
|
self.actions["all.refresh_stores"] = QAction(QIcon(":/icons/reload.svg"),
|
|
296
|
-
trans("dialog.
|
|
296
|
+
trans("dialog.remote_store.menu.all.refresh_store"),
|
|
297
297
|
self.menu_bar)
|
|
298
298
|
self.actions["all.refresh_stores"].triggered.connect(
|
|
299
|
-
self.window.controller.
|
|
299
|
+
self.window.controller.remote_store.openai.batch.refresh_stores
|
|
300
300
|
)
|
|
301
301
|
|
|
302
302
|
self.actions["all.clear_stores"] = QAction(QIcon(":/icons/close.svg"),
|
|
303
|
-
trans("dialog.
|
|
303
|
+
trans("dialog.remote_store.menu.all.clear_store"),
|
|
304
304
|
self.menu_bar)
|
|
305
305
|
self.actions["all.clear_stores"].triggered.connect(
|
|
306
|
-
self.window.controller.
|
|
306
|
+
self.window.controller.remote_store.openai.batch.clear_stores
|
|
307
307
|
)
|
|
308
308
|
|
|
309
309
|
self.actions["all.clear_files"] = QAction(QIcon(":/icons/close.svg"),
|
|
310
|
-
trans("dialog.
|
|
310
|
+
trans("dialog.remote_store.menu.all.clear_files"),
|
|
311
311
|
self.menu_bar)
|
|
312
312
|
self.actions["all.clear_files"].triggered.connect(
|
|
313
|
-
self.window.controller.
|
|
313
|
+
self.window.controller.remote_store.openai.batch.clear_files
|
|
314
314
|
)
|
|
315
315
|
|
|
316
316
|
self.actions["all.truncate_stores"] = QAction(QIcon(":/icons/delete.svg"),
|
|
317
|
-
trans("dialog.
|
|
317
|
+
trans("dialog.remote_store.menu.all.truncate_store"),
|
|
318
318
|
self.menu_bar)
|
|
319
319
|
self.actions["all.truncate_stores"].triggered.connect(
|
|
320
|
-
self.window.controller.
|
|
320
|
+
self.window.controller.remote_store.openai.batch.truncate_stores
|
|
321
321
|
)
|
|
322
322
|
|
|
323
323
|
self.actions["all.truncate_files"] = QAction(QIcon(":/icons/delete.svg"),
|
|
324
|
-
trans("dialog.
|
|
324
|
+
trans("dialog.remote_store.menu.all.truncate_files"),
|
|
325
325
|
self.menu_bar)
|
|
326
326
|
self.actions["all.truncate_files"].triggered.connect(
|
|
327
|
-
self.window.controller.
|
|
327
|
+
self.window.controller.remote_store.openai.batch.truncate_files
|
|
328
328
|
)
|
|
329
329
|
|
|
330
330
|
self.menu["current"].addAction(self.actions["current.import_files"])
|
|
@@ -494,8 +494,8 @@ class AssistantVectorStore:
|
|
|
494
494
|
if id not in models:
|
|
495
495
|
return
|
|
496
496
|
model = models[id]
|
|
497
|
-
hide_threads = bool(self.window.core.config.get("
|
|
498
|
-
suffix = trans("
|
|
497
|
+
hide_threads = bool(self.window.core.config.get("remote_store.openai.hide_threads"))
|
|
498
|
+
suffix = trans("remote_store.files.suffix")
|
|
499
499
|
|
|
500
500
|
names = []
|
|
501
501
|
for n, store in data.items():
|
|
@@ -523,7 +523,7 @@ class AssistantVectorStore:
|
|
|
523
523
|
"""
|
|
524
524
|
Context menu for the files list: provides Delete action.
|
|
525
525
|
"""
|
|
526
|
-
view_id = '
|
|
526
|
+
view_id = 'remote_store.openai.files.list'
|
|
527
527
|
if view_id not in self.window.ui.nodes:
|
|
528
528
|
return
|
|
529
529
|
view = self.window.ui.nodes[view_id]
|
|
@@ -533,7 +533,7 @@ class AssistantVectorStore:
|
|
|
533
533
|
|
|
534
534
|
row = index.row()
|
|
535
535
|
menu = QMenu(view)
|
|
536
|
-
act_delete = QAction(QIcon(":/icons/delete.svg"), trans("
|
|
537
|
-
act_delete.triggered.connect(lambda r=row: self.window.controller.
|
|
536
|
+
act_delete = QAction(QIcon(":/icons/delete.svg"), trans("remote_store.menu.file.delete") if hasattr(self.window, 'tr') else "Delete", view)
|
|
537
|
+
act_delete.triggered.connect(lambda r=row: self.window.controller.remote_store.openai.delete_file_by_idx(r))
|
|
538
538
|
menu.addAction(act_delete)
|
|
539
539
|
menu.exec(view.mapToGlobal(pos))
|
pygpt_net/ui/dialogs.py
CHANGED
|
@@ -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: 2026.01.02 19:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import threading
|
|
@@ -16,7 +16,8 @@ from PySide6.QtCore import Qt
|
|
|
16
16
|
from pygpt_net.ui.dialog.about import About
|
|
17
17
|
from pygpt_net.ui.dialog.applog import AppLog
|
|
18
18
|
from pygpt_net.ui.dialog.assistant import Assistant
|
|
19
|
-
from pygpt_net.ui.dialog.
|
|
19
|
+
from pygpt_net.ui.dialog.remote_store_openai import RemoteStoreOpenAI
|
|
20
|
+
from pygpt_net.ui.dialog.remote_store_google import RemoteStoreGoogle
|
|
20
21
|
from pygpt_net.ui.dialog.changelog import Changelog
|
|
21
22
|
from pygpt_net.ui.dialog.create import Create
|
|
22
23
|
from pygpt_net.ui.dialog.db import Database
|
|
@@ -105,7 +106,8 @@ class Dialogs:
|
|
|
105
106
|
self.window.plugin_presets = PresetPlugins(self.window)
|
|
106
107
|
self.window.model_settings = Models(self.window)
|
|
107
108
|
self.window.model_importer = ModelsImporter(self.window)
|
|
108
|
-
self.window.
|
|
109
|
+
self.window.remote_store_google = RemoteStoreGoogle(self.window)
|
|
110
|
+
self.window.remote_store_openai = RemoteStoreOpenAI(self.window)
|
|
109
111
|
|
|
110
112
|
self.window.ui.dialog['alert'] = AlertDialog(self.window)
|
|
111
113
|
self.window.ui.dialog['confirm'] = ConfirmDialog(self.window)
|
|
@@ -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: 2026.01.02 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import os
|
|
@@ -96,8 +96,8 @@ class AttachmentsUploaded:
|
|
|
96
96
|
:param data: Data to update
|
|
97
97
|
"""
|
|
98
98
|
model = self.window.ui.models[self.id]
|
|
99
|
-
store_names = self.window.core.
|
|
100
|
-
thread_only_label = trans("
|
|
99
|
+
store_names = self.window.core.remote_store.openai.get_names()
|
|
100
|
+
thread_only_label = trans("remote_store.thread_only")
|
|
101
101
|
fs = self.window.core.filesystem
|
|
102
102
|
|
|
103
103
|
model.beginResetModel()
|
|
@@ -6,12 +6,13 @@
|
|
|
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: 2026.01.02 02:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
|
-
from PySide6.QtWidgets import QHBoxLayout, QWidget, QComboBox
|
|
12
|
+
from PySide6.QtWidgets import QHBoxLayout, QWidget, QComboBox, QVBoxLayout
|
|
13
13
|
|
|
14
14
|
from pygpt_net.ui.widget.element.labels import TitleLabel
|
|
15
|
+
from pygpt_net.ui.widget.option.toggle_label import ToggleLabel
|
|
15
16
|
from pygpt_net.utils import trans
|
|
16
17
|
|
|
17
18
|
|
|
@@ -46,13 +47,20 @@ class ComputerEnv:
|
|
|
46
47
|
data = cbox.itemData(index)
|
|
47
48
|
self.window.controller.ui.on_computer_env_changed(data)
|
|
48
49
|
|
|
49
|
-
def
|
|
50
|
+
def on_sandbox_toggled(self, checked: bool) -> None:
|
|
51
|
+
"""
|
|
52
|
+
Handle sandbox toggle
|
|
53
|
+
|
|
54
|
+
:param checked: bool
|
|
55
|
+
"""
|
|
56
|
+
self.window.controller.ui.on_computer_sandbox_toggled(checked)
|
|
57
|
+
|
|
58
|
+
def setup_env(self) -> QVBoxLayout:
|
|
50
59
|
"""
|
|
51
60
|
Setup list of environments
|
|
52
61
|
|
|
53
62
|
:return: QVBoxLayout
|
|
54
63
|
"""
|
|
55
|
-
|
|
56
64
|
nodes = self.window.ui.nodes
|
|
57
65
|
label = TitleLabel(trans("toolbox.env.label"))
|
|
58
66
|
nodes['env.label'] = label
|
|
@@ -68,10 +76,20 @@ class ComputerEnv:
|
|
|
68
76
|
cbox.setMinimumWidth(40)
|
|
69
77
|
|
|
70
78
|
cbox.currentIndexChanged.connect(self._on_env_index_changed)
|
|
71
|
-
nodes[
|
|
79
|
+
nodes['computer_env'] = cbox
|
|
80
|
+
|
|
81
|
+
# sandbox
|
|
82
|
+
sandbox = ToggleLabel(trans("computer_use.sandbox"), parent=self.window)
|
|
83
|
+
sandbox.box.setToolTip(trans("computer_use.sandbox.tooltip"))
|
|
84
|
+
sandbox.box.toggled.connect(self.on_sandbox_toggled)
|
|
85
|
+
nodes['computer_sandbox'] = sandbox
|
|
86
|
+
|
|
87
|
+
env_layout = QHBoxLayout()
|
|
88
|
+
env_layout.addWidget(label, 0)
|
|
89
|
+
env_layout.addWidget(cbox, 1)
|
|
72
90
|
|
|
73
|
-
layout =
|
|
74
|
-
layout.
|
|
75
|
-
layout.addWidget(
|
|
91
|
+
layout = QVBoxLayout()
|
|
92
|
+
layout.addLayout(env_layout)
|
|
93
|
+
layout.addWidget(sandbox, 0)
|
|
76
94
|
layout.setContentsMargins(2, 5, 5, 5)
|
|
77
95
|
return layout
|
pygpt_net/ui/menu/tools.py
CHANGED
|
@@ -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: 2026.01.02 19:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import QAction, QIcon
|
|
@@ -26,8 +26,11 @@ class Tools:
|
|
|
26
26
|
action = self.window.sender()
|
|
27
27
|
self.window.controller.tools.open_tab(action.data())
|
|
28
28
|
|
|
29
|
-
def
|
|
30
|
-
self.window.controller.
|
|
29
|
+
def _toggle_remote_store_openai(self, checked=False):
|
|
30
|
+
self.window.controller.remote_store.openai.toggle_editor()
|
|
31
|
+
|
|
32
|
+
def _toggle_remote_store_google(self, checked=False):
|
|
33
|
+
self.window.controller.remote_store.google.toggle_editor()
|
|
31
34
|
|
|
32
35
|
def _rebuild_ipython(self, checked=False):
|
|
33
36
|
self.window.core.plugins.get("cmd_code_interpreter").builder.build_and_restart()
|
|
@@ -69,9 +72,14 @@ class Tools:
|
|
|
69
72
|
|
|
70
73
|
menu_tools.addSeparator()
|
|
71
74
|
db_icon = QIcon(":/icons/db.svg")
|
|
72
|
-
ui_menu['menu.tools.openai.stores'] = QAction(db_icon, trans("dialog.
|
|
75
|
+
ui_menu['menu.tools.openai.stores'] = QAction(db_icon, trans("dialog.remote_store.openai"), window)
|
|
73
76
|
menu_tools.addAction(ui_menu['menu.tools.openai.stores'])
|
|
74
|
-
ui_menu['menu.tools.openai.stores'].triggered.connect(self.
|
|
77
|
+
ui_menu['menu.tools.openai.stores'].triggered.connect(self._toggle_remote_store_openai)
|
|
78
|
+
|
|
79
|
+
ui_menu['menu.tools.google.stores'] = QAction(db_icon, trans("dialog.remote_store.google"), window)
|
|
80
|
+
menu_tools.addAction(ui_menu['menu.tools.google.stores'])
|
|
81
|
+
ui_menu['menu.tools.google.stores'].triggered.connect(self._toggle_remote_store_google)
|
|
82
|
+
# ------------------------------------------------- #
|
|
75
83
|
|
|
76
84
|
menu_tools.addSeparator()
|
|
77
85
|
reload_icon = QIcon(":/icons/reload.svg")
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# ================================================== #
|
|
4
|
+
# This file is a part of PYGPT package #
|
|
5
|
+
# Website: https://pygpt.net #
|
|
6
|
+
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
|
+
# MIT License #
|
|
8
|
+
# Created By : Marcin Szczygliński #
|
|
9
|
+
# Updated Date: 2026.01.02 20:00:00 #
|
|
10
|
+
# ================================================== #
|
|
11
|
+
|
|
12
|
+
from PySide6.QtCore import Qt
|
|
13
|
+
|
|
14
|
+
from .base import BaseDialog
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RemoteStoreGoogleDialog(BaseDialog):
|
|
18
|
+
def __init__(self, window=None, id=None):
|
|
19
|
+
"""
|
|
20
|
+
Models dialog (Google File Search)
|
|
21
|
+
|
|
22
|
+
:param window: main window
|
|
23
|
+
:param id: settings id
|
|
24
|
+
"""
|
|
25
|
+
super(RemoteStoreGoogleDialog, self).__init__(window, id)
|
|
26
|
+
self.window = window
|
|
27
|
+
self.id = id
|
|
28
|
+
|
|
29
|
+
def closeEvent(self, event):
|
|
30
|
+
"""
|
|
31
|
+
Close event
|
|
32
|
+
|
|
33
|
+
:param event: close event
|
|
34
|
+
"""
|
|
35
|
+
self.window.controller.remote_store.google.dialog = False
|
|
36
|
+
self.window.controller.remote_store.google.update()
|
|
37
|
+
super(RemoteStoreGoogleDialog, self).closeEvent(event)
|
|
38
|
+
|
|
39
|
+
def keyPressEvent(self, event):
|
|
40
|
+
"""
|
|
41
|
+
Key press event
|
|
42
|
+
|
|
43
|
+
:param event: key press event
|
|
44
|
+
"""
|
|
45
|
+
if event.key() == Qt.Key_Escape:
|
|
46
|
+
self.cleanup()
|
|
47
|
+
self.close()
|
|
48
|
+
else:
|
|
49
|
+
super(RemoteStoreGoogleDialog, self).keyPressEvent(event)
|
|
50
|
+
|
|
51
|
+
def cleanup(self):
|
|
52
|
+
"""
|
|
53
|
+
Cleanup on close
|
|
54
|
+
"""
|
|
55
|
+
self.window.controller.remote_store.google.dialog = False
|
|
56
|
+
self.window.controller.remote_store.google.update()
|