pygpt-net 2.4.54__py3-none-any.whl → 2.4.56__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.
- CHANGELOG.md +10 -0
- README.md +11 -1
- pygpt_net/CHANGELOG.txt +10 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/controller/access/__init__.py +1 -3
- pygpt_net/controller/access/voice.py +20 -7
- pygpt_net/controller/{attachment.py → attachment/__init__.py} +0 -0
- pygpt_net/controller/{camera.py → camera/__init__.py} +1 -1
- pygpt_net/controller/{files.py → files/__init__.py} +0 -0
- pygpt_net/controller/{finder.py → finder/__init__.py} +0 -0
- pygpt_net/controller/lang/mapping.py +2 -1
- pygpt_net/controller/{launcher.py → launcher/__init__.py} +0 -0
- pygpt_net/controller/{layout.py → layout/__init__.py} +0 -0
- pygpt_net/controller/{notepad.py → notepad/__init__.py} +0 -0
- pygpt_net/controller/settings/editor.py +4 -0
- pygpt_net/core/access/shortcuts.py +48 -29
- pygpt_net/core/{camera.py → camera/__init__.py} +5 -4
- pygpt_net/core/{command.py → command/__init__.py} +4 -3
- pygpt_net/core/{dispatcher.py → dispatcher/__init__.py} +0 -0
- pygpt_net/core/{history.py → history/__init__.py} +0 -2
- pygpt_net/core/{image.py → image/__init__.py} +0 -0
- pygpt_net/core/{info.py → info/__init__.py} +0 -0
- pygpt_net/core/{locale.py → locale/__init__.py} +0 -0
- pygpt_net/core/{notepad.py → notepad/__init__.py} +0 -0
- pygpt_net/core/{platforms.py → platforms/__init__.py} +0 -0
- pygpt_net/core/{plugins.py → plugins/__init__.py} +0 -0
- pygpt_net/core/{settings.py → settings/__init__.py} +0 -0
- pygpt_net/core/tabs/__init__.py +8 -6
- pygpt_net/core/{tokens.py → tokens/__init__.py} +0 -0
- pygpt_net/data/config/config.json +11 -9
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/config/modes.json +3 -3
- pygpt_net/data/config/settings.json +24 -0
- pygpt_net/data/locale/locale.de.ini +3 -0
- pygpt_net/data/locale/locale.en.ini +3 -0
- pygpt_net/data/locale/locale.es.ini +3 -0
- pygpt_net/data/locale/locale.fr.ini +3 -0
- pygpt_net/data/locale/locale.it.ini +3 -0
- pygpt_net/data/locale/locale.pl.ini +4 -1
- pygpt_net/data/locale/locale.uk.ini +3 -0
- pygpt_net/data/locale/locale.zh.ini +3 -0
- pygpt_net/launcher.py +3 -2
- pygpt_net/plugin/audio_input/simple.py +10 -7
- pygpt_net/plugin/audio_input/worker.py +1 -1
- pygpt_net/provider/core/config/patch.py +21 -1
- pygpt_net/tools/code_interpreter/__init__.py +2 -1
- pygpt_net/tools/code_interpreter/ui/dialogs.py +10 -1
- pygpt_net/tools/code_interpreter/ui/widgets.py +56 -1
- pygpt_net/tools/html_canvas/__init__.py +2 -1
- pygpt_net/tools/html_canvas/ui/dialogs.py +10 -1
- pygpt_net/tools/html_canvas/ui/widgets.py +33 -1
- pygpt_net/ui/__init__.py +1 -1
- pygpt_net/ui/layout/chat/calendar.py +5 -2
- pygpt_net/ui/layout/chat/explorer.py +4 -2
- pygpt_net/ui/layout/chat/painter.py +4 -2
- pygpt_net/ui/main.py +63 -2
- pygpt_net/ui/widget/calendar/select.py +29 -1
- pygpt_net/ui/widget/draw/painter.py +25 -1
- pygpt_net/ui/widget/filesystem/explorer.py +24 -1
- pygpt_net/ui/widget/tabs/body.py +54 -4
- pygpt_net/ui/widget/textarea/calendar_note.py +26 -2
- pygpt_net/ui/widget/textarea/html.py +21 -2
- pygpt_net/ui/widget/textarea/notepad.py +37 -3
- pygpt_net/ui/widget/textarea/web.py +4 -2
- {pygpt_net-2.4.54.dist-info → pygpt_net-2.4.56.dist-info}/METADATA +12 -2
- {pygpt_net-2.4.54.dist-info → pygpt_net-2.4.56.dist-info}/RECORD +77 -77
- /pygpt_net/controller/{command.py → command/__init__.py} +0 -0
- /pygpt_net/controller/{mode.py → mode/__init__.py} +0 -0
- /pygpt_net/core/{installer.py → installer/__init__.py} +0 -0
- /pygpt_net/core/{models.py → models/__init__.py} +0 -0
- /pygpt_net/core/{modes.py → modes/__init__.py} +0 -0
- /pygpt_net/core/{presets.py → presets/__init__.py} +0 -0
- /pygpt_net/core/{profile.py → profile/__init__.py} +0 -0
- /pygpt_net/core/{worker.py → worker/__init__.py} +0 -0
- {pygpt_net-2.4.54.dist-info → pygpt_net-2.4.56.dist-info}/LICENSE +0 -0
- {pygpt_net-2.4.54.dist-info → pygpt_net-2.4.56.dist-info}/WHEEL +0 -0
- {pygpt_net-2.4.54.dist-info → pygpt_net-2.4.56.dist-info}/entry_points.txt +0 -0
pygpt_net/ui/widget/tabs/body.py
CHANGED
@@ -6,18 +6,48 @@
|
|
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.01.19 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
|
-
from PySide6.
|
12
|
+
from PySide6.QtCore import QEvent
|
13
|
+
from PySide6.QtWidgets import QTabWidget, QWidget
|
13
14
|
|
14
15
|
from pygpt_net.core.tabs.tab import Tab
|
15
16
|
|
16
17
|
|
17
18
|
class TabBody(QTabWidget):
|
18
|
-
def __init__(self):
|
19
|
+
def __init__(self, window=None):
|
19
20
|
super(TabBody, self).__init__()
|
21
|
+
self.window = window
|
20
22
|
self.owner = None
|
23
|
+
self.body = []
|
24
|
+
self.installEventFilter(self)
|
25
|
+
|
26
|
+
def append(self, body: QWidget):
|
27
|
+
"""
|
28
|
+
Append tab body (parent widget)
|
29
|
+
|
30
|
+
:param body: tab body widget
|
31
|
+
"""
|
32
|
+
self.body.append(body)
|
33
|
+
|
34
|
+
def get_body(self):
|
35
|
+
"""
|
36
|
+
Get tab body (parent widget)
|
37
|
+
|
38
|
+
:return: tab body widget
|
39
|
+
"""
|
40
|
+
return self.body
|
41
|
+
|
42
|
+
def attach_tab(self, tab: Tab):
|
43
|
+
"""
|
44
|
+
Attach tab to body
|
45
|
+
|
46
|
+
:param tab: tab instance
|
47
|
+
"""
|
48
|
+
for body in self.body:
|
49
|
+
if hasattr(body, 'set_tab'):
|
50
|
+
body.set_tab(tab)
|
21
51
|
|
22
52
|
def setOwner(self, owner: Tab):
|
23
53
|
"""
|
@@ -26,6 +56,7 @@ class TabBody(QTabWidget):
|
|
26
56
|
:param owner: parent tab instance
|
27
57
|
"""
|
28
58
|
self.owner = owner
|
59
|
+
self.attach_tab(owner)
|
29
60
|
|
30
61
|
def getOwner(self) -> Tab:
|
31
62
|
"""
|
@@ -33,4 +64,23 @@ class TabBody(QTabWidget):
|
|
33
64
|
|
34
65
|
:return: parent tab instance
|
35
66
|
"""
|
36
|
-
return self.owner
|
67
|
+
return self.owner
|
68
|
+
|
69
|
+
def eventFilter(self, source, event):
|
70
|
+
"""
|
71
|
+
Focus event filter
|
72
|
+
|
73
|
+
:param source: source
|
74
|
+
:param event: event
|
75
|
+
"""
|
76
|
+
if (event.type() == QEvent.ChildAdded and
|
77
|
+
source is self and
|
78
|
+
event.child().isWidgetType()):
|
79
|
+
self._glwidget = event.child()
|
80
|
+
self._glwidget.installEventFilter(self)
|
81
|
+
elif (event.type() == event.Type.MouseButtonPress):
|
82
|
+
# handle column focus
|
83
|
+
if self.owner is not None:
|
84
|
+
col_idx = self.owner.column_idx
|
85
|
+
self.window.controller.ui.tabs.on_column_focus(col_idx)
|
86
|
+
return super().eventFilter(source, event)
|
@@ -6,13 +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:
|
9
|
+
# Updated Date: 2025.01.19 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from PySide6.QtCore import Qt
|
13
13
|
from PySide6.QtGui import QAction, QIcon, QKeySequence
|
14
14
|
from PySide6.QtWidgets import QTextEdit
|
15
15
|
|
16
|
+
from pygpt_net.core.tabs.tab import Tab
|
16
17
|
from pygpt_net.core.text.finder import Finder
|
17
18
|
from pygpt_net.utils import trans
|
18
19
|
import pygpt_net.icons_rc
|
@@ -21,7 +22,7 @@ import pygpt_net.icons_rc
|
|
21
22
|
class CalendarNote(QTextEdit):
|
22
23
|
def __init__(self, window=None):
|
23
24
|
"""
|
24
|
-
|
25
|
+
Calendar note widget
|
25
26
|
|
26
27
|
:param window: main window
|
27
28
|
"""
|
@@ -34,6 +35,29 @@ class CalendarNote(QTextEdit):
|
|
34
35
|
self.textChanged.connect(self.text_changed)
|
35
36
|
self.max_font_size = 42
|
36
37
|
self.min_font_size = 8
|
38
|
+
self.tab = None
|
39
|
+
self.installEventFilter(self)
|
40
|
+
|
41
|
+
def eventFilter(self, source, event):
|
42
|
+
"""
|
43
|
+
Focus event filter
|
44
|
+
|
45
|
+
:param source: source
|
46
|
+
:param event: event
|
47
|
+
"""
|
48
|
+
if event.type() == event.Type.FocusIn:
|
49
|
+
if self.tab is not None:
|
50
|
+
col_idx = self.tab.column_idx
|
51
|
+
self.window.controller.ui.tabs.on_column_focus(col_idx)
|
52
|
+
return super().eventFilter(source, event)
|
53
|
+
|
54
|
+
def set_tab(self, tab: Tab):
|
55
|
+
"""
|
56
|
+
Set tab
|
57
|
+
|
58
|
+
:param tab: Tab
|
59
|
+
"""
|
60
|
+
self.tab = tab
|
37
61
|
|
38
62
|
def text_changed(self):
|
39
63
|
"""On parent textarea text changed"""
|
@@ -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:
|
9
|
+
# Updated Date: 2025.01.19 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import re
|
13
13
|
|
14
|
-
from PySide6.QtCore import Qt, QObject, Signal, Slot
|
14
|
+
from PySide6.QtCore import Qt, QObject, Signal, Slot, QEvent
|
15
15
|
from PySide6.QtWebChannel import QWebChannel
|
16
16
|
from PySide6.QtWebEngineCore import QWebEngineSettings, QWebEnginePage
|
17
17
|
from PySide6.QtWebEngineWidgets import QWebEngineView
|
@@ -43,6 +43,7 @@ class HtmlOutput(QWebEngineView):
|
|
43
43
|
self.html_content = ""
|
44
44
|
self.meta = None
|
45
45
|
self.tab = None
|
46
|
+
self.installEventFilter(self)
|
46
47
|
|
47
48
|
def set_tab(self, tab):
|
48
49
|
"""
|
@@ -213,6 +214,24 @@ class HtmlOutput(QWebEngineView):
|
|
213
214
|
super(HtmlOutput, self).focusInEvent(e)
|
214
215
|
self.window.controller.finder.focus_in(self.finder)
|
215
216
|
|
217
|
+
def eventFilter(self, source, event):
|
218
|
+
"""
|
219
|
+
Focus event filter
|
220
|
+
|
221
|
+
:param source: source
|
222
|
+
:param event: event
|
223
|
+
"""
|
224
|
+
if (event.type() == QEvent.ChildAdded and
|
225
|
+
source is self and
|
226
|
+
event.child().isWidgetType()):
|
227
|
+
self._glwidget = event.child()
|
228
|
+
self._glwidget.installEventFilter(self)
|
229
|
+
elif (event.type() == event.Type.MouseButtonPress):
|
230
|
+
if self.tab:
|
231
|
+
col_idx = self.tab.column_idx
|
232
|
+
self.window.controller.ui.tabs.on_column_focus(col_idx)
|
233
|
+
return super().eventFilter(source, event)
|
234
|
+
|
216
235
|
|
217
236
|
class CustomWebEnginePage(QWebEnginePage):
|
218
237
|
"""Custom WebEnginePage to handle web events"""
|
@@ -6,13 +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:
|
9
|
+
# Updated Date: 2025.01.19 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
|
-
from PySide6.QtCore import Qt
|
12
|
+
from PySide6.QtCore import Qt, QEvent
|
13
13
|
from PySide6.QtGui import QAction, QIcon, QKeySequence
|
14
14
|
from PySide6.QtWidgets import QTextEdit, QWidget, QVBoxLayout
|
15
15
|
|
16
|
+
from pygpt_net.core.tabs.tab import Tab
|
16
17
|
from pygpt_net.core.text.finder import Finder
|
17
18
|
from pygpt_net.ui.widget.element.labels import HelpLabel
|
18
19
|
from pygpt_net.utils import trans
|
@@ -32,6 +33,7 @@ class NotepadWidget(QWidget):
|
|
32
33
|
self.textarea = NotepadOutput(self.window)
|
33
34
|
self.window.ui.nodes['tip.output.tab.notepad'] = HelpLabel(trans('tip.output.tab.notepad'), self.window)
|
34
35
|
self.opened = False
|
36
|
+
self.tab = None
|
35
37
|
|
36
38
|
layout = QVBoxLayout()
|
37
39
|
layout.addWidget(self.textarea)
|
@@ -39,6 +41,15 @@ class NotepadWidget(QWidget):
|
|
39
41
|
layout.setContentsMargins(0, 0, 0, 0)
|
40
42
|
self.setLayout(layout)
|
41
43
|
|
44
|
+
def set_tab(self, tab: Tab):
|
45
|
+
"""
|
46
|
+
Set tab
|
47
|
+
|
48
|
+
:param tab: Tab
|
49
|
+
"""
|
50
|
+
self.tab = tab
|
51
|
+
self.textarea.set_tab(tab)
|
52
|
+
|
42
53
|
def scroll_to_bottom(self):
|
43
54
|
"""Scroll down"""
|
44
55
|
self.textarea.verticalScrollBar().setValue(self.textarea.verticalScrollBar().maximum())
|
@@ -69,7 +80,7 @@ class NotepadWidget(QWidget):
|
|
69
80
|
class NotepadOutput(QTextEdit):
|
70
81
|
def __init__(self, window=None):
|
71
82
|
"""
|
72
|
-
Notepad
|
83
|
+
Notepad output textarea
|
73
84
|
|
74
85
|
:param window: main window
|
75
86
|
"""
|
@@ -83,6 +94,29 @@ class NotepadOutput(QTextEdit):
|
|
83
94
|
self.min_font_size = 8
|
84
95
|
self.id = 1 # assigned in setup
|
85
96
|
self.textChanged.connect(self.text_changed)
|
97
|
+
self.tab = None
|
98
|
+
self.installEventFilter(self)
|
99
|
+
|
100
|
+
def eventFilter(self, source, event):
|
101
|
+
"""
|
102
|
+
Focus event filter
|
103
|
+
|
104
|
+
:param source: source
|
105
|
+
:param event: event
|
106
|
+
"""
|
107
|
+
if event.type() == event.Type.FocusIn:
|
108
|
+
if self.tab is not None:
|
109
|
+
col_idx = self.tab.column_idx
|
110
|
+
self.window.controller.ui.tabs.on_column_focus(col_idx)
|
111
|
+
return super().eventFilter(source, event)
|
112
|
+
|
113
|
+
def set_tab(self, tab: Tab):
|
114
|
+
"""
|
115
|
+
Set tab
|
116
|
+
|
117
|
+
:param tab: Tab
|
118
|
+
"""
|
119
|
+
self.tab = tab
|
86
120
|
|
87
121
|
def text_changed(self):
|
88
122
|
"""On text changed"""
|
@@ -6,11 +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:
|
9
|
+
# Updated Date: 2025.01.19 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import re
|
13
13
|
|
14
|
+
from PySide6 import QtCore
|
14
15
|
from PySide6.QtCore import Qt, QObject, Signal, Slot, QEvent
|
15
16
|
from PySide6.QtWebChannel import QWebChannel
|
16
17
|
from PySide6.QtWebEngineCore import QWebEngineSettings, QWebEnginePage
|
@@ -18,7 +19,7 @@ from PySide6.QtWebEngineWidgets import QWebEngineView
|
|
18
19
|
from PySide6.QtGui import QAction, QIcon, QKeySequence
|
19
20
|
from PySide6.QtWidgets import QMenu
|
20
21
|
|
21
|
-
from pygpt_net.core.events import RenderEvent
|
22
|
+
from pygpt_net.core.events import RenderEvent, ControlEvent
|
22
23
|
from pygpt_net.item.ctx import CtxMeta
|
23
24
|
from pygpt_net.core.text.web_finder import WebFinder
|
24
25
|
from pygpt_net.ui.widget.tabs.layout import FocusEventFilter
|
@@ -63,6 +64,7 @@ class ChatWebOutput(QWebEngineView):
|
|
63
64
|
elif (event.type() == event.Type.MouseButtonPress):
|
64
65
|
col_idx = self.tab.column_idx
|
65
66
|
self.window.controller.ui.tabs.on_column_focus(col_idx)
|
67
|
+
|
66
68
|
return super().eventFilter(source, event)
|
67
69
|
|
68
70
|
def on_focus(self, widget):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pygpt-net
|
3
|
-
Version: 2.4.
|
3
|
+
Version: 2.4.56
|
4
4
|
Summary: Desktop AI Assistant powered by models: OpenAI o1, GPT-4o, GPT-4, GPT-4 Vision, GPT-3.5, DALL-E 3, Llama 3, Mistral, Gemini, Claude, Bielik, and other models supported by Langchain, Llama Index, and Ollama. Features include chatbot, text completion, image generation, vision analysis, speech-to-text, internet access, file handling, command execution and more.
|
5
5
|
Home-page: https://pygpt.net
|
6
6
|
License: MIT
|
@@ -93,7 +93,7 @@ Description-Content-Type: text/markdown
|
|
93
93
|
|
94
94
|
[](https://snapcraft.io/pygpt)
|
95
95
|
|
96
|
-
Release: **2.4.
|
96
|
+
Release: **2.4.56** | build: **2025.01.19** | Python: **>=3.10, <3.13**
|
97
97
|
|
98
98
|
> Official website: https://pygpt.net | Documentation: https://pygpt.readthedocs.io
|
99
99
|
>
|
@@ -4051,6 +4051,16 @@ may consume additional tokens that are not displayed in the main window.
|
|
4051
4051
|
|
4052
4052
|
## Recent changes:
|
4053
4053
|
|
4054
|
+
**2.4.56 (2025-01-19)**
|
4055
|
+
|
4056
|
+
- Improved tab switching and focus change.
|
4057
|
+
- Improved global keyboard shortcuts handling.
|
4058
|
+
|
4059
|
+
**2.4.55 (2025-01-18)**
|
4060
|
+
|
4061
|
+
- Added a new option in settings: Audio -> Recording timeout.
|
4062
|
+
- Added a new option in settings: Audio -> Enable timeout in continuous mode.
|
4063
|
+
|
4054
4064
|
**2.4.54 (2025-01-18)**
|
4055
4065
|
|
4056
4066
|
- Audio output switched from PyGame to PyAudio. It may be necessary to manually connect Alsa in Snap version with: "sudo snap connect pygpt:alsa".
|