pygpt-net 2.6.45__py3-none-any.whl → 2.6.46__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 +7 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +0 -5
- pygpt_net/controller/debug/debug.py +11 -9
- pygpt_net/controller/dialogs/debug.py +40 -29
- pygpt_net/core/debug/agent.py +19 -14
- pygpt_net/core/debug/assistants.py +22 -24
- pygpt_net/core/debug/attachments.py +11 -7
- pygpt_net/core/debug/config.py +22 -23
- pygpt_net/core/debug/context.py +63 -63
- pygpt_net/core/debug/db.py +1 -4
- pygpt_net/core/debug/events.py +14 -11
- pygpt_net/core/debug/indexes.py +41 -76
- pygpt_net/core/debug/kernel.py +11 -8
- pygpt_net/core/debug/models.py +20 -15
- pygpt_net/core/debug/plugins.py +9 -6
- pygpt_net/core/debug/presets.py +16 -11
- pygpt_net/core/debug/tabs.py +28 -22
- pygpt_net/core/debug/ui.py +25 -22
- pygpt_net/core/render/web/renderer.py +3 -2
- pygpt_net/core/tabs/tab.py +14 -1
- pygpt_net/data/config/config.json +3 -3
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/config/settings.json +15 -17
- pygpt_net/data/css/style.dark.css +6 -0
- pygpt_net/data/css/web-blocks.css +4 -0
- pygpt_net/data/css/web-blocks.light.css +1 -1
- pygpt_net/data/css/web-chatgpt.css +4 -0
- pygpt_net/data/css/web-chatgpt.light.css +1 -1
- pygpt_net/data/css/web-chatgpt_wide.css +4 -0
- pygpt_net/data/css/web-chatgpt_wide.light.css +1 -1
- pygpt_net/data/js/app.js +720 -636
- pygpt_net/data/locale/locale.de.ini +1 -1
- pygpt_net/data/locale/locale.en.ini +1 -1
- pygpt_net/data/locale/locale.es.ini +1 -1
- pygpt_net/data/locale/locale.fr.ini +1 -1
- pygpt_net/data/locale/locale.it.ini +1 -1
- pygpt_net/data/locale/locale.pl.ini +2 -2
- pygpt_net/data/locale/locale.uk.ini +1 -1
- pygpt_net/data/locale/locale.zh.ini +1 -1
- pygpt_net/item/model.py +4 -1
- pygpt_net/js_rc.py +12824 -12612
- pygpt_net/provider/api/anthropic/__init__.py +3 -1
- pygpt_net/provider/api/anthropic/tools.py +1 -1
- pygpt_net/provider/api/google/__init__.py +7 -1
- pygpt_net/provider/api/x_ai/__init__.py +5 -1
- pygpt_net/provider/core/config/patch.py +14 -1
- pygpt_net/provider/llms/anthropic.py +37 -5
- pygpt_net/provider/llms/azure_openai.py +3 -1
- pygpt_net/provider/llms/base.py +13 -1
- pygpt_net/provider/llms/deepseek_api.py +13 -3
- pygpt_net/provider/llms/google.py +14 -1
- pygpt_net/provider/llms/hugging_face_api.py +105 -24
- pygpt_net/provider/llms/hugging_face_embedding.py +88 -0
- pygpt_net/provider/llms/hugging_face_router.py +28 -16
- pygpt_net/provider/llms/local.py +2 -0
- pygpt_net/provider/llms/mistral.py +60 -3
- pygpt_net/provider/llms/open_router.py +4 -2
- pygpt_net/provider/llms/openai.py +4 -1
- pygpt_net/provider/llms/perplexity.py +66 -5
- pygpt_net/provider/llms/utils.py +39 -0
- pygpt_net/provider/llms/voyage.py +50 -0
- pygpt_net/provider/llms/x_ai.py +70 -10
- pygpt_net/ui/widget/lists/db.py +1 -0
- pygpt_net/ui/widget/lists/debug.py +1 -0
- pygpt_net/ui/widget/tabs/body.py +12 -1
- {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.46.dist-info}/METADATA +11 -4
- {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.46.dist-info}/RECORD +71 -68
- {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.46.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.46.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.46.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
2.6.46 (2025-09-15)
|
|
2
|
+
|
|
3
|
+
- Added: Global proxy settings for all API SDKs.
|
|
4
|
+
- Fixed: xAI client configuration in Chat with Files.
|
|
5
|
+
- Fixed: Top margin in streaming container.
|
|
6
|
+
- Refactored: Debug workers.
|
|
7
|
+
|
|
1
8
|
2.6.45 (2025-09-13)
|
|
2
9
|
|
|
3
10
|
- Improved: Parsing of custom markup in the stream.
|
pygpt_net/__init__.py
CHANGED
|
@@ -6,15 +6,15 @@
|
|
|
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.09.
|
|
9
|
+
# Updated Date: 2025.09.15 00:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
__author__ = "Marcin Szczygliński"
|
|
13
13
|
__copyright__ = "Copyright 2025, Marcin Szczygliński"
|
|
14
14
|
__credits__ = ["Marcin Szczygliński"]
|
|
15
15
|
__license__ = "MIT"
|
|
16
|
-
__version__ = "2.6.
|
|
17
|
-
__build__ = "2025-09-
|
|
16
|
+
__version__ = "2.6.46"
|
|
17
|
+
__build__ = "2025-09-15"
|
|
18
18
|
__maintainer__ = "Marcin Szczygliński"
|
|
19
19
|
__github__ = "https://github.com/szczyglis-dev/py-gpt"
|
|
20
20
|
__report__ = "https://github.com/szczyglis-dev/py-gpt/issues"
|
pygpt_net/app.py
CHANGED
|
@@ -35,11 +35,6 @@ os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = (
|
|
|
35
35
|
"--js-flags=--expose-gc"
|
|
36
36
|
)
|
|
37
37
|
"""
|
|
38
|
-
# by default, optimize for low-end devices
|
|
39
|
-
os.environ.setdefault(
|
|
40
|
-
"QTWEBENGINE_CHROMIUM_FLAGS",
|
|
41
|
-
"--enable-low-end-device-mode"
|
|
42
|
-
)
|
|
43
38
|
|
|
44
39
|
_original_open = builtins.open
|
|
45
40
|
|
|
@@ -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.09.
|
|
9
|
+
# Updated Date: 2025.09.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from datetime import datetime
|
|
@@ -84,18 +84,19 @@ class Debug(QObject):
|
|
|
84
84
|
return
|
|
85
85
|
|
|
86
86
|
print("[LOGGER] Changing log level to: " + level)
|
|
87
|
+
debug = self.window.core.debug
|
|
87
88
|
|
|
88
89
|
if level == 'debug':
|
|
89
|
-
|
|
90
|
+
debug.switch_log_level(DEBUG)
|
|
90
91
|
print("** DEBUG level enabled")
|
|
91
92
|
elif level == 'info':
|
|
92
|
-
|
|
93
|
+
debug.switch_log_level(INFO)
|
|
93
94
|
print("** INFO level enabled")
|
|
94
95
|
elif level == 'warning':
|
|
95
|
-
|
|
96
|
+
debug.switch_log_level(WARNING)
|
|
96
97
|
print("** WARNING level enabled")
|
|
97
98
|
else:
|
|
98
|
-
|
|
99
|
+
debug.switch_log_level(ERROR)
|
|
99
100
|
print("** ERROR level enabled")
|
|
100
101
|
|
|
101
102
|
self.window.ui.dialogs.app_log.update_log_level()
|
|
@@ -106,11 +107,12 @@ class Debug(QObject):
|
|
|
106
107
|
|
|
107
108
|
:param all: update all debug windows
|
|
108
109
|
"""
|
|
110
|
+
dialog = self.window.controller.dialogs.debug
|
|
109
111
|
if self._ids is None:
|
|
110
|
-
self._ids =
|
|
112
|
+
self._ids = dialog.get_ids()
|
|
111
113
|
for id in self._ids:
|
|
112
|
-
if
|
|
113
|
-
|
|
114
|
+
if dialog.is_active(id):
|
|
115
|
+
dialog.update_worker(id)
|
|
114
116
|
|
|
115
117
|
def post_setup(self):
|
|
116
118
|
"""Post setup debug"""
|
|
@@ -239,7 +241,7 @@ class Debug(QObject):
|
|
|
239
241
|
self.window.core.tabs.toggle_debug(False)
|
|
240
242
|
else:
|
|
241
243
|
if id == "db":
|
|
242
|
-
self.window.ui.dialogs.database.viewer.update_table_view() # update view on load
|
|
244
|
+
self.window.ui.dialogs.database.viewer.update_table_view(force=True) # update view on load
|
|
243
245
|
elif id == "tabs":
|
|
244
246
|
self.window.core.tabs.toggle_debug(True)
|
|
245
247
|
self.window.controller.dialogs.debug.show(id)
|
|
@@ -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:
|
|
9
|
+
# Updated Date: 2025.09.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from typing import Any
|
|
@@ -31,6 +31,7 @@ from pygpt_net.core.debug.ui import UIDebug
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class Debug:
|
|
34
|
+
|
|
34
35
|
DBG_KEY, DBG_VALUE = range(2)
|
|
35
36
|
|
|
36
37
|
def __init__(self, window=None):
|
|
@@ -42,21 +43,22 @@ class Debug:
|
|
|
42
43
|
self.window = window
|
|
43
44
|
|
|
44
45
|
# setup workers
|
|
45
|
-
self.workers = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
self.workers = {
|
|
47
|
+
'agent': AgentDebug(self.window),
|
|
48
|
+
'assistants': AssistantsDebug(self.window),
|
|
49
|
+
'attachments': AttachmentsDebug(self.window),
|
|
50
|
+
'config': ConfigDebug(self.window),
|
|
51
|
+
'context': ContextDebug(self.window),
|
|
52
|
+
'db': DatabaseDebug(self.window),
|
|
53
|
+
'events': EventsDebug(self.window),
|
|
54
|
+
'indexes': IndexesDebug(self.window),
|
|
55
|
+
'kernel': KernelDebug(self.window),
|
|
56
|
+
'models': ModelsDebug(self.window),
|
|
57
|
+
'plugins': PluginsDebug(self.window),
|
|
58
|
+
'presets': PresetsDebug(self.window),
|
|
59
|
+
'tabs': TabsDebug(self.window),
|
|
60
|
+
'ui': UIDebug(self.window)
|
|
61
|
+
}
|
|
60
62
|
|
|
61
63
|
# prepare debug ids
|
|
62
64
|
self.ids = self.workers.keys()
|
|
@@ -79,12 +81,16 @@ class Debug:
|
|
|
79
81
|
|
|
80
82
|
:param id: debug id
|
|
81
83
|
"""
|
|
82
|
-
self.
|
|
83
|
-
self.
|
|
84
|
+
model = self.models.get(id, None)
|
|
85
|
+
dialog = self.window.ui.debug[id]
|
|
86
|
+
dialog.setModel(model)
|
|
87
|
+
model.dataChanged.connect(dialog.on_data_begin)
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
dialog.setUpdatesEnabled(False)
|
|
90
|
+
if id not in self.counters or self.counters[id] != model.rowCount():
|
|
91
|
+
model.removeRows(0, model.rowCount())
|
|
87
92
|
self.initialized[id] = False
|
|
93
|
+
dialog.setUpdatesEnabled(True)
|
|
88
94
|
self.idx[id] = 0
|
|
89
95
|
|
|
90
96
|
def end(self, id: str):
|
|
@@ -105,18 +111,23 @@ class Debug:
|
|
|
105
111
|
:param k: key
|
|
106
112
|
:param v: value
|
|
107
113
|
"""
|
|
114
|
+
dialog = self.window.ui.debug[id]
|
|
115
|
+
dialog.setUpdatesEnabled(False)
|
|
116
|
+
model = self.models.get(id, None)
|
|
108
117
|
if self.initialized[id] is False:
|
|
109
|
-
idx =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
idx = model.rowCount()
|
|
119
|
+
model.insertRow(idx)
|
|
120
|
+
model.setData(model.index(idx, self.DBG_KEY), k)
|
|
121
|
+
model.setData(model.index(idx, self.DBG_VALUE), v)
|
|
113
122
|
else:
|
|
114
|
-
for idx in range(0,
|
|
115
|
-
if
|
|
116
|
-
|
|
123
|
+
for idx in range(0, model.rowCount()):
|
|
124
|
+
if model.index(idx, self.DBG_KEY).data() == k:
|
|
125
|
+
model.setData(model.index(idx, self.DBG_VALUE), v)
|
|
117
126
|
self.idx[id] += 1
|
|
127
|
+
dialog.setUpdatesEnabled(True)
|
|
118
128
|
return
|
|
119
129
|
self.idx[id] += 1
|
|
130
|
+
dialog.setUpdatesEnabled(True)
|
|
120
131
|
|
|
121
132
|
def get_ids(self) -> list:
|
|
122
133
|
"""
|
|
@@ -163,7 +174,7 @@ class Debug:
|
|
|
163
174
|
if id not in self.active:
|
|
164
175
|
return
|
|
165
176
|
self.active[id] = True
|
|
166
|
-
self.window.ui.dialogs.open(
|
|
177
|
+
self.window.ui.dialogs.open(f"debug.{id}", width=800, height=600)
|
|
167
178
|
|
|
168
179
|
def hide(self, id: str):
|
|
169
180
|
"""
|
|
@@ -174,7 +185,7 @@ class Debug:
|
|
|
174
185
|
if id not in self.active:
|
|
175
186
|
return
|
|
176
187
|
self.active[id] = False
|
|
177
|
-
self.window.ui.dialogs.close(
|
|
188
|
+
self.window.ui.dialogs.close(f"debug.{id}")
|
|
178
189
|
|
|
179
190
|
def create_model(self, parent) -> QStandardItemModel:
|
|
180
191
|
"""
|
pygpt_net/core/debug/agent.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:
|
|
9
|
+
# Updated Date: 2025.09.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
class AgentDebug:
|
|
@@ -21,17 +21,22 @@ class AgentDebug:
|
|
|
21
21
|
|
|
22
22
|
def update(self):
|
|
23
23
|
"""Update debug window"""
|
|
24
|
-
self.window.core.debug
|
|
25
|
-
self.window.core.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
self.window.core.
|
|
29
|
-
self.window.core.debug.add(self.id, 'iteration', str(self.window.controller.agent.legacy.iteration))
|
|
30
|
-
self.window.core.debug.add(self.id, 'limit', str(self.window.core.config.get("agent.iterations")))
|
|
31
|
-
self.window.core.debug.add(self.id, 'prev_output', str(self.window.controller.agent.legacy.prev_output))
|
|
32
|
-
self.window.core.debug.add(self.id, 'is_user', str(self.window.controller.agent.legacy.is_user))
|
|
33
|
-
self.window.core.debug.add(self.id, 'stop', str(self.window.controller.agent.legacy.stop))
|
|
34
|
-
self.window.core.debug.add(self.id, 'finished', str(self.window.controller.agent.legacy.finished))
|
|
35
|
-
self.window.core.debug.add(self.id, 'allowed_cmds', str(self.window.controller.agent.legacy.allowed_cmds))
|
|
24
|
+
debug = self.window.core.debug
|
|
25
|
+
agents_provider = self.window.core.agents.provider
|
|
26
|
+
agent_controller = self.window.controller.agent
|
|
27
|
+
agent_legacy = agent_controller.legacy
|
|
28
|
+
agent_config = self.window.core.config
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
debug.begin(self.id)
|
|
31
|
+
debug.add(self.id, '[Llama-index]', '')
|
|
32
|
+
debug.add(self.id, 'agents', str(agents_provider.get_ids()))
|
|
33
|
+
debug.add(self.id, 'eval_step', str(agent_controller.llama.eval_step))
|
|
34
|
+
debug.add(self.id, '[LEGACY]', '')
|
|
35
|
+
debug.add(self.id, 'iteration', str(agent_legacy.iteration))
|
|
36
|
+
debug.add(self.id, 'limit', str(agent_config.get("agent.iterations")))
|
|
37
|
+
debug.add(self.id, 'prev_output', str(agent_legacy.prev_output))
|
|
38
|
+
debug.add(self.id, 'is_user', str(agent_legacy.is_user))
|
|
39
|
+
debug.add(self.id, 'stop', str(agent_legacy.stop))
|
|
40
|
+
debug.add(self.id, 'finished', str(agent_legacy.finished))
|
|
41
|
+
debug.add(self.id, 'allowed_cmds', str(agent_legacy.allowed_cmds))
|
|
42
|
+
debug.end(self.id)
|
|
@@ -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:
|
|
9
|
+
# Updated Date: 2025.09.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
class AssistantsDebug:
|
|
@@ -21,24 +21,24 @@ class AssistantsDebug:
|
|
|
21
21
|
|
|
22
22
|
def update(self):
|
|
23
23
|
"""Update debug window."""
|
|
24
|
-
self.window.core.debug
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
debug = self.window.core.debug
|
|
25
|
+
assistant_threads = self.window.controller.assistant.threads
|
|
26
|
+
assistant_editor = self.window.controller.assistant.editor
|
|
27
|
+
assistants_core = self.window.core.assistants
|
|
28
|
+
assistants_store = assistants_core.store
|
|
29
|
+
|
|
30
|
+
debug.begin(self.id)
|
|
31
|
+
debug.add(self.id, '(thread) started', str(assistant_threads.started))
|
|
32
|
+
debug.add(self.id, '(thread) stop', str(assistant_threads.stop))
|
|
33
|
+
debug.add(self.id, '(thread) run_id', str(assistant_threads.run_id))
|
|
34
|
+
debug.add(self.id, '(thread) tool_calls', str(assistant_threads.tool_calls))
|
|
35
|
+
debug.add(self.id, 'Options', str(assistant_editor.get_options()))
|
|
36
|
+
debug.add(self.id, '----', '')
|
|
37
37
|
|
|
38
38
|
# assistants
|
|
39
|
-
assistants =
|
|
39
|
+
assistants = assistants_core.get_all()
|
|
40
40
|
for key in list(assistants):
|
|
41
|
-
prefix = "[{}] "
|
|
41
|
+
prefix = f"[{key}] "
|
|
42
42
|
assistant = assistants[key]
|
|
43
43
|
data = {
|
|
44
44
|
'id': assistant.id,
|
|
@@ -51,15 +51,13 @@ class AssistantsDebug:
|
|
|
51
51
|
'files': assistant.files,
|
|
52
52
|
'tools[function]': assistant.tools['function']
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
debug.add(self.id, str(assistant.name), str(data))
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
debug.add(self.id, '----', '')
|
|
57
57
|
|
|
58
58
|
store_items = {}
|
|
59
|
-
for id in
|
|
60
|
-
store_items[id] =
|
|
61
|
-
|
|
62
|
-
self.window.core.debug.add(self.id, 'Store (items)', str(store_items))
|
|
63
|
-
#self.window.core.debug.add(self.id, 'Store (items)', str(self.window.core.assistants.store.items))
|
|
59
|
+
for id in assistants_store.items:
|
|
60
|
+
store_items[id] = assistants_store.items[id].to_dict()
|
|
64
61
|
|
|
65
|
-
|
|
62
|
+
debug.add(self.id, 'Store (items)', str(store_items))
|
|
63
|
+
debug.end(self.id)
|
|
@@ -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:
|
|
9
|
+
# Updated Date: 2025.09.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
class AttachmentsDebug:
|
|
@@ -21,11 +21,15 @@ class AttachmentsDebug:
|
|
|
21
21
|
|
|
22
22
|
def update(self):
|
|
23
23
|
"""Update debug window."""
|
|
24
|
-
self.window.core.debug
|
|
24
|
+
debug = self.window.core.debug
|
|
25
|
+
modes = self.window.core.modes
|
|
26
|
+
attachments_core = self.window.core.attachments
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
debug.begin(self.id)
|
|
29
|
+
|
|
30
|
+
for mode in modes.all:
|
|
31
|
+
debug.add(self.id, f'[{mode}]', '')
|
|
32
|
+
attachments = attachments_core.get_all(mode)
|
|
29
33
|
for key in list(attachments):
|
|
30
34
|
attachment = attachments[key]
|
|
31
35
|
data = {
|
|
@@ -40,6 +44,6 @@ class AttachmentsDebug:
|
|
|
40
44
|
'consumed': attachment.consumed,
|
|
41
45
|
'extra': attachment.extra,
|
|
42
46
|
}
|
|
43
|
-
|
|
47
|
+
debug.add(self.id, attachment.name, str(data))
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
debug.end(self.id)
|
pygpt_net/core/debug/config.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:
|
|
9
|
+
# Updated Date: 2025.09.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import os
|
|
@@ -26,29 +26,28 @@ class ConfigDebug:
|
|
|
26
26
|
|
|
27
27
|
def update(self):
|
|
28
28
|
"""Update debug window."""
|
|
29
|
-
self.window.core.debug
|
|
30
|
-
|
|
29
|
+
debug = self.window.core.debug
|
|
30
|
+
config = self.window.core.config
|
|
31
|
+
profile = config.profile
|
|
32
|
+
settings_editor = self.window.controller.settings.editor
|
|
31
33
|
app_fonts = QFontDatabase.families()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
self.id, 'Options',
|
|
47
|
-
str(self.window.controller.settings.editor.get_options())
|
|
48
|
-
)
|
|
34
|
+
|
|
35
|
+
debug.begin(self.id)
|
|
36
|
+
|
|
37
|
+
path = os.path.join(config.path, '', 'config.json')
|
|
38
|
+
debug.add(self.id, 'Config File', str(path))
|
|
39
|
+
debug.add(self.id, 'Current workdir', str(config.get_user_path()))
|
|
40
|
+
debug.add(self.id, 'Base workdir', str(config.get_base_workdir()))
|
|
41
|
+
debug.add(self.id, 'Workdir config', str(os.path.join(config.get_base_workdir(), "path.cfg")))
|
|
42
|
+
debug.add(self.id, 'App dir', str(config.get_app_path()))
|
|
43
|
+
debug.add(self.id, 'Profile [current]', str(profile.get_current()))
|
|
44
|
+
debug.add(self.id, 'Profile [all]', str(profile.get_all()))
|
|
45
|
+
debug.add(self.id, 'Registered fonts', str(app_fonts))
|
|
46
|
+
debug.add(self.id, 'Sections', str(settings_editor.get_sections()))
|
|
47
|
+
debug.add(self.id, 'Options', str(settings_editor.get_options()))
|
|
49
48
|
|
|
50
49
|
# config data
|
|
51
|
-
for key in
|
|
52
|
-
|
|
50
|
+
for key in config.all():
|
|
51
|
+
debug.add(self.id, key, str(config.get(key)))
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
debug.end(self.id)
|
pygpt_net/core/debug/context.py
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
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.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
|
+
|
|
11
12
|
import json
|
|
12
13
|
|
|
13
14
|
|
|
@@ -23,68 +24,67 @@ class ContextDebug:
|
|
|
23
24
|
|
|
24
25
|
def update(self):
|
|
25
26
|
"""Update debug window"""
|
|
26
|
-
self.window.core.debug
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
self.window.core.debug.end(self.id)
|
|
27
|
+
debug = self.window.core.debug
|
|
28
|
+
bridge = self.window.core.bridge
|
|
29
|
+
controller = self.window.controller
|
|
30
|
+
ctx_core = self.window.core.ctx
|
|
31
|
+
attachments = self.window.core.attachments.context
|
|
32
|
+
kernel_stack = controller.kernel.stack
|
|
33
|
+
|
|
34
|
+
debug.begin(self.id)
|
|
35
|
+
|
|
36
|
+
last_context = bridge.last_context
|
|
37
|
+
last_context_quick = bridge.last_context_quick
|
|
38
|
+
current_stack = kernel_stack.current
|
|
39
|
+
|
|
40
|
+
debug.add(self.id, 'bridge (last call)', str(last_context.to_dict()) if last_context is not None else '---')
|
|
41
|
+
debug.add(self.id, 'bridge (last quick call)',
|
|
42
|
+
str(last_context_quick.to_dict()) if last_context_quick is not None else '---')
|
|
43
|
+
debug.add(self.id, 'reply (queue)', str(current_stack.to_dict()) if current_stack is not None else '---')
|
|
44
|
+
|
|
45
|
+
debug.add(self.id, 'reply (locked)', str(kernel_stack.locked))
|
|
46
|
+
debug.add(self.id, 'reply (processed)', str(kernel_stack.processed))
|
|
47
|
+
debug.add(self.id, 'current (id)', str(ctx_core.get_current()))
|
|
48
|
+
debug.add(self.id, 'len(meta)', len(ctx_core.meta))
|
|
49
|
+
debug.add(self.id, 'len(items)', len(ctx_core.get_items()))
|
|
50
|
+
debug.add(self.id, 'SYS PROMPT (current)', str(ctx_core.current_sys_prompt))
|
|
51
|
+
debug.add(self.id, 'CMD (current)', str(ctx_core.current_cmd))
|
|
52
|
+
debug.add(self.id, 'CMD schema (current)', str(ctx_core.current_cmd_schema))
|
|
53
|
+
debug.add(self.id, 'FUNCTIONS (current)', str(self.get_functions()))
|
|
54
|
+
debug.add(self.id, 'Attachments: last used content', str(attachments.last_used_content))
|
|
55
|
+
debug.add(self.id, 'Attachments: last used context', str(attachments.last_used_context))
|
|
56
|
+
|
|
57
|
+
current_id = ctx_core.get_current()
|
|
58
|
+
current = ctx_core.meta.get(current_id)
|
|
59
|
+
|
|
60
|
+
if current is not None:
|
|
61
|
+
debug.add(self.id, '*** (current)', str(current.to_dict()))
|
|
62
|
+
|
|
63
|
+
tmp_meta = ctx_core.get_tmp_meta()
|
|
64
|
+
if tmp_meta is not None:
|
|
65
|
+
debug.add(self.id, 'tmp meta', str(tmp_meta.to_dict()))
|
|
66
|
+
|
|
67
|
+
debug.add(self.id, 'selected[]', str(controller.ctx.selected))
|
|
68
|
+
debug.add(self.id, 'group_id (active)', str(controller.ctx.group_id))
|
|
69
|
+
debug.add(self.id, 'assistant', str(ctx_core.get_assistant()))
|
|
70
|
+
debug.add(self.id, 'mode', str(ctx_core.get_mode()))
|
|
71
|
+
debug.add(self.id, 'model', str(ctx_core.get_model()))
|
|
72
|
+
debug.add(self.id, 'preset', str(ctx_core.get_preset()))
|
|
73
|
+
debug.add(self.id, 'run', str(ctx_core.get_run()))
|
|
74
|
+
debug.add(self.id, 'status', str(ctx_core.get_status()))
|
|
75
|
+
debug.add(self.id, 'thread', str(ctx_core.get_thread()))
|
|
76
|
+
debug.add(self.id, 'last_mode', str(ctx_core.get_last_mode()))
|
|
77
|
+
debug.add(self.id, 'last_model', str(ctx_core.get_last_model()))
|
|
78
|
+
debug.add(self.id, 'search_string', str(ctx_core.get_search_string()))
|
|
79
|
+
debug.add(self.id, 'filters', str(ctx_core.filters))
|
|
80
|
+
debug.add(self.id, 'filters_labels', str(ctx_core.filters_labels))
|
|
81
|
+
debug.add(self.id, 'allowed_modes', str(ctx_core.allowed_modes))
|
|
82
|
+
|
|
83
|
+
debug.add(self.id, 'items[]', '')
|
|
84
|
+
for i, item in enumerate(ctx_core.get_items()):
|
|
85
|
+
debug.add(self.id, str(item.id), str(item.to_dict()))
|
|
86
|
+
|
|
87
|
+
debug.end(self.id)
|
|
88
88
|
|
|
89
89
|
def get_functions(self) -> list:
|
|
90
90
|
"""
|
pygpt_net/core/debug/db.py
CHANGED
|
@@ -6,12 +6,9 @@
|
|
|
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.09.14 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
|
-
import datetime
|
|
13
|
-
import os
|
|
14
|
-
|
|
15
12
|
|
|
16
13
|
class DatabaseDebug:
|
|
17
14
|
def __init__(self, window=None):
|