pygpt-net 2.6.65__py3-none-any.whl → 2.6.67__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 +17 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +2 -0
- pygpt_net/controller/chat/chat.py +0 -0
- pygpt_net/controller/chat/handler/openai_stream.py +137 -7
- pygpt_net/controller/chat/render.py +0 -0
- pygpt_net/controller/config/field/checkbox_list.py +34 -1
- pygpt_net/controller/config/field/textarea.py +2 -2
- pygpt_net/controller/dialogs/info.py +2 -2
- pygpt_net/controller/media/media.py +48 -1
- pygpt_net/controller/model/editor.py +74 -9
- pygpt_net/controller/presets/presets.py +4 -1
- pygpt_net/controller/settings/editor.py +25 -1
- pygpt_net/controller/ui/mode.py +14 -10
- pygpt_net/controller/ui/ui.py +18 -1
- pygpt_net/core/image/image.py +34 -1
- pygpt_net/core/tabs/tabs.py +0 -0
- pygpt_net/core/types/image.py +70 -3
- pygpt_net/core/video/video.py +43 -3
- pygpt_net/data/config/config.json +4 -3
- pygpt_net/data/config/models.json +637 -38
- pygpt_net/data/locale/locale.de.ini +5 -0
- pygpt_net/data/locale/locale.en.ini +5 -0
- pygpt_net/data/locale/locale.es.ini +5 -0
- pygpt_net/data/locale/locale.fr.ini +5 -0
- pygpt_net/data/locale/locale.it.ini +5 -0
- pygpt_net/data/locale/locale.pl.ini +5 -0
- pygpt_net/data/locale/locale.uk.ini +5 -0
- pygpt_net/data/locale/locale.zh.ini +5 -0
- pygpt_net/item/model.py +15 -19
- pygpt_net/provider/agents/openai/agent.py +0 -0
- pygpt_net/provider/api/google/__init__.py +20 -9
- pygpt_net/provider/api/google/image.py +161 -28
- pygpt_net/provider/api/google/video.py +73 -36
- pygpt_net/provider/api/openai/__init__.py +21 -11
- pygpt_net/provider/api/openai/agents/client.py +0 -0
- pygpt_net/provider/api/openai/video.py +562 -0
- pygpt_net/provider/core/config/patch.py +7 -0
- pygpt_net/provider/core/model/patch.py +54 -3
- pygpt_net/provider/vector_stores/qdrant.py +117 -0
- pygpt_net/ui/dialog/models.py +10 -1
- pygpt_net/ui/layout/toolbox/raw.py +7 -1
- pygpt_net/ui/layout/toolbox/video.py +14 -6
- pygpt_net/ui/widget/option/checkbox_list.py +14 -2
- pygpt_net/ui/widget/option/input.py +3 -1
- {pygpt_net-2.6.65.dist-info → pygpt_net-2.6.67.dist-info}/METADATA +72 -25
- {pygpt_net-2.6.65.dist-info → pygpt_net-2.6.67.dist-info}/RECORD +45 -43
- {pygpt_net-2.6.65.dist-info → pygpt_net-2.6.67.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.65.dist-info → pygpt_net-2.6.67.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.65.dist-info → pygpt_net-2.6.67.dist-info}/entry_points.txt +0 -0
pygpt_net/controller/ui/mode.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: 2025.
|
|
9
|
+
# Updated Date: 2025.12.25 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from pygpt_net.core.types import (
|
|
@@ -39,7 +39,8 @@ class Mode:
|
|
|
39
39
|
def update(self):
|
|
40
40
|
"""Update mode, model, preset and rest of the toolbox"""
|
|
41
41
|
|
|
42
|
-
mode = self.window.core.config.
|
|
42
|
+
mode = self.window.core.config.get("mode")
|
|
43
|
+
model = self.window.core.config.get("model")
|
|
43
44
|
|
|
44
45
|
ui_nodes = self.window.ui.nodes
|
|
45
46
|
ui_tabs = self.window.ui.tabs
|
|
@@ -53,7 +54,7 @@ class Mode:
|
|
|
53
54
|
is_agent_llama = mode == MODE_AGENT_LLAMA
|
|
54
55
|
is_agent_openai = mode == MODE_AGENT_OPENAI
|
|
55
56
|
is_expert = mode == MODE_EXPERT
|
|
56
|
-
|
|
57
|
+
is_media = mode == MODE_IMAGE
|
|
57
58
|
is_llama_index = mode == MODE_LLAMA_INDEX
|
|
58
59
|
is_completion = mode == MODE_COMPLETION
|
|
59
60
|
is_audio = mode == MODE_AUDIO
|
|
@@ -161,15 +162,18 @@ class Mode:
|
|
|
161
162
|
ui_nodes['preset.editor.modes'].setVisible(True)
|
|
162
163
|
ui_tabs['preset.editor.extra'].setTabText(0, trans("preset.prompt"))
|
|
163
164
|
|
|
164
|
-
#
|
|
165
|
-
if
|
|
165
|
+
# media options visibility
|
|
166
|
+
if is_media:
|
|
166
167
|
ui_nodes['media.raw'].setVisible(True)
|
|
167
|
-
if ctrl.media.is_video_model():
|
|
168
|
+
if ctrl.media.is_video_model() and ctrl.media.get_mode() == "video":
|
|
168
169
|
ui_nodes['video.options'].setVisible(True)
|
|
169
170
|
ui_nodes['dalle.options'].setVisible(False)
|
|
170
|
-
elif ctrl.media.is_image_model():
|
|
171
|
+
elif ctrl.media.is_image_model() and ctrl.media.get_mode() == "image":
|
|
171
172
|
ui_nodes['dalle.options'].setVisible(True)
|
|
172
173
|
ui_nodes['video.options'].setVisible(False)
|
|
174
|
+
elif ctrl.media.get_mode() == "music":
|
|
175
|
+
ui_nodes['dalle.options'].setVisible(False)
|
|
176
|
+
ui_nodes['video.options'].setVisible(False)
|
|
173
177
|
else:
|
|
174
178
|
ui_nodes['media.raw'].setVisible(False)
|
|
175
179
|
ui_nodes['dalle.options'].setVisible(False)
|
|
@@ -199,7 +203,7 @@ class Mode:
|
|
|
199
203
|
else:
|
|
200
204
|
ui_nodes['idx.options'].setVisible(False)
|
|
201
205
|
|
|
202
|
-
if
|
|
206
|
+
if is_media:
|
|
203
207
|
ui_nodes['input.stream'].setVisible(False)
|
|
204
208
|
else:
|
|
205
209
|
ui_nodes['input.stream'].setVisible(True)
|
|
@@ -213,13 +217,13 @@ class Mode:
|
|
|
213
217
|
ui_tabs['input'].setTabVisible(1, show)
|
|
214
218
|
|
|
215
219
|
# remote tools icon visibility
|
|
216
|
-
if not
|
|
220
|
+
if not is_media and not is_completion:
|
|
217
221
|
self.window.ui.nodes['input'].set_icon_visible("web", True)
|
|
218
222
|
else:
|
|
219
223
|
self.window.ui.nodes['input'].set_icon_visible("web", False)
|
|
220
224
|
|
|
221
225
|
ui_tabs['input'].setTabVisible(2, is_assistant)
|
|
222
|
-
ui_tabs['input'].setTabVisible(3, (not is_assistant) and (not
|
|
226
|
+
ui_tabs['input'].setTabVisible(3, (not is_assistant) and (not is_media))
|
|
223
227
|
|
|
224
228
|
presets_editor.toggle_extra_options()
|
|
225
229
|
|
pygpt_net/controller/ui/ui.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: 2025.
|
|
9
|
+
# Updated Date: 2025.12.25 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from typing import Optional
|
|
@@ -68,6 +68,7 @@ class UI:
|
|
|
68
68
|
self.update_tokens()
|
|
69
69
|
self.vision.update()
|
|
70
70
|
self.window.controller.agent.legacy.update()
|
|
71
|
+
self.img_update_available_modes()
|
|
71
72
|
self.img_update_available_resolutions()
|
|
72
73
|
|
|
73
74
|
def handle(self, event: BaseEvent):
|
|
@@ -258,4 +259,20 @@ class UI:
|
|
|
258
259
|
key="img_resolution",
|
|
259
260
|
option=self.window.core.image.get_resolution_option(),
|
|
260
261
|
value=current,
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
def img_update_available_modes(self):
|
|
265
|
+
"""Update available modes for images"""
|
|
266
|
+
mode = self.window.core.config.get('mode')
|
|
267
|
+
if mode != MODE_IMAGE:
|
|
268
|
+
return
|
|
269
|
+
model = self.window.core.config.get('model')
|
|
270
|
+
keys = self.window.core.image.get_available_modes(model)
|
|
271
|
+
current = self.window.core.config.get('img_mode', 'image')
|
|
272
|
+
self.window.ui.config['global']['img_mode'].set_keys(keys, lock=False)
|
|
273
|
+
self.window.controller.config.apply_value(
|
|
274
|
+
parent_id="global",
|
|
275
|
+
key="img_mode",
|
|
276
|
+
option=self.window.core.image.get_mode_option(),
|
|
277
|
+
value=current,
|
|
261
278
|
)
|
pygpt_net/core/image/image.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: 2025.
|
|
9
|
+
# Updated Date: 2025.12.25 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import uuid
|
|
@@ -158,6 +158,39 @@ class Image(QObject):
|
|
|
158
158
|
"keys": self.get_available_resolutions(),
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
def get_mode_option(self) -> dict:
|
|
162
|
+
"""
|
|
163
|
+
Get image mode option for UI
|
|
164
|
+
|
|
165
|
+
:return: dict
|
|
166
|
+
"""
|
|
167
|
+
return {
|
|
168
|
+
"type": "combo",
|
|
169
|
+
"slider": True,
|
|
170
|
+
"label": "img_mode",
|
|
171
|
+
"value": "image",
|
|
172
|
+
"keys": self.get_available_modes(),
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
def get_available_modes(self, model_name: str = None) -> Dict[str, str]:
|
|
176
|
+
"""
|
|
177
|
+
Get available modes (image / video)
|
|
178
|
+
|
|
179
|
+
:param model_name: model name
|
|
180
|
+
:return: dict of available modes
|
|
181
|
+
"""
|
|
182
|
+
options = {}
|
|
183
|
+
if model_name:
|
|
184
|
+
model = self.window.core.models.get(model_name)
|
|
185
|
+
if model:
|
|
186
|
+
if model.is_image_output():
|
|
187
|
+
options["image"] = trans("mode.img.image")
|
|
188
|
+
if model.is_video_output():
|
|
189
|
+
options["video"] = trans("mode.img.video")
|
|
190
|
+
if model.is_music_output():
|
|
191
|
+
options["music"] = trans("mode.img.music")
|
|
192
|
+
return options
|
|
193
|
+
|
|
161
194
|
def get_available_resolutions(self, model: str = None) -> Dict[str, str]:
|
|
162
195
|
"""
|
|
163
196
|
Get available image resolutions
|
pygpt_net/core/tabs/tabs.py
CHANGED
|
File without changes
|
pygpt_net/core/types/image.py
CHANGED
|
@@ -6,12 +6,29 @@
|
|
|
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.12.26 12:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
VIDEO_AVAILABLE_ASPECT_RATIOS = {
|
|
13
|
-
"
|
|
13
|
+
"1:1": "1:1",
|
|
14
|
+
"2:3": "2:3",
|
|
15
|
+
"3:2": "3:2",
|
|
16
|
+
"3:4": "3:4",
|
|
17
|
+
"4:3": "4:3",
|
|
18
|
+
"4:5": "4:5",
|
|
19
|
+
"5:4": "5:4",
|
|
14
20
|
"9:16": "9:16",
|
|
21
|
+
"16:9": "16:9",
|
|
22
|
+
"21:9": "21:9",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
VIDEO_AVAILABLE_RESOLUTIONS = {
|
|
26
|
+
"480p": "480p",
|
|
27
|
+
"720p": "720p",
|
|
28
|
+
"1080p": "1080p",
|
|
29
|
+
"1440p": "1440p",
|
|
30
|
+
"4K": "4K",
|
|
31
|
+
"8K": "8K",
|
|
15
32
|
}
|
|
16
33
|
|
|
17
34
|
|
|
@@ -50,5 +67,55 @@ IMAGE_AVAILABLE_RESOLUTIONS = {
|
|
|
50
67
|
"2560x1792": "2560x1792",
|
|
51
68
|
"1536x2816": "1536x2816",
|
|
52
69
|
"2816x1536": "2816x1536"
|
|
53
|
-
}
|
|
70
|
+
},
|
|
71
|
+
"nano-banana-pro": {
|
|
72
|
+
"2048x2048": "2048x2048",
|
|
73
|
+
"4096x4096": "4096x4096",
|
|
74
|
+
"1664x2496": "1664x2496",
|
|
75
|
+
"2496x1664": "2496x1664",
|
|
76
|
+
"3328x4992": "3328x4992",
|
|
77
|
+
"4992x3328": "4992x3328",
|
|
78
|
+
"1728x2368": "1728x2368",
|
|
79
|
+
"2368x1728": "2368x1728",
|
|
80
|
+
"3456x4736": "3456x4736",
|
|
81
|
+
"4736x3456": "4736x3456",
|
|
82
|
+
"1792x2304": "1792x2304",
|
|
83
|
+
"2304x1792": "2304x1792",
|
|
84
|
+
"3584x4608": "3584x4608",
|
|
85
|
+
"4608x3584": "4608x3584",
|
|
86
|
+
"1536x2688": "1536x2688",
|
|
87
|
+
"2688x1536": "2688x1536",
|
|
88
|
+
"3072x5376": "3072x5376",
|
|
89
|
+
"5376x3072": "5376x3072",
|
|
90
|
+
"3072x1344": "3072x1344",
|
|
91
|
+
"6144x2688": "6144x2688"
|
|
92
|
+
},
|
|
93
|
+
"nano-banana": {
|
|
94
|
+
"1024x1024": "1024x1024",
|
|
95
|
+
"832x1248": "832x1248",
|
|
96
|
+
"1248x832": "1248x832",
|
|
97
|
+
"864x1184": "864x1184",
|
|
98
|
+
"1184x864": "1184x864",
|
|
99
|
+
"896x1152": "896x1152",
|
|
100
|
+
"1152x896": "1152x896",
|
|
101
|
+
"768x1344": "768x1344",
|
|
102
|
+
"1344x768": "1344x768",
|
|
103
|
+
"1536x672": "1536x672"
|
|
104
|
+
},
|
|
105
|
+
"sora-2-pro": {
|
|
106
|
+
"1280x720": "1280x720",
|
|
107
|
+
"720x1280": "720x1280",
|
|
108
|
+
"1792x1024": "1792x1024",
|
|
109
|
+
"1024x1792": "1024x1792"
|
|
110
|
+
},
|
|
111
|
+
"sora-2": {
|
|
112
|
+
"1280x720": "1280x720",
|
|
113
|
+
"720x1280": "720x1280"
|
|
114
|
+
},
|
|
115
|
+
"veo-3": {
|
|
116
|
+
"1280x720": "1280x720",
|
|
117
|
+
"720x1280": "720x1280",
|
|
118
|
+
"1920x1080": "1920x1080",
|
|
119
|
+
"1080x1920": "1080x1920"
|
|
120
|
+
},
|
|
54
121
|
}
|
pygpt_net/core/video/video.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: 2025.
|
|
9
|
+
# Updated Date: 2025.12.26 12:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import uuid
|
|
@@ -18,7 +18,10 @@ from time import strftime
|
|
|
18
18
|
|
|
19
19
|
from PySide6.QtCore import Slot, QObject
|
|
20
20
|
|
|
21
|
-
from pygpt_net.core.types import
|
|
21
|
+
from pygpt_net.core.types import (
|
|
22
|
+
VIDEO_AVAILABLE_ASPECT_RATIOS,
|
|
23
|
+
VIDEO_AVAILABLE_RESOLUTIONS,
|
|
24
|
+
)
|
|
22
25
|
from pygpt_net.item.ctx import CtxItem
|
|
23
26
|
from pygpt_net.utils import trans
|
|
24
27
|
|
|
@@ -267,7 +270,7 @@ class Video(QObject):
|
|
|
267
270
|
|
|
268
271
|
def get_aspect_ratio_option(self) -> dict:
|
|
269
272
|
"""
|
|
270
|
-
Get
|
|
273
|
+
Get video aspect ratio option for UI
|
|
271
274
|
|
|
272
275
|
:return: dict
|
|
273
276
|
"""
|
|
@@ -279,6 +282,34 @@ class Video(QObject):
|
|
|
279
282
|
"keys": self.get_available_aspect_ratio(),
|
|
280
283
|
}
|
|
281
284
|
|
|
285
|
+
def get_resolution_option(self) -> dict:
|
|
286
|
+
"""
|
|
287
|
+
Get video resolution option for UI
|
|
288
|
+
|
|
289
|
+
:return: dict
|
|
290
|
+
"""
|
|
291
|
+
return {
|
|
292
|
+
"type": "combo",
|
|
293
|
+
"slider": True,
|
|
294
|
+
"label": "video.resolution",
|
|
295
|
+
"value": "720p",
|
|
296
|
+
"keys": self.get_available_resolutions(),
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
def get_duration_option(self) -> dict:
|
|
300
|
+
"""
|
|
301
|
+
Get video duration option for UI
|
|
302
|
+
|
|
303
|
+
:return: dict
|
|
304
|
+
"""
|
|
305
|
+
return {
|
|
306
|
+
"type": "int",
|
|
307
|
+
"slider": False,
|
|
308
|
+
"label": "video.duration",
|
|
309
|
+
"value": 8,
|
|
310
|
+
"placeholder": "s",
|
|
311
|
+
}
|
|
312
|
+
|
|
282
313
|
def get_available_aspect_ratio(self, model: str = None) -> Dict[str, str]:
|
|
283
314
|
"""
|
|
284
315
|
Get available image resolutions
|
|
@@ -288,3 +319,12 @@ class Video(QObject):
|
|
|
288
319
|
"""
|
|
289
320
|
return VIDEO_AVAILABLE_ASPECT_RATIOS
|
|
290
321
|
|
|
322
|
+
def get_available_resolutions(self, model: str = None) -> Dict[str, str]:
|
|
323
|
+
"""
|
|
324
|
+
Get available image resolutions
|
|
325
|
+
|
|
326
|
+
:param model: model name
|
|
327
|
+
:return: dict of available resolutions
|
|
328
|
+
"""
|
|
329
|
+
return VIDEO_AVAILABLE_RESOLUTIONS
|
|
330
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"__meta__": {
|
|
3
|
-
"version": "2.6.
|
|
4
|
-
"app.version": "2.6.
|
|
5
|
-
"updated_at": "2025-
|
|
3
|
+
"version": "2.6.67",
|
|
4
|
+
"app.version": "2.6.67",
|
|
5
|
+
"updated_at": "2025-12-26T00:00:00"
|
|
6
6
|
},
|
|
7
7
|
"access.audio.event.speech": false,
|
|
8
8
|
"access.audio.event.speech.disabled": [],
|
|
@@ -207,6 +207,7 @@
|
|
|
207
207
|
"font_size.toolbox": 12,
|
|
208
208
|
"frequency_penalty": 0.0,
|
|
209
209
|
"func_call.native": true,
|
|
210
|
+
"img_mode": "image",
|
|
210
211
|
"img_prompt_model": "gpt-4o",
|
|
211
212
|
"img_raw": true,
|
|
212
213
|
"img_resolution": "1024x1024",
|