pygpt-net 2.6.33__py3-none-any.whl → 2.6.35__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.
Files changed (64) hide show
  1. pygpt_net/CHANGELOG.txt +14 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/controller/assistant/batch.py +14 -4
  4. pygpt_net/controller/assistant/files.py +1 -0
  5. pygpt_net/controller/assistant/store.py +195 -1
  6. pygpt_net/controller/camera/camera.py +1 -1
  7. pygpt_net/controller/chat/common.py +58 -48
  8. pygpt_net/controller/chat/handler/stream_worker.py +55 -43
  9. pygpt_net/controller/config/placeholder.py +95 -75
  10. pygpt_net/controller/dialogs/confirm.py +3 -1
  11. pygpt_net/controller/media/media.py +11 -3
  12. pygpt_net/controller/painter/common.py +243 -13
  13. pygpt_net/controller/painter/painter.py +11 -2
  14. pygpt_net/core/assistants/files.py +18 -0
  15. pygpt_net/core/bridge/bridge.py +1 -5
  16. pygpt_net/core/bridge/context.py +81 -36
  17. pygpt_net/core/bridge/worker.py +3 -1
  18. pygpt_net/core/camera/camera.py +31 -402
  19. pygpt_net/core/camera/worker.py +430 -0
  20. pygpt_net/core/ctx/bag.py +4 -0
  21. pygpt_net/core/events/app.py +10 -17
  22. pygpt_net/core/events/base.py +17 -25
  23. pygpt_net/core/events/control.py +9 -17
  24. pygpt_net/core/events/event.py +9 -62
  25. pygpt_net/core/events/kernel.py +8 -17
  26. pygpt_net/core/events/realtime.py +8 -17
  27. pygpt_net/core/events/render.py +9 -17
  28. pygpt_net/core/filesystem/url.py +3 -0
  29. pygpt_net/core/render/web/body.py +454 -40
  30. pygpt_net/core/render/web/pid.py +39 -24
  31. pygpt_net/core/render/web/renderer.py +146 -40
  32. pygpt_net/core/text/utils.py +3 -0
  33. pygpt_net/data/config/config.json +4 -3
  34. pygpt_net/data/config/models.json +3 -3
  35. pygpt_net/data/config/settings.json +10 -5
  36. pygpt_net/data/css/web-blocks.css +3 -2
  37. pygpt_net/data/css/web-chatgpt.css +3 -1
  38. pygpt_net/data/css/web-chatgpt_wide.css +3 -1
  39. pygpt_net/data/locale/locale.de.ini +9 -7
  40. pygpt_net/data/locale/locale.en.ini +10 -6
  41. pygpt_net/data/locale/locale.es.ini +9 -7
  42. pygpt_net/data/locale/locale.fr.ini +9 -7
  43. pygpt_net/data/locale/locale.it.ini +9 -7
  44. pygpt_net/data/locale/locale.pl.ini +9 -7
  45. pygpt_net/data/locale/locale.uk.ini +9 -7
  46. pygpt_net/data/locale/locale.zh.ini +9 -7
  47. pygpt_net/item/assistant.py +13 -1
  48. pygpt_net/provider/api/google/__init__.py +46 -28
  49. pygpt_net/provider/api/openai/__init__.py +13 -10
  50. pygpt_net/provider/api/openai/store.py +45 -1
  51. pygpt_net/provider/core/config/patch.py +9 -0
  52. pygpt_net/provider/llms/google.py +4 -0
  53. pygpt_net/ui/dialog/assistant_store.py +213 -203
  54. pygpt_net/ui/layout/chat/input.py +3 -3
  55. pygpt_net/ui/layout/chat/painter.py +63 -4
  56. pygpt_net/ui/widget/draw/painter.py +715 -104
  57. pygpt_net/ui/widget/option/combo.py +5 -1
  58. pygpt_net/ui/widget/textarea/input.py +273 -3
  59. pygpt_net/ui/widget/textarea/web.py +2 -0
  60. {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.35.dist-info}/METADATA +16 -2
  61. {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.35.dist-info}/RECORD +64 -63
  62. {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.35.dist-info}/LICENSE +0 -0
  63. {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.35.dist-info}/WHEEL +0 -0
  64. {pygpt_net-2.6.33.dist-info → pygpt_net-2.6.35.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.08.24 23:00:00 #
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
- ui.painter_scroll.setWidgetResizable(True)
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(True)
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)