pygpt-net 2.6.1__py3-none-any.whl → 2.6.6__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 +23 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +20 -1
- pygpt_net/config.py +55 -65
- pygpt_net/controller/__init__.py +5 -2
- pygpt_net/controller/calendar/note.py +101 -126
- pygpt_net/controller/chat/chat.py +38 -35
- pygpt_net/controller/chat/render.py +154 -214
- pygpt_net/controller/chat/response.py +5 -3
- pygpt_net/controller/chat/stream.py +92 -27
- pygpt_net/controller/config/config.py +39 -42
- pygpt_net/controller/config/field/checkbox.py +16 -12
- pygpt_net/controller/config/field/checkbox_list.py +36 -31
- pygpt_net/controller/config/field/cmd.py +51 -57
- pygpt_net/controller/config/field/combo.py +33 -16
- pygpt_net/controller/config/field/dictionary.py +48 -55
- pygpt_net/controller/config/field/input.py +50 -32
- pygpt_net/controller/config/field/slider.py +40 -45
- pygpt_net/controller/config/field/textarea.py +20 -6
- pygpt_net/controller/config/placeholder.py +110 -231
- pygpt_net/controller/ctx/common.py +48 -48
- pygpt_net/controller/ctx/ctx.py +91 -132
- pygpt_net/controller/lang/mapping.py +57 -95
- pygpt_net/controller/lang/plugins.py +64 -55
- pygpt_net/controller/lang/settings.py +39 -38
- pygpt_net/controller/layout/layout.py +176 -109
- pygpt_net/controller/mode/mode.py +88 -85
- pygpt_net/controller/model/model.py +73 -73
- pygpt_net/controller/plugins/plugins.py +209 -223
- pygpt_net/controller/plugins/presets.py +54 -55
- pygpt_net/controller/plugins/settings.py +54 -69
- pygpt_net/controller/presets/editor.py +33 -88
- pygpt_net/controller/presets/experts.py +20 -1
- pygpt_net/controller/presets/presets.py +293 -298
- pygpt_net/controller/settings/profile.py +16 -4
- pygpt_net/controller/theme/theme.py +72 -81
- pygpt_net/controller/ui/mode.py +118 -186
- pygpt_net/controller/ui/tabs.py +69 -90
- pygpt_net/controller/ui/ui.py +47 -56
- pygpt_net/controller/ui/vision.py +24 -23
- pygpt_net/core/agents/runner.py +15 -7
- pygpt_net/core/bridge/bridge.py +5 -5
- pygpt_net/core/command/command.py +149 -219
- pygpt_net/core/ctx/ctx.py +94 -146
- pygpt_net/core/debug/debug.py +48 -58
- pygpt_net/core/experts/experts.py +3 -3
- pygpt_net/core/models/models.py +74 -112
- pygpt_net/core/modes/modes.py +13 -21
- pygpt_net/core/plugins/plugins.py +154 -177
- pygpt_net/core/presets/presets.py +103 -176
- pygpt_net/core/render/web/body.py +217 -215
- pygpt_net/core/render/web/renderer.py +330 -474
- pygpt_net/core/text/utils.py +28 -44
- pygpt_net/core/tokens/tokens.py +104 -203
- pygpt_net/data/config/config.json +3 -3
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/locale/locale.de.ini +2 -0
- pygpt_net/data/locale/locale.en.ini +2 -0
- pygpt_net/data/locale/locale.es.ini +2 -0
- pygpt_net/data/locale/locale.fr.ini +2 -0
- pygpt_net/data/locale/locale.it.ini +2 -0
- pygpt_net/data/locale/locale.pl.ini +3 -1
- pygpt_net/data/locale/locale.uk.ini +2 -0
- pygpt_net/data/locale/locale.zh.ini +2 -0
- pygpt_net/item/ctx.py +141 -139
- pygpt_net/plugin/agent/plugin.py +2 -1
- pygpt_net/plugin/audio_output/plugin.py +5 -2
- pygpt_net/plugin/base/plugin.py +101 -85
- pygpt_net/plugin/bitbucket/__init__.py +12 -0
- pygpt_net/plugin/bitbucket/config.py +267 -0
- pygpt_net/plugin/bitbucket/plugin.py +126 -0
- pygpt_net/plugin/bitbucket/worker.py +569 -0
- pygpt_net/plugin/cmd_code_interpreter/plugin.py +3 -2
- pygpt_net/plugin/cmd_custom/plugin.py +3 -2
- pygpt_net/plugin/cmd_files/plugin.py +3 -2
- pygpt_net/plugin/cmd_history/plugin.py +3 -2
- pygpt_net/plugin/cmd_mouse_control/plugin.py +5 -2
- pygpt_net/plugin/cmd_serial/plugin.py +3 -2
- pygpt_net/plugin/cmd_system/plugin.py +3 -6
- pygpt_net/plugin/cmd_web/plugin.py +3 -2
- pygpt_net/plugin/experts/plugin.py +2 -2
- pygpt_net/plugin/facebook/__init__.py +12 -0
- pygpt_net/plugin/facebook/config.py +359 -0
- pygpt_net/plugin/facebook/plugin.py +113 -0
- pygpt_net/plugin/facebook/worker.py +698 -0
- pygpt_net/plugin/github/__init__.py +12 -0
- pygpt_net/plugin/github/config.py +441 -0
- pygpt_net/plugin/github/plugin.py +126 -0
- pygpt_net/plugin/github/worker.py +674 -0
- pygpt_net/plugin/google/__init__.py +12 -0
- pygpt_net/plugin/google/config.py +367 -0
- pygpt_net/plugin/google/plugin.py +126 -0
- pygpt_net/plugin/google/worker.py +826 -0
- pygpt_net/plugin/idx_llama_index/plugin.py +3 -2
- pygpt_net/plugin/mailer/plugin.py +3 -5
- pygpt_net/plugin/openai_vision/plugin.py +3 -2
- pygpt_net/plugin/real_time/plugin.py +52 -60
- pygpt_net/plugin/slack/__init__.py +12 -0
- pygpt_net/plugin/slack/config.py +349 -0
- pygpt_net/plugin/slack/plugin.py +115 -0
- pygpt_net/plugin/slack/worker.py +639 -0
- pygpt_net/plugin/telegram/__init__.py +12 -0
- pygpt_net/plugin/telegram/config.py +308 -0
- pygpt_net/plugin/telegram/plugin.py +117 -0
- pygpt_net/plugin/telegram/worker.py +563 -0
- pygpt_net/plugin/twitter/__init__.py +12 -0
- pygpt_net/plugin/twitter/config.py +491 -0
- pygpt_net/plugin/twitter/plugin.py +125 -0
- pygpt_net/plugin/twitter/worker.py +837 -0
- pygpt_net/provider/agents/llama_index/legacy/openai_assistant.py +35 -3
- pygpt_net/tools/code_interpreter/tool.py +0 -1
- pygpt_net/tools/translator/tool.py +1 -1
- pygpt_net/ui/base/config_dialog.py +86 -100
- pygpt_net/ui/base/context_menu.py +48 -46
- pygpt_net/ui/dialog/preset.py +34 -77
- pygpt_net/ui/layout/ctx/ctx_list.py +10 -6
- pygpt_net/ui/layout/toolbox/presets.py +41 -41
- pygpt_net/ui/main.py +49 -31
- pygpt_net/ui/tray.py +61 -60
- pygpt_net/ui/widget/calendar/select.py +86 -70
- pygpt_net/ui/widget/lists/attachment.py +86 -44
- pygpt_net/ui/widget/lists/base_list_combo.py +85 -33
- pygpt_net/ui/widget/lists/context.py +135 -188
- pygpt_net/ui/widget/lists/preset.py +59 -61
- pygpt_net/ui/widget/textarea/web.py +161 -48
- pygpt_net/utils.py +8 -1
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/METADATA +164 -2
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/RECORD +131 -103
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.6.dist-info}/entry_points.txt +0 -0
|
@@ -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: 2025.
|
|
9
|
+
# Updated Date: 2025.08.16 00:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from typing import Optional
|
|
13
13
|
|
|
14
|
+
from PySide6.QtCore import QTimer, QSignalBlocker
|
|
14
15
|
from PySide6.QtWidgets import QApplication
|
|
15
16
|
|
|
16
17
|
from pygpt_net.core.tabs.tab import Tab
|
|
@@ -29,31 +30,27 @@ class Common:
|
|
|
29
30
|
self.window = window
|
|
30
31
|
self.summarizer = Summarizer(window)
|
|
31
32
|
|
|
33
|
+
def _update_ctx_no_scroll(self):
|
|
34
|
+
self.window.controller.ctx.update(no_scroll=True)
|
|
35
|
+
|
|
32
36
|
def update_label_by_current(self):
|
|
33
37
|
"""Update ctx label from current ctx"""
|
|
34
38
|
mode = self.window.core.ctx.get_mode()
|
|
35
|
-
|
|
36
|
-
# if no ctx mode then use current mode
|
|
37
39
|
if mode is None:
|
|
38
40
|
mode = self.window.core.config.get('mode')
|
|
39
41
|
|
|
40
42
|
label = trans('mode.' + mode)
|
|
41
43
|
|
|
42
|
-
# append assistant name to ctx name label
|
|
43
44
|
if mode == 'assistant':
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
assistants = self.window.core.assistants
|
|
46
|
+
assistant_id = self.window.core.ctx.get_assistant()
|
|
47
|
+
assistant = assistants.get_by_id(assistant_id) if assistant_id is not None else None
|
|
48
|
+
if assistant is None:
|
|
49
|
+
assistant_id = self.window.core.config.get('assistant')
|
|
50
|
+
assistant = assistants.get_by_id(assistant_id)
|
|
46
51
|
if assistant is not None:
|
|
47
|
-
|
|
48
|
-
label += ' (' + assistant.name + ')'
|
|
49
|
-
else:
|
|
50
|
-
# get current assistant
|
|
51
|
-
id = self.window.core.config.get('assistant')
|
|
52
|
-
assistant = self.window.core.assistants.get_by_id(id)
|
|
53
|
-
if assistant is not None:
|
|
54
|
-
label += ' (' + assistant.name + ')'
|
|
52
|
+
label = f'{label} ({assistant.name})'
|
|
55
53
|
|
|
56
|
-
# update ctx label
|
|
57
54
|
self.window.controller.ui.update_ctx_label(label)
|
|
58
55
|
|
|
59
56
|
def update_label(
|
|
@@ -73,9 +70,7 @@ class Common:
|
|
|
73
70
|
if mode == 'assistant' and assistant_id is not None:
|
|
74
71
|
assistant = self.window.core.assistants.get_by_id(assistant_id)
|
|
75
72
|
if assistant is not None:
|
|
76
|
-
label
|
|
77
|
-
|
|
78
|
-
# update ctx label
|
|
73
|
+
label = f'{label} ({assistant.name})'
|
|
79
74
|
self.window.controller.ui.update_ctx_label(label)
|
|
80
75
|
|
|
81
76
|
def duplicate(self, meta_id: int):
|
|
@@ -86,11 +81,9 @@ class Common:
|
|
|
86
81
|
"""
|
|
87
82
|
new_id = self.window.core.ctx.duplicate(meta_id)
|
|
88
83
|
if new_id is not None:
|
|
89
|
-
self.window.core.attachments.context.duplicate(meta_id, new_id)
|
|
90
|
-
self.window.update_status(
|
|
91
|
-
|
|
92
|
-
)
|
|
93
|
-
self.window.controller.ctx.update(no_scroll=True)
|
|
84
|
+
self.window.core.attachments.context.duplicate(meta_id, new_id)
|
|
85
|
+
self.window.update_status(f"Context duplicated, new ctx id: {new_id}")
|
|
86
|
+
QTimer.singleShot(100, self._update_ctx_no_scroll)
|
|
94
87
|
|
|
95
88
|
def dismiss_rename(self):
|
|
96
89
|
"""Dismiss rename dialog"""
|
|
@@ -102,34 +95,42 @@ class Common:
|
|
|
102
95
|
|
|
103
96
|
:param meta: CtxMeta instance
|
|
104
97
|
"""
|
|
105
|
-
data_id = None
|
|
106
|
-
title = None
|
|
107
|
-
if meta:
|
|
108
|
-
data_id = meta.id
|
|
109
|
-
title = meta.name
|
|
98
|
+
data_id = meta.id if meta else None
|
|
99
|
+
title = meta.name if meta else None
|
|
110
100
|
self.window.controller.ui.tabs.focus_by_type(Tab.TAB_CHAT, data_id=data_id, title=title, meta=meta)
|
|
111
101
|
|
|
112
102
|
def restore_display_filter(self):
|
|
113
103
|
"""Restore display filter"""
|
|
114
|
-
self.window.ui.nodes
|
|
115
|
-
|
|
116
|
-
|
|
104
|
+
nodes = self.window.ui.nodes
|
|
105
|
+
all_radio = nodes['filter.ctx.radio.all']
|
|
106
|
+
pinned_radio = nodes['filter.ctx.radio.pinned']
|
|
107
|
+
indexed_radio = nodes['filter.ctx.radio.indexed']
|
|
108
|
+
|
|
109
|
+
try:
|
|
110
|
+
b1 = QSignalBlocker(all_radio)
|
|
111
|
+
b2 = QSignalBlocker(pinned_radio)
|
|
112
|
+
b3 = QSignalBlocker(indexed_radio)
|
|
113
|
+
except:
|
|
114
|
+
pass
|
|
115
|
+
|
|
116
|
+
all_radio.setChecked(False)
|
|
117
|
+
pinned_radio.setChecked(False)
|
|
118
|
+
indexed_radio.setChecked(False)
|
|
117
119
|
|
|
118
120
|
if self.window.core.config.has('ctx.records.filter'):
|
|
119
|
-
|
|
120
|
-
self.toggle_display_filter(
|
|
121
|
+
filter_value = self.window.core.config.get('ctx.records.filter')
|
|
122
|
+
self.toggle_display_filter(filter_value)
|
|
121
123
|
|
|
122
|
-
if
|
|
123
|
-
|
|
124
|
-
elif
|
|
125
|
-
|
|
124
|
+
if filter_value == 'pinned':
|
|
125
|
+
pinned_radio.setChecked(True)
|
|
126
|
+
elif filter_value == 'indexed':
|
|
127
|
+
indexed_radio.setChecked(True)
|
|
126
128
|
else:
|
|
127
|
-
|
|
129
|
+
all_radio.setChecked(True)
|
|
128
130
|
else:
|
|
129
|
-
|
|
131
|
+
all_radio.setChecked(True)
|
|
130
132
|
self.toggle_display_filter('all')
|
|
131
133
|
|
|
132
|
-
# restore filters labels
|
|
133
134
|
self.restore_filters_labels()
|
|
134
135
|
|
|
135
136
|
def restore_filters_labels(self):
|
|
@@ -145,17 +146,16 @@ class Common:
|
|
|
145
146
|
|
|
146
147
|
:param filter: Filter
|
|
147
148
|
"""
|
|
148
|
-
filters = {}
|
|
149
149
|
if filter == 'pinned':
|
|
150
|
-
filters
|
|
151
|
-
"mode": "=",
|
|
152
|
-
"value": 1,
|
|
150
|
+
filters = {
|
|
151
|
+
'is_important': {"mode": "=", "value": 1}
|
|
153
152
|
}
|
|
154
153
|
elif filter == 'indexed':
|
|
155
|
-
filters
|
|
156
|
-
"mode": ">",
|
|
157
|
-
"value": 0,
|
|
154
|
+
filters = {
|
|
155
|
+
'indexed_ts': {"mode": ">", "value": 0}
|
|
158
156
|
}
|
|
157
|
+
else:
|
|
158
|
+
filters = {}
|
|
159
159
|
|
|
160
160
|
self.window.core.config.set("ctx.records.filter", filter)
|
|
161
161
|
self.window.core.ctx.clear_tmp_meta()
|
|
@@ -168,7 +168,7 @@ class Common:
|
|
|
168
168
|
|
|
169
169
|
:param id: context list idx
|
|
170
170
|
"""
|
|
171
|
-
value = "@"
|
|
171
|
+
value = f"@{id}"
|
|
172
172
|
self.window.controller.chat.common.append_to_input(value, separator=" ")
|
|
173
173
|
QApplication.clipboard().setText(value)
|
|
174
174
|
|