pygpt-net 2.6.33__py3-none-any.whl → 2.6.36__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 +18 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/controller/assistant/batch.py +14 -4
- pygpt_net/controller/assistant/files.py +1 -0
- pygpt_net/controller/assistant/store.py +195 -1
- pygpt_net/controller/camera/camera.py +1 -1
- pygpt_net/controller/chat/common.py +58 -48
- pygpt_net/controller/chat/handler/stream_worker.py +55 -43
- pygpt_net/controller/config/placeholder.py +95 -75
- pygpt_net/controller/dialogs/confirm.py +3 -1
- pygpt_net/controller/media/media.py +11 -3
- pygpt_net/controller/painter/common.py +243 -13
- pygpt_net/controller/painter/painter.py +11 -2
- pygpt_net/core/assistants/files.py +18 -0
- pygpt_net/core/bridge/bridge.py +1 -5
- pygpt_net/core/bridge/context.py +81 -36
- pygpt_net/core/bridge/worker.py +3 -1
- pygpt_net/core/camera/camera.py +31 -402
- pygpt_net/core/camera/worker.py +430 -0
- pygpt_net/core/ctx/bag.py +4 -0
- pygpt_net/core/events/app.py +10 -17
- pygpt_net/core/events/base.py +17 -25
- pygpt_net/core/events/control.py +9 -17
- pygpt_net/core/events/event.py +9 -62
- pygpt_net/core/events/kernel.py +8 -17
- pygpt_net/core/events/realtime.py +8 -17
- pygpt_net/core/events/render.py +9 -17
- pygpt_net/core/filesystem/url.py +3 -0
- pygpt_net/core/render/web/body.py +483 -40
- pygpt_net/core/render/web/pid.py +39 -24
- pygpt_net/core/render/web/renderer.py +142 -36
- pygpt_net/core/text/utils.py +3 -0
- pygpt_net/data/config/config.json +4 -3
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/config/settings.json +10 -5
- pygpt_net/data/css/web-blocks.css +4 -3
- pygpt_net/data/css/web-chatgpt.css +4 -2
- pygpt_net/data/css/web-chatgpt_wide.css +4 -2
- pygpt_net/data/locale/locale.de.ini +9 -7
- pygpt_net/data/locale/locale.en.ini +10 -6
- pygpt_net/data/locale/locale.es.ini +9 -7
- pygpt_net/data/locale/locale.fr.ini +9 -7
- pygpt_net/data/locale/locale.it.ini +9 -7
- pygpt_net/data/locale/locale.pl.ini +9 -7
- pygpt_net/data/locale/locale.uk.ini +9 -7
- pygpt_net/data/locale/locale.zh.ini +9 -7
- pygpt_net/item/assistant.py +13 -1
- pygpt_net/provider/api/google/__init__.py +46 -28
- pygpt_net/provider/api/openai/__init__.py +13 -10
- pygpt_net/provider/api/openai/store.py +45 -1
- pygpt_net/provider/core/config/patch.py +18 -0
- pygpt_net/provider/llms/google.py +4 -0
- pygpt_net/ui/dialog/assistant_store.py +213 -203
- pygpt_net/ui/layout/chat/input.py +3 -3
- pygpt_net/ui/layout/chat/painter.py +63 -4
- pygpt_net/ui/widget/draw/painter.py +715 -104
- pygpt_net/ui/widget/option/combo.py +5 -1
- pygpt_net/ui/widget/textarea/input.py +273 -3
- pygpt_net/ui/widget/textarea/web.py +2 -0
- {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.36.dist-info}/METADATA +20 -2
- {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.36.dist-info}/RECORD +64 -63
- {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.36.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.36.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.36.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: 2025.
|
|
9
|
+
# Updated Date: 2025.09.02 15:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import QPixmap, QIcon
|
|
@@ -15,7 +15,6 @@ from PySide6.QtCore import QSize
|
|
|
15
15
|
|
|
16
16
|
from pygpt_net.ui.widget.draw.painter import PainterWidget
|
|
17
17
|
from pygpt_net.ui.widget.element.labels import HelpLabel
|
|
18
|
-
from pygpt_net.ui.widget.tabs.body import TabBody
|
|
19
18
|
from pygpt_net.utils import trans
|
|
20
19
|
|
|
21
20
|
|
|
@@ -90,6 +89,63 @@ class Painter:
|
|
|
90
89
|
cb.setSizeAdjustPolicy(QComboBox.AdjustToContents)
|
|
91
90
|
nodes[key] = cb
|
|
92
91
|
|
|
92
|
+
# Zoom combo (view-only scale) placed to the right of canvas size
|
|
93
|
+
key = 'painter.select.zoom'
|
|
94
|
+
if nodes.get(key) is None:
|
|
95
|
+
cb = QComboBox()
|
|
96
|
+
cb.setMinimumContentsLength(8)
|
|
97
|
+
cb.setSizeAdjustPolicy(QComboBox.AdjustToContents)
|
|
98
|
+
|
|
99
|
+
# Preferred preset steps from widget; fallback to defaults
|
|
100
|
+
steps = []
|
|
101
|
+
if hasattr(ui.painter, 'get_zoom_steps_percent'):
|
|
102
|
+
try:
|
|
103
|
+
steps = ui.painter.get_zoom_steps_percent()
|
|
104
|
+
except Exception:
|
|
105
|
+
steps = []
|
|
106
|
+
if not steps:
|
|
107
|
+
steps = [10, 25, 50, 75, 100, 150, 200, 500, 1000]
|
|
108
|
+
|
|
109
|
+
cb.addItems([f"{p}%" for p in steps])
|
|
110
|
+
|
|
111
|
+
# User -> widget
|
|
112
|
+
cb.currentTextChanged.connect(ui.painter.on_zoom_combo_changed)
|
|
113
|
+
|
|
114
|
+
# Widget -> combo (also covers CTRL+wheel and programmatic changes)
|
|
115
|
+
def _sync_zoom_combo_from_widget(z):
|
|
116
|
+
"""Keep zoom combobox in sync with the widget's zoom."""
|
|
117
|
+
percent = int(round(float(z) * 100))
|
|
118
|
+
label = f"{percent}%"
|
|
119
|
+
cb.blockSignals(True)
|
|
120
|
+
idx = cb.findText(label)
|
|
121
|
+
if idx >= 0:
|
|
122
|
+
cb.setCurrentIndex(idx)
|
|
123
|
+
else:
|
|
124
|
+
# Insert missing value keeping ascending order
|
|
125
|
+
items = [cb.itemText(i) for i in range(cb.count())]
|
|
126
|
+
if label not in items:
|
|
127
|
+
items.append(label)
|
|
128
|
+
try:
|
|
129
|
+
items_sorted = sorted(
|
|
130
|
+
set(items),
|
|
131
|
+
key=lambda s: float(s.replace('%', '').strip())
|
|
132
|
+
)
|
|
133
|
+
except Exception:
|
|
134
|
+
items_sorted = items
|
|
135
|
+
cb.clear()
|
|
136
|
+
cb.addItems(items_sorted)
|
|
137
|
+
cb.setCurrentText(label)
|
|
138
|
+
cb.blockSignals(False)
|
|
139
|
+
|
|
140
|
+
# Keep reference to prevent GC of the inner function
|
|
141
|
+
cb._sync_zoom_combo_from_widget = _sync_zoom_combo_from_widget
|
|
142
|
+
if hasattr(ui.painter, 'zoomChanged'):
|
|
143
|
+
ui.painter.zoomChanged.connect(cb._sync_zoom_combo_from_widget)
|
|
144
|
+
|
|
145
|
+
# Initial label; actual value will be set by load_zoom below
|
|
146
|
+
cb.setCurrentText("100%")
|
|
147
|
+
nodes[key] = cb
|
|
148
|
+
|
|
93
149
|
self._initialized = True
|
|
94
150
|
|
|
95
151
|
def setup(self) -> QWidget:
|
|
@@ -118,6 +174,8 @@ class Painter:
|
|
|
118
174
|
top.addWidget(nodes['painter.select.brush.size'])
|
|
119
175
|
top.addWidget(nodes['painter.select.brush.color'])
|
|
120
176
|
top.addWidget(nodes['painter.select.canvas.size'])
|
|
177
|
+
# Zoom combo placed right after canvas size
|
|
178
|
+
top.addWidget(nodes['painter.select.zoom'])
|
|
121
179
|
top.addStretch(1)
|
|
122
180
|
|
|
123
181
|
if nodes.get('painter.btn.capture') is None:
|
|
@@ -141,11 +199,12 @@ class Painter:
|
|
|
141
199
|
if getattr(ui, 'painter_scroll', None) is None:
|
|
142
200
|
ui.painter_scroll = QScrollArea()
|
|
143
201
|
ui.painter_scroll.setWidget(ui.painter)
|
|
144
|
-
|
|
202
|
+
# Must be False to allow content widget to grow/shrink with zoom and show scrollbars
|
|
203
|
+
ui.painter_scroll.setWidgetResizable(False)
|
|
145
204
|
else:
|
|
146
205
|
if ui.painter_scroll.widget() is not ui.painter:
|
|
147
206
|
ui.painter_scroll.setWidget(ui.painter)
|
|
148
|
-
ui.painter_scroll.setWidgetResizable(
|
|
207
|
+
ui.painter_scroll.setWidgetResizable(False)
|
|
149
208
|
|
|
150
209
|
if nodes.get('tip.output.tab.draw') is None:
|
|
151
210
|
nodes['tip.output.tab.draw'] = HelpLabel(trans('tip.output.tab.draw'), self.window)
|