pygpt-net 2.6.43__py3-none-any.whl → 2.6.44__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 +8 -0
- pygpt_net/__init__.py +1 -1
- pygpt_net/controller/debug/debug.py +7 -19
- pygpt_net/controller/debug/fixtures.py +103 -0
- pygpt_net/core/debug/debug.py +2 -2
- pygpt_net/core/fixtures/stream/__init__.py +0 -0
- pygpt_net/{provider/api/fake → core/fixtures/stream}/generator.py +1 -1
- pygpt_net/core/render/web/body.py +5 -1
- pygpt_net/data/config/config.json +9 -5
- pygpt_net/data/config/models.json +2 -2
- pygpt_net/data/config/settings.json +59 -19
- pygpt_net/data/js/app.js +727 -361
- pygpt_net/data/locale/locale.en.ini +8 -1
- pygpt_net/js_rc.py +11506 -10502
- pygpt_net/provider/api/openai/__init__.py +4 -12
- pygpt_net/provider/core/config/patch.py +14 -1
- pygpt_net/ui/base/context_menu.py +3 -2
- pygpt_net/ui/layout/ctx/ctx_list.py +3 -3
- pygpt_net/ui/menu/debug.py +36 -23
- pygpt_net/ui/widget/lists/context.py +233 -51
- {pygpt_net-2.6.43.dist-info → pygpt_net-2.6.44.dist-info}/METADATA +10 -2
- {pygpt_net-2.6.43.dist-info → pygpt_net-2.6.44.dist-info}/RECORD +26 -24
- /pygpt_net/{provider/api/fake/__init__.py → core/fixtures/__init__} +0 -0
- {pygpt_net-2.6.43.dist-info → pygpt_net-2.6.44.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.43.dist-info → pygpt_net-2.6.44.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.43.dist-info → pygpt_net-2.6.44.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
2.6.44 (2025-09-12)
|
|
2
|
+
|
|
3
|
+
- Added: Auto-collapse for large user input blocks.
|
|
4
|
+
- Added: Configuration for syntax highlighting intervals.
|
|
5
|
+
- Improved: Visibility of label icons.
|
|
6
|
+
- Improved: Scrolling of code blocks.
|
|
7
|
+
- Fixed: Parsing of quotes in custom markdown blocks.
|
|
8
|
+
|
|
1
9
|
2.6.43 (2025-09-12)
|
|
2
10
|
|
|
3
11
|
- Fixed: preset restoration when switching profiles.
|
pygpt_net/__init__.py
CHANGED
|
@@ -13,7 +13,7 @@ __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.
|
|
16
|
+
__version__ = "2.6.44"
|
|
17
17
|
__build__ = "2025-09-12"
|
|
18
18
|
__maintainer__ = "Marcin Szczygliński"
|
|
19
19
|
__github__ = "https://github.com/szczyglis-dev/py-gpt"
|
|
@@ -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.12 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from datetime import datetime
|
|
@@ -18,6 +18,8 @@ from PySide6.QtGui import QTextCursor
|
|
|
18
18
|
|
|
19
19
|
from pygpt_net.core.events import RenderEvent
|
|
20
20
|
|
|
21
|
+
from .fixtures import Fixtures
|
|
22
|
+
|
|
21
23
|
|
|
22
24
|
class Debug(QObject):
|
|
23
25
|
def __init__(self, window=None):
|
|
@@ -28,6 +30,7 @@ class Debug(QObject):
|
|
|
28
30
|
"""
|
|
29
31
|
super(Debug, self).__init__()
|
|
30
32
|
self.window = window
|
|
33
|
+
self.fixtures = Fixtures(window)
|
|
31
34
|
self.is_logger = False # logger window opened
|
|
32
35
|
self.is_app_log = False # app log window opened
|
|
33
36
|
self.is_fake_stream = False # fake stream enabled
|
|
@@ -37,6 +40,7 @@ class Debug(QObject):
|
|
|
37
40
|
def update(self):
|
|
38
41
|
"""Update debug"""
|
|
39
42
|
self.update_menu()
|
|
43
|
+
self.fixtures.update()
|
|
40
44
|
|
|
41
45
|
def update_menu(self):
|
|
42
46
|
"""Update debug menu"""
|
|
@@ -127,6 +131,8 @@ class Debug(QObject):
|
|
|
127
131
|
print("[LOGGER] Switching to: " + level)
|
|
128
132
|
self.set_log_level(level)
|
|
129
133
|
|
|
134
|
+
self.fixtures.setup()
|
|
135
|
+
|
|
130
136
|
def connect_signals(self):
|
|
131
137
|
"""Connect signals"""
|
|
132
138
|
# webengine debug signals
|
|
@@ -189,14 +195,6 @@ class Debug(QObject):
|
|
|
189
195
|
cur.insertText("\n")
|
|
190
196
|
self.window.logger.setTextCursor(cur) # Update visible cursor
|
|
191
197
|
|
|
192
|
-
def fake_stream_enabled(self) -> bool:
|
|
193
|
-
"""
|
|
194
|
-
Check if fake stream is enabled
|
|
195
|
-
|
|
196
|
-
:return: True if enabled, False otherwise
|
|
197
|
-
"""
|
|
198
|
-
return self.is_fake_stream
|
|
199
|
-
|
|
200
198
|
def logger_enabled(self) -> bool:
|
|
201
199
|
"""
|
|
202
200
|
Check if debug window is enabled
|
|
@@ -252,16 +250,6 @@ class Debug(QObject):
|
|
|
252
250
|
# update menu
|
|
253
251
|
self.update()
|
|
254
252
|
|
|
255
|
-
def toggle_fake_stream(self):
|
|
256
|
-
"""
|
|
257
|
-
Toggle fake stream debug
|
|
258
|
-
"""
|
|
259
|
-
value = self.window.ui.menu['debug.fake_stream'].isChecked()
|
|
260
|
-
self.is_fake_stream = value
|
|
261
|
-
self.log(f"debug.fake_stream set to {value}")
|
|
262
|
-
# update menu
|
|
263
|
-
self.update()
|
|
264
|
-
|
|
265
253
|
def on_close(self, id: str):
|
|
266
254
|
"""
|
|
267
255
|
Handle debug window close event
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# ================================================== #
|
|
4
|
+
# This file is a part of PYGPT package #
|
|
5
|
+
# Website: https://pygpt.net #
|
|
6
|
+
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
|
+
# MIT License #
|
|
8
|
+
# Created By : Marcin Szczygliński #
|
|
9
|
+
# Updated Date: 2025.09.12 20:00:00 #
|
|
10
|
+
# ================================================== #
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
from typing import Iterable
|
|
14
|
+
|
|
15
|
+
from pygpt_net.core.fixtures.stream.generator import FakeOpenAIStream
|
|
16
|
+
from pygpt_net.item.ctx import CtxItem
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Fixtures:
|
|
20
|
+
def __init__(self, window=None):
|
|
21
|
+
"""
|
|
22
|
+
Fixtures controller
|
|
23
|
+
|
|
24
|
+
:param window: Window instance
|
|
25
|
+
"""
|
|
26
|
+
self.window = window
|
|
27
|
+
self.enabled = {
|
|
28
|
+
"stream": False,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def is_enabled(self, name: str) -> bool:
|
|
32
|
+
"""
|
|
33
|
+
Check if fixture is enabled by name
|
|
34
|
+
|
|
35
|
+
:param name: fixture name
|
|
36
|
+
"""
|
|
37
|
+
return self.enabled.get(name, False)
|
|
38
|
+
|
|
39
|
+
def enable(self, name: str):
|
|
40
|
+
"""
|
|
41
|
+
Enable fixture by name
|
|
42
|
+
|
|
43
|
+
:param name: fixture name
|
|
44
|
+
"""
|
|
45
|
+
if name in self.enabled:
|
|
46
|
+
self.enabled[name] = True
|
|
47
|
+
|
|
48
|
+
def disable(self, name: str):
|
|
49
|
+
"""
|
|
50
|
+
Disable fixture by name
|
|
51
|
+
|
|
52
|
+
:param name: fixture name
|
|
53
|
+
e"""
|
|
54
|
+
if name in self.enabled:
|
|
55
|
+
self.enabled[name] = False
|
|
56
|
+
|
|
57
|
+
def toggle(self, name: str):
|
|
58
|
+
"""
|
|
59
|
+
Toggle fixture by name
|
|
60
|
+
|
|
61
|
+
:param name: fixture name
|
|
62
|
+
"""
|
|
63
|
+
if name in self.enabled:
|
|
64
|
+
self.enabled[name] = not self.enabled[name]
|
|
65
|
+
|
|
66
|
+
def toggle_from_menu(self, name: str):
|
|
67
|
+
"""
|
|
68
|
+
Toggle fake stream debug
|
|
69
|
+
|
|
70
|
+
:param name: fixture name
|
|
71
|
+
"""
|
|
72
|
+
k = f"debug.fixtures.{name}"
|
|
73
|
+
if k not in self.window.ui.menu:
|
|
74
|
+
return
|
|
75
|
+
value = self.window.ui.menu[k].isChecked()
|
|
76
|
+
self.enable("stream") if value else self.disable("stream")
|
|
77
|
+
self.window.controller.debug.update() # update menu
|
|
78
|
+
|
|
79
|
+
def get_stream_generator(self, ctx: CtxItem) -> Iterable:
|
|
80
|
+
"""
|
|
81
|
+
Get fake stream generator
|
|
82
|
+
|
|
83
|
+
:param ctx: context item
|
|
84
|
+
:return: stream generator
|
|
85
|
+
"""
|
|
86
|
+
ctx.use_responses_api = False
|
|
87
|
+
path = os.path.join(self.window.core.config.get_app_path(), "data", "js", "app.js")
|
|
88
|
+
return FakeOpenAIStream(code_path=path).stream(
|
|
89
|
+
api="raw",
|
|
90
|
+
chunk="code",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def setup(self):
|
|
94
|
+
"""Set up fixtures"""
|
|
95
|
+
pass
|
|
96
|
+
|
|
97
|
+
def update(self):
|
|
98
|
+
"""Update fixtures"""
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
def reload(self):
|
|
102
|
+
"""Reload fixtures"""
|
|
103
|
+
pass
|
pygpt_net/core/debug/debug.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: 2025.
|
|
9
|
+
# Updated Date: 2025.09.12 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import gc
|
|
@@ -412,7 +412,7 @@ class Debug:
|
|
|
412
412
|
qobjects = sum(1 for obj in QApplication.allWidgets() if isinstance(obj, QObject))
|
|
413
413
|
stats.append(f"QObjects: {qobjects}")
|
|
414
414
|
|
|
415
|
-
res += "\n
|
|
415
|
+
res += "\n\n".join(stats)
|
|
416
416
|
print("\n".join(stats))
|
|
417
417
|
return res
|
|
418
418
|
|
|
File without changes
|
|
@@ -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.12 20:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import asyncio
|
|
@@ -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.12 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import os
|
|
@@ -447,9 +447,13 @@ class Body:
|
|
|
447
447
|
syntax_style = cfg_get("render.code_syntax") or "default"
|
|
448
448
|
style_js = (
|
|
449
449
|
f'window.CODE_SYNTAX_STYLE={_json_dumps(syntax_style)};'
|
|
450
|
+
f'window.PROFILE_CODE_HL_N_LINE={int(cfg_get("render.code_syntax.stream_n_line", 25))};'
|
|
451
|
+
f'window.PROFILE_CODE_HL_N_CHARS={int(cfg_get("render.code_syntax.stream_n_chars", 5000))};'
|
|
450
452
|
f'window.PROFILE_CODE_STOP_HL_AFTER_LINES={int(cfg_get("render.code_syntax.stream_max_lines", 300))};'
|
|
451
453
|
f'window.PROFILE_CODE_FINAL_HL_MAX_LINES={int(cfg_get("render.code_syntax.final_max_lines", 1500))};'
|
|
452
454
|
f'window.PROFILE_CODE_FINAL_HL_MAX_CHARS={int(cfg_get("render.code_syntax.final_max_chars", 350000))};'
|
|
455
|
+
f'window.DISABLE_SYNTAX_HIGHLIGHT={int(cfg_get("render.code_syntax.disabled", 0))};'
|
|
456
|
+
f'window.USER_MSG_COLLAPSE_HEIGHT_PX={int(cfg_get("render.msg.user.collapse.px", 1500))};'
|
|
453
457
|
)
|
|
454
458
|
|
|
455
459
|
tips_js = f'window.TIPS={tips_json};'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"__meta__": {
|
|
3
|
-
"version": "2.6.
|
|
4
|
-
"app.version": "2.6.
|
|
3
|
+
"version": "2.6.44",
|
|
4
|
+
"app.version": "2.6.44",
|
|
5
5
|
"updated_at": "2025-09-12T00:00:00"
|
|
6
6
|
},
|
|
7
7
|
"access.audio.event.speech": false,
|
|
@@ -429,12 +429,16 @@
|
|
|
429
429
|
"remote_tools.xai.sources.x": true,
|
|
430
430
|
"remote_tools.xai.sources.news": false,
|
|
431
431
|
"render.blocks": true,
|
|
432
|
-
"render.code_syntax": "github-dark",
|
|
433
|
-
"render.code_syntax.
|
|
432
|
+
"render.code_syntax": "github-dark",
|
|
433
|
+
"render.code_syntax.disabled": false,
|
|
434
|
+
"render.code_syntax.final_max_chars": 350000,
|
|
434
435
|
"render.code_syntax.final_max_lines": 1500,
|
|
435
|
-
"render.code_syntax.
|
|
436
|
+
"render.code_syntax.stream_max_lines": 1000,
|
|
437
|
+
"render.code_syntax.stream_n_line": 25,
|
|
438
|
+
"render.code_syntax.stream_n_chars": 5000,
|
|
436
439
|
"render.engine": "web",
|
|
437
440
|
"render.memory.limit": "2.5GB",
|
|
441
|
+
"render.msg.user.collapse.px": 1500,
|
|
438
442
|
"render.open_gl": false,
|
|
439
443
|
"render.plain": false,
|
|
440
444
|
"send_clear": true,
|
|
@@ -593,6 +593,15 @@
|
|
|
593
593
|
"multiplier": 1,
|
|
594
594
|
"step": 1,
|
|
595
595
|
"advanced": false
|
|
596
|
+
},
|
|
597
|
+
"theme.style": {
|
|
598
|
+
"section": "layout",
|
|
599
|
+
"type": "combo",
|
|
600
|
+
"use": "styles",
|
|
601
|
+
"label": "settings.theme.style",
|
|
602
|
+
"description": "settings.render.web.only.desc",
|
|
603
|
+
"value": "chatgpt",
|
|
604
|
+
"advanced": false
|
|
596
605
|
},
|
|
597
606
|
"zoom": {
|
|
598
607
|
"section": "layout",
|
|
@@ -607,15 +616,6 @@
|
|
|
607
616
|
"step": 1,
|
|
608
617
|
"advanced": false
|
|
609
618
|
},
|
|
610
|
-
"theme.style": {
|
|
611
|
-
"section": "layout",
|
|
612
|
-
"type": "combo",
|
|
613
|
-
"use": "styles",
|
|
614
|
-
"label": "settings.theme.style",
|
|
615
|
-
"description": "settings.render.web.only.desc",
|
|
616
|
-
"value": "chatgpt",
|
|
617
|
-
"advanced": false
|
|
618
|
-
},
|
|
619
619
|
"render.code_syntax": {
|
|
620
620
|
"section": "layout",
|
|
621
621
|
"type": "combo",
|
|
@@ -626,6 +626,36 @@
|
|
|
626
626
|
"advanced": false,
|
|
627
627
|
"tab": "code_syntax"
|
|
628
628
|
},
|
|
629
|
+
"render.code_syntax.disabled": {
|
|
630
|
+
"section": "layout",
|
|
631
|
+
"type": "bool",
|
|
632
|
+
"label": "settings.render.code_syntax.disabled",
|
|
633
|
+
"value": false,
|
|
634
|
+
"advanced": false,
|
|
635
|
+
"tab": "code_syntax"
|
|
636
|
+
},
|
|
637
|
+
"render.code_syntax.stream_n_line": {
|
|
638
|
+
"section": "layout",
|
|
639
|
+
"type": "int",
|
|
640
|
+
"min": 0,
|
|
641
|
+
"slider": false,
|
|
642
|
+
"label": "settings.render.code_syntax.stream_n_line",
|
|
643
|
+
"description": "settings.render.code_syntax.stream_n_line.desc",
|
|
644
|
+
"value": 50,
|
|
645
|
+
"advanced": false,
|
|
646
|
+
"tab": "code_syntax"
|
|
647
|
+
},
|
|
648
|
+
"render.code_syntax.stream_n_chars": {
|
|
649
|
+
"section": "layout",
|
|
650
|
+
"type": "int",
|
|
651
|
+
"min": 0,
|
|
652
|
+
"slider": false,
|
|
653
|
+
"label": "settings.render.code_syntax.stream_n_chars",
|
|
654
|
+
"description": "settings.render.code_syntax.stream_n_chars.desc",
|
|
655
|
+
"value": 300,
|
|
656
|
+
"advanced": false,
|
|
657
|
+
"tab": "code_syntax"
|
|
658
|
+
},
|
|
629
659
|
"render.code_syntax.stream_max_lines": {
|
|
630
660
|
"section": "layout",
|
|
631
661
|
"type": "int",
|
|
@@ -721,6 +751,19 @@
|
|
|
721
751
|
"step": 1,
|
|
722
752
|
"advanced": false
|
|
723
753
|
},
|
|
754
|
+
"layout.dpi.factor": {
|
|
755
|
+
"section": "layout",
|
|
756
|
+
"type": "float",
|
|
757
|
+
"slider": true,
|
|
758
|
+
"label": "settings.layout.dpi.factor",
|
|
759
|
+
"description": "settings.restart.required",
|
|
760
|
+
"value": 1.0,
|
|
761
|
+
"min": 1.0,
|
|
762
|
+
"max": 3.0,
|
|
763
|
+
"multiplier": 100,
|
|
764
|
+
"step": 1,
|
|
765
|
+
"advanced": false
|
|
766
|
+
},
|
|
724
767
|
"layout.dpi.scaling": {
|
|
725
768
|
"section": "layout",
|
|
726
769
|
"type": "bool",
|
|
@@ -734,17 +777,14 @@
|
|
|
734
777
|
"step": 1,
|
|
735
778
|
"advanced": false
|
|
736
779
|
},
|
|
737
|
-
"
|
|
780
|
+
"render.msg.user.collapse.px": {
|
|
738
781
|
"section": "layout",
|
|
739
|
-
"type": "
|
|
740
|
-
"
|
|
741
|
-
"
|
|
742
|
-
"
|
|
743
|
-
"
|
|
744
|
-
"
|
|
745
|
-
"max": 3.0,
|
|
746
|
-
"multiplier": 100,
|
|
747
|
-
"step": 1,
|
|
782
|
+
"type": "int",
|
|
783
|
+
"min": 0,
|
|
784
|
+
"slider": false,
|
|
785
|
+
"label": "settings.render.msg.user.collapse.px",
|
|
786
|
+
"description": "settings.render.msg.user.collapse.px.desc",
|
|
787
|
+
"value": 1500,
|
|
748
788
|
"advanced": false
|
|
749
789
|
},
|
|
750
790
|
"layout.tooltips": {
|