pygpt-net 2.6.45__py3-none-any.whl → 2.6.47__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 (77) hide show
  1. pygpt_net/CHANGELOG.txt +12 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/controller/__init__.py +1 -3
  4. pygpt_net/controller/audio/audio.py +2 -0
  5. pygpt_net/controller/chat/text.py +2 -1
  6. pygpt_net/controller/debug/debug.py +11 -9
  7. pygpt_net/controller/dialogs/debug.py +40 -29
  8. pygpt_net/controller/notepad/notepad.py +0 -2
  9. pygpt_net/controller/theme/theme.py +5 -5
  10. pygpt_net/controller/ui/tabs.py +40 -2
  11. pygpt_net/core/debug/agent.py +19 -14
  12. pygpt_net/core/debug/assistants.py +22 -24
  13. pygpt_net/core/debug/attachments.py +11 -7
  14. pygpt_net/core/debug/config.py +22 -23
  15. pygpt_net/core/debug/context.py +63 -63
  16. pygpt_net/core/debug/db.py +1 -4
  17. pygpt_net/core/debug/events.py +14 -11
  18. pygpt_net/core/debug/indexes.py +41 -76
  19. pygpt_net/core/debug/kernel.py +11 -8
  20. pygpt_net/core/debug/models.py +20 -15
  21. pygpt_net/core/debug/plugins.py +9 -6
  22. pygpt_net/core/debug/presets.py +16 -11
  23. pygpt_net/core/debug/tabs.py +28 -22
  24. pygpt_net/core/debug/ui.py +25 -22
  25. pygpt_net/core/render/web/renderer.py +5 -2
  26. pygpt_net/core/tabs/tab.py +16 -3
  27. pygpt_net/data/config/config.json +3 -3
  28. pygpt_net/data/config/models.json +3 -3
  29. pygpt_net/data/config/settings.json +15 -17
  30. pygpt_net/data/css/style.dark.css +6 -0
  31. pygpt_net/data/css/web-blocks.css +4 -0
  32. pygpt_net/data/css/web-blocks.light.css +1 -1
  33. pygpt_net/data/css/web-chatgpt.css +4 -0
  34. pygpt_net/data/css/web-chatgpt.light.css +1 -1
  35. pygpt_net/data/css/web-chatgpt_wide.css +4 -0
  36. pygpt_net/data/css/web-chatgpt_wide.light.css +1 -1
  37. pygpt_net/data/js/app.js +1804 -1688
  38. pygpt_net/data/locale/locale.de.ini +1 -1
  39. pygpt_net/data/locale/locale.en.ini +1 -1
  40. pygpt_net/data/locale/locale.es.ini +1 -1
  41. pygpt_net/data/locale/locale.fr.ini +1 -1
  42. pygpt_net/data/locale/locale.it.ini +1 -1
  43. pygpt_net/data/locale/locale.pl.ini +2 -2
  44. pygpt_net/data/locale/locale.uk.ini +1 -1
  45. pygpt_net/data/locale/locale.zh.ini +1 -1
  46. pygpt_net/item/model.py +4 -1
  47. pygpt_net/js_rc.py +14303 -14540
  48. pygpt_net/provider/api/anthropic/__init__.py +3 -1
  49. pygpt_net/provider/api/anthropic/tools.py +1 -1
  50. pygpt_net/provider/api/google/__init__.py +7 -1
  51. pygpt_net/provider/api/x_ai/__init__.py +5 -1
  52. pygpt_net/provider/core/config/patch.py +14 -1
  53. pygpt_net/provider/llms/anthropic.py +37 -5
  54. pygpt_net/provider/llms/azure_openai.py +3 -1
  55. pygpt_net/provider/llms/base.py +13 -1
  56. pygpt_net/provider/llms/deepseek_api.py +13 -3
  57. pygpt_net/provider/llms/google.py +14 -1
  58. pygpt_net/provider/llms/hugging_face_api.py +105 -24
  59. pygpt_net/provider/llms/hugging_face_embedding.py +88 -0
  60. pygpt_net/provider/llms/hugging_face_router.py +28 -16
  61. pygpt_net/provider/llms/local.py +2 -0
  62. pygpt_net/provider/llms/mistral.py +60 -3
  63. pygpt_net/provider/llms/open_router.py +4 -2
  64. pygpt_net/provider/llms/openai.py +4 -1
  65. pygpt_net/provider/llms/perplexity.py +66 -5
  66. pygpt_net/provider/llms/utils.py +39 -0
  67. pygpt_net/provider/llms/voyage.py +50 -0
  68. pygpt_net/provider/llms/x_ai.py +70 -10
  69. pygpt_net/ui/widget/lists/db.py +1 -0
  70. pygpt_net/ui/widget/lists/debug.py +1 -0
  71. pygpt_net/ui/widget/tabs/body.py +23 -4
  72. pygpt_net/ui/widget/textarea/notepad.py +0 -4
  73. {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.47.dist-info}/METADATA +16 -4
  74. {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.47.dist-info}/RECORD +77 -74
  75. {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.47.dist-info}/LICENSE +0 -0
  76. {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.47.dist-info}/WHEEL +0 -0
  77. {pygpt_net-2.6.45.dist-info → pygpt_net-2.6.47.dist-info}/entry_points.txt +0 -0
@@ -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.07.19 17:00:00 #
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.begin(self.id)
27
- if self.window.core.bridge.last_context is not None:
28
- self.window.core.debug.add(self.id, 'bridge (last call)', str(self.window.core.bridge.last_context.to_dict()))
29
- else:
30
- self.window.core.debug.add(self.id, 'bridge (last call)', '---')
31
- if self.window.core.bridge.last_context_quick is not None:
32
- self.window.core.debug.add(self.id, 'bridge (last quick call)', str(self.window.core.bridge.last_context_quick.to_dict()))
33
- else:
34
- self.window.core.debug.add(self.id, 'bridge (last quick call)', '---')
35
- if self.window.controller.kernel.stack.current is not None:
36
- self.window.core.debug.add(self.id, 'reply (queue)', str(self.window.controller.kernel.stack.current.to_dict()))
37
- else:
38
- self.window.core.debug.add(self.id, 'reply (queue)', '---')
39
- self.window.core.debug.add(self.id, 'reply (locked)', str(self.window.controller.kernel.stack.locked))
40
- self.window.core.debug.add(self.id, 'reply (processed)', str(self.window.controller.kernel.stack.processed))
41
- self.window.core.debug.add(self.id, 'current (id)', str(self.window.core.ctx.get_current()))
42
- self.window.core.debug.add(self.id, 'len(meta)', len(self.window.core.ctx.meta))
43
- self.window.core.debug.add(self.id, 'len(items)', len(self.window.core.ctx.get_items()))
44
- self.window.core.debug.add(self.id, 'SYS PROMPT (current)', str(self.window.core.ctx.current_sys_prompt))
45
- self.window.core.debug.add(self.id, 'CMD (current)', str(self.window.core.ctx.current_cmd))
46
- self.window.core.debug.add(self.id, 'CMD schema (current)', str(self.window.core.ctx.current_cmd_schema))
47
- self.window.core.debug.add(self.id, 'FUNCTIONS (current)', str(self.get_functions()))
48
- self.window.core.debug.add(self.id, 'Attachments: last used content',
49
- str(self.window.core.attachments.context.last_used_content))
50
- self.window.core.debug.add(self.id, 'Attachments: last used context',
51
- str(self.window.core.attachments.context.last_used_context))
52
-
53
- current = None
54
- if self.window.core.ctx.get_current() is not None:
55
- if self.window.core.ctx.get_current() in self.window.core.ctx.meta:
56
- current = self.window.core.ctx.meta[self.window.core.ctx.get_current()]
57
- if current is not None:
58
- data = current.to_dict()
59
- self.window.core.debug.add(self.id, '*** (current)', str(data))
60
-
61
- if self.window.core.ctx.get_tmp_meta() is not None:
62
- self.window.core.debug.add(self.id, 'tmp meta', str(self.window.core.ctx.get_tmp_meta().to_dict()))
63
-
64
- self.window.core.debug.add(self.id, 'selected[]', str(self.window.controller.ctx.selected))
65
- self.window.core.debug.add(self.id, 'group_id (active)', str(self.window.controller.ctx.group_id))
66
- self.window.core.debug.add(self.id, 'assistant', str(self.window.core.ctx.get_assistant()))
67
- self.window.core.debug.add(self.id, 'mode', str(self.window.core.ctx.get_mode()))
68
- self.window.core.debug.add(self.id, 'model', str(self.window.core.ctx.get_model()))
69
- self.window.core.debug.add(self.id, 'preset', str(self.window.core.ctx.get_preset()))
70
- self.window.core.debug.add(self.id, 'run', str(self.window.core.ctx.get_run()))
71
- self.window.core.debug.add(self.id, 'status', str(self.window.core.ctx.get_status()))
72
- self.window.core.debug.add(self.id, 'thread', str(self.window.core.ctx.get_thread()))
73
- self.window.core.debug.add(self.id, 'last_mode', str(self.window.core.ctx.get_last_mode()))
74
- self.window.core.debug.add(self.id, 'last_model', str(self.window.core.ctx.get_last_model()))
75
- self.window.core.debug.add(self.id, 'search_string', str(self.window.core.ctx.get_search_string()))
76
- self.window.core.debug.add(self.id, 'filters', str(self.window.core.ctx.filters))
77
- self.window.core.debug.add(self.id, 'filters_labels', str(self.window.core.ctx.filters_labels))
78
- self.window.core.debug.add(self.id, 'allowed_modes', str(self.window.core.ctx.allowed_modes))
79
-
80
- i = 0
81
- self.window.core.debug.add(self.id, 'items[]', '')
82
- for item in self.window.core.ctx.get_items():
83
- data = item.to_dict()
84
- self.window.core.debug.add(self.id, str(item.id), str(data))
85
- i += 1
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
  """
@@ -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: 2024.03.06 02:00:00 #
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):
@@ -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: 2024.12.14 19:00:00 #
9
+ # Updated Date: 2025.09.14 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.core.events import (
@@ -31,16 +31,19 @@ class EventsDebug:
31
31
 
32
32
  def update(self):
33
33
  """Update debug window."""
34
- self.window.core.debug.begin(self.id)
35
- self.window.core.debug.add(self.id, 'App Events:', str(self.extract_events(AppEvent)))
36
- self.window.core.debug.add(self.id, 'Control Events:', str(self.extract_events(ControlEvent)))
37
- self.window.core.debug.add(self.id, 'Kernel Events:', str(self.extract_events(KernelEvent)))
38
- self.window.core.debug.add(self.id, 'Render Events:', str(self.extract_events(RenderEvent)))
39
- self.window.core.debug.add(self.id, 'Plugin Events:', str(self.extract_events(Event)))
40
- self.window.core.debug.add(self.id, '----', '')
41
- self.window.core.debug.add(self.id, 'Voice Cmds (all):', str(self.window.core.access.voice.commands))
42
- self.window.core.debug.add(self.id, 'Voice Cmds (allowed):', str(self.window.core.access.voice.get_commands()))
43
- self.window.core.debug.end(self.id)
34
+ debug = self.window.core.debug
35
+ access_voice = self.window.core.access.voice
36
+
37
+ debug.begin(self.id)
38
+ debug.add(self.id, 'App Events:', str(self.extract_events(AppEvent)))
39
+ debug.add(self.id, 'Control Events:', str(self.extract_events(ControlEvent)))
40
+ debug.add(self.id, 'Kernel Events:', str(self.extract_events(KernelEvent)))
41
+ debug.add(self.id, 'Render Events:', str(self.extract_events(RenderEvent)))
42
+ debug.add(self.id, 'Plugin Events:', str(self.extract_events(Event)))
43
+ debug.add(self.id, '----', '')
44
+ debug.add(self.id, 'Voice Cmds (all):', str(access_voice.commands))
45
+ debug.add(self.id, 'Voice Cmds (allowed):', str(access_voice.get_commands()))
46
+ debug.end(self.id)
44
47
 
45
48
  def extract_events(self, events: BaseEvent) -> dict:
46
49
  """
@@ -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: 2024.08.25 04:00:00 #
9
+ # Updated Date: 2025.09.14 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import datetime
@@ -24,91 +24,56 @@ class IndexesDebug:
24
24
 
25
25
  def update(self):
26
26
  """Update debug window."""
27
- self.window.core.debug.begin(self.id)
28
- self.window.core.debug.add(self.id, 'Current storage:', str(self.window.core.idx.get_current_store()))
29
- self.window.core.debug.add(self.id, 'Current idx:', str(self.window.controller.idx.current_idx))
30
- self.window.core.debug.add(self.id, 'Current mode:', str(self.window.controller.idx.current_mode))
31
- self.window.core.debug.add(self.id, 'Chat mode:', str(self.window.core.config.get("llama.idx.chat.mode")))
32
- self.window.core.debug.add(self.id, 'Indexes (list):', str(list(self.window.core.config.get("llama.idx.list"))))
27
+ debug = self.window.core.debug
28
+ idx_core = self.window.core.idx
29
+ idx_controller = self.window.controller.idx
30
+ config = self.window.core.config
31
+ storage = idx_core.storage
32
+ indexing = idx_core.indexing
33
+
34
+ debug.begin(self.id)
35
+ debug.add(self.id, 'Current storage:', str(idx_core.get_current_store()))
36
+ debug.add(self.id, 'Current idx:', str(idx_controller.current_idx))
37
+ debug.add(self.id, 'Current mode:', str(idx_controller.current_mode))
38
+ debug.add(self.id, 'Chat mode:', str(config.get("llama.idx.chat.mode")))
39
+ debug.add(self.id, 'Indexes (list):', str(list(config.get("llama.idx.list"))))
33
40
 
34
41
  # count items in DB
35
- db_counter = {}
36
- db_counter["ctx"] = self.window.core.idx.get_counters("ctx")
37
- db_counter["file"] = self.window.core.idx.get_counters("file")
38
- db_counter["external"] = self.window.core.idx.get_counters("external")
42
+ db_counter = {
43
+ "ctx": idx_core.get_counters("ctx"),
44
+ "file": idx_core.get_counters("file"),
45
+ "external": idx_core.get_counters("external")
46
+ }
39
47
 
40
- for store in self.window.core.idx.items:
48
+ for store in idx_core.items:
41
49
  name = "Items (files): " + store
42
- indexes_data = {}
43
- for idx in self.window.core.idx.items[store]:
44
- indexes_data[idx] = len(self.window.core.idx.items[store][idx].items)
45
- if len(indexes_data) > 0:
46
- self.window.core.debug.add(self.id, name, str(indexes_data))
50
+ indexes_data = {idx: len(idx_core.items[store][idx].items)
51
+ for idx in idx_core.items[store]}
52
+ if indexes_data:
53
+ debug.add(self.id, name, str(indexes_data))
47
54
 
48
55
  # DB items counters
49
- self.window.core.debug.add(self.id, 'DB items (ctx):',
50
- str(db_counter["ctx"]))
51
- self.window.core.debug.add(self.id, 'DB items (external/web):',
52
- str(db_counter["external"]))
53
- self.window.core.debug.add(self.id, 'DB items (file):',
54
- str(db_counter["file"]))
56
+ debug.add(self.id, 'DB items (ctx):', str(db_counter["ctx"]))
57
+ debug.add(self.id, 'DB items (external/web):', str(db_counter["external"]))
58
+ debug.add(self.id, 'DB items (file):', str(db_counter["file"]))
55
59
 
56
- self.window.core.debug.add(self.id, 'Storage (storages):',
57
- str(list(self.window.core.idx.storage.storages.keys())))
58
- self.window.core.debug.add(self.id, 'Temp (in-memory) indices:',
59
- str(self.window.core.idx.storage.count_tmp()))
60
+ debug.add(self.id, 'Storage (storages):', str(list(storage.storages.keys())))
61
+ debug.add(self.id, 'Temp (in-memory) indices:', str(storage.count_tmp()))
60
62
 
61
63
  # loaders
62
- self.window.core.debug.add(self.id, 'Offline loaders [files]:',
63
- str(sorted(list(self.window.core.idx.indexing.loaders["file"].keys()))))
64
- self.window.core.debug.add(self.id, 'Offline loaders [web]:',
65
- str(sorted(list(self.window.core.idx.indexing.loaders["web"].keys()))))
66
- self.window.core.debug.add(self.id, 'External instructions [web]:',
67
- str(self.window.core.idx.indexing.external_instructions))
64
+ debug.add(self.id, 'Offline loaders [files]:', str(sorted(list(indexing.loaders["file"].keys()))))
65
+ debug.add(self.id, 'Offline loaders [web]:', str(sorted(list(indexing.loaders["web"].keys()))))
66
+ debug.add(self.id, 'External instructions [web]:', str(indexing.external_instructions))
68
67
 
69
- excluded = self.window.core.config.get("llama.idx.excluded.ext").replace(" ", "").split(',')
70
- self.window.core.debug.add(self.id, 'Excluded (ext):', str(excluded))
71
- self.window.core.debug.add(self.id, 'Force exclude:',
72
- str(self.window.core.config.get("llama.idx.excluded.force")))
73
- self.window.core.debug.add(self.id, 'Custom metadata:',
74
- str(self.window.core.config.get("llama.idx.custom_meta")))
68
+ excluded = config.get("llama.idx.excluded.ext").replace(" ", "").split(',')
69
+ debug.add(self.id, 'Excluded (ext):', str(excluded))
70
+ debug.add(self.id, 'Force exclude:', str(config.get("llama.idx.excluded.force")))
71
+ debug.add(self.id, 'Custom metadata:', str(config.get("llama.idx.custom_meta")))
75
72
 
76
73
  # ctx
77
- self.window.core.debug.add(self.id, 'CTX [auto]:',
78
- str(self.window.core.config.get("llama.idx.auto")))
79
- last_str = "-"
80
- last_ctx = int(self.window.core.config.get("llama.idx.db.last"))
81
- if last_ctx > 0:
82
- last_str = datetime.datetime.fromtimestamp(last_ctx).strftime('%Y-%m-%d %H:%M:%S') + " (" + str(last_ctx) + ")"
83
- self.window.core.debug.add(self.id, 'CTX [db.last]:', str(last_str))
84
-
85
- # indexes
86
- """
87
- indexes = self.window.core.idx.get_all()
88
- for key in list(indexes):
89
- path = os.path.join(self.window.core.config.get_user_dir('idx'), key)
90
- idx = indexes[key]
91
- self.window.core.debug.add(self.id, '----', '')
92
- idx_data = {
93
- 'id': idx.id,
94
- 'store': idx.store,
95
- 'path': path,
96
- 'items': len(idx.items),
97
- }
98
- self.window.core.debug.add(self.id, 'IDX: [' + str(key) + ']', str(idx_data))
99
-
100
- # files
101
- items = idx.items
102
- for item_id in items:
103
- item = items[item_id]
104
- indexed_dt = datetime.datetime.fromtimestamp(item['indexed_ts'])
105
- data = {
106
- 'id': item['id'],
107
- 'path': item['path'],
108
- 'indexed_at': str(item['indexed_ts']) + ' (' + str(indexed_dt) + ')',
109
- 'file_id': item_id,
110
- }
111
- self.window.core.debug.add(self.id, item_id, str(data))
112
- """
74
+ debug.add(self.id, 'CTX [auto]:', str(config.get("llama.idx.auto")))
75
+ last_ctx = int(config.get("llama.idx.db.last"))
76
+ last_str = "-" if last_ctx <= 0 else f"{datetime.datetime.fromtimestamp(last_ctx).strftime('%Y-%m-%d %H:%M:%S')} ({last_ctx})"
77
+ debug.add(self.id, 'CTX [db.last]:', str(last_str))
113
78
 
114
- self.window.core.debug.end(self.id)
79
+ 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: 2024.11.20 03:00:00 #
9
+ # Updated Date: 2025.09.14 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  class KernelDebug:
@@ -21,10 +21,13 @@ class KernelDebug:
21
21
 
22
22
  def update(self):
23
23
  """Update debug window."""
24
- self.window.core.debug.begin(self.id)
25
- self.window.core.debug.add(self.id, 'Busy:', str(self.window.controller.kernel.busy))
26
- self.window.core.debug.add(self.id, 'Halt:', str(self.window.controller.kernel.halt))
27
- self.window.core.debug.add(self.id, 'Status:', str(self.window.controller.kernel.status))
28
- self.window.core.debug.add(self.id, 'State:', str(self.window.controller.kernel.state))
29
- self.window.core.debug.add(self.id, 'Stack:', str(self.window.controller.kernel.last_stack))
30
- self.window.core.debug.end(self.id)
24
+ debug = self.window.core.debug
25
+ kernel_controller = self.window.controller.kernel
26
+
27
+ debug.begin(self.id)
28
+ debug.add(self.id, 'Busy:', str(kernel_controller.busy))
29
+ debug.add(self.id, 'Halt:', str(kernel_controller.halt))
30
+ debug.add(self.id, 'Status:', str(kernel_controller.status))
31
+ debug.add(self.id, 'State:', str(kernel_controller.state))
32
+ debug.add(self.id, 'Stack:', str(kernel_controller.last_stack))
33
+ debug.end(self.id)
@@ -6,12 +6,11 @@
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.07.23 15:00:00 #
9
+ # Updated Date: 2025.09.14 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
13
13
 
14
-
15
14
  class ModelsDebug:
16
15
  def __init__(self, window=None):
17
16
  """
@@ -24,30 +23,36 @@ class ModelsDebug:
24
23
 
25
24
  def update(self):
26
25
  """Update debug window."""
27
- self.window.core.debug.begin(self.id)
26
+ debug = self.window.core.debug
27
+ models_controller = self.window.controller.models
28
+ models_core = self.window.core.models
29
+ command_core = self.window.core.command
30
+ config_core = self.window.core.config
31
+
32
+ debug.begin(self.id)
28
33
 
29
- path = os.path.join(self.window.core.config.path, '', 'models.json')
30
- self.window.core.debug.add(self.id, 'Models File', str(path))
31
- self.window.core.debug.add(self.id, 'editor.selected[]', str(self.window.controller.models.editor.selected))
32
- self.window.core.debug.add(self.id, '[func] is_native_enabled()', str(self.window.core.command.is_native_enabled()))
34
+ path = os.path.join(config_core.path, '', 'models.json')
35
+ debug.add(self.id, 'Models File', str(path))
36
+ debug.add(self.id, 'editor.selected[]', str(models_controller.editor.selected))
37
+ debug.add(self.id, '[func] is_native_enabled()', str(command_core.is_native_enabled()))
33
38
 
34
- self.window.core.debug.add(
39
+ debug.add(
35
40
  self.id, 'Options',
36
- str(self.window.controller.model.editor.get_options())
41
+ str(models_controller.model.editor.get_options())
37
42
  )
38
43
 
39
44
  # models
40
- for key in self.window.core.models.items:
45
+ for key in models_core.items:
41
46
  if key == '__meta__':
42
- self.window.core.debug.add(self.id, '__meta__', str(self.window.core.models.items[key]))
47
+ debug.add(self.id, '__meta__', str(models_core.items[key]))
43
48
  continue
44
- model = self.window.core.models.items[key]
49
+
50
+ model = models_core.items[key]
45
51
  data = {
46
52
  'id': model.id,
47
53
  'name': model.name,
48
54
  'provider': model.provider,
49
55
  'mode': model.mode,
50
- # 'multimodal': model.multimodal,
51
56
  'input': model.input,
52
57
  'output': model.output,
53
58
  'langchain': model.langchain,
@@ -58,6 +63,6 @@ class ModelsDebug:
58
63
  'default': model.default,
59
64
  'imported': model.imported,
60
65
  }
61
- self.window.core.debug.add(self.id, str(key), str(data))
66
+ debug.add(self.id, str(key), str(data))
62
67
 
63
- self.window.core.debug.end(self.id)
68
+ 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: 2024.02.25 22:00:00 #
9
+ # Updated Date: 2025.09.14 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
 
@@ -22,17 +22,20 @@ class PluginsDebug:
22
22
 
23
23
  def update(self):
24
24
  """Update debug window."""
25
- self.window.core.debug.begin(self.id)
25
+ debug = self.window.core.debug
26
+ plugins_dict = self.window.core.plugins.plugins
26
27
 
27
- plugins = list(self.window.core.plugins.plugins.keys())
28
+ debug.begin(self.id)
29
+
30
+ plugins = list(plugins_dict.keys())
28
31
  for key in plugins:
29
- plugin = self.window.core.plugins.plugins[key]
32
+ plugin = plugins_dict[key]
30
33
  data = {
31
34
  'id': plugin.id,
32
35
  'name': plugin.name,
33
36
  'description': plugin.description,
34
37
  'options': plugin.options
35
38
  }
36
- self.window.core.debug.add(self.id, str(key), str(data))
39
+ debug.add(self.id, str(key), str(data))
37
40
 
38
- self.window.core.debug.end(self.id)
41
+ 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: 2025.08.28 09:00:00 #
9
+ # Updated Date: 2025.09.14 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -39,19 +39,24 @@ class PresetsDebug:
39
39
 
40
40
  def update(self):
41
41
  """Update debug window."""
42
- self.window.core.debug.begin(self.id)
42
+ debug = self.window.core.debug
43
+ presets_controller = self.window.controller.presets
44
+ presets_core = self.window.core.presets
45
+ config_path = self.window.core.config.path
43
46
 
44
- self.window.core.debug.add(
47
+ debug.begin(self.id)
48
+
49
+ debug.add(
45
50
  self.id, 'Options',
46
- str(self.window.controller.presets.editor.get_options())
51
+ str(presets_controller.editor.get_options())
47
52
  )
48
53
 
49
- self.window.core.debug.add(self.id, 'selected[]', str(self.window.controller.presets.selected))
54
+ debug.add(self.id, 'selected[]', str(presets_controller.selected))
50
55
 
51
- # presets
52
- for key in list(dict(self.window.core.presets.items)):
53
- preset = self.window.core.presets.items[key]
54
- path = os.path.join(self.window.core.config.path, 'presets', key + '.json')
56
+ # Presets
57
+ for key in list(dict(presets_core.items)):
58
+ preset = presets_core.items[key]
59
+ path = os.path.join(config_path, 'presets', f"{key}.json")
55
60
  data = {
56
61
  'id': key,
57
62
  'file': path,
@@ -75,6 +80,6 @@ class PresetsDebug:
75
80
  'temperature': preset.temperature,
76
81
  'version': preset.version,
77
82
  }
78
- self.window.core.debug.add(self.id, str(key), str(data))
83
+ debug.add(self.id, str(key), str(data))
79
84
 
80
- self.window.core.debug.end(self.id)
85
+ 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: 2024.12.14 17:00:00 #
9
+ # Updated Date: 2025.09.14 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  class TabsDebug:
@@ -21,29 +21,35 @@ class TabsDebug:
21
21
 
22
22
  def update(self):
23
23
  """Update debug window."""
24
- self.window.core.debug.begin(self.id)
25
- self.window.core.debug.add(self.id, 'current Col', str(self.window.controller.ui.tabs.get_current_column_idx()))
26
- self.window.core.debug.add(self.id, 'current IDX', str(self.window.controller.ui.tabs.get_current_idx()))
27
- self.window.core.debug.add(self.id, 'current Tab', str(self.window.controller.ui.tabs.get_current_tab()))
28
- self.window.core.debug.add(self.id, 'current PID', str(self.window.controller.ui.tabs.get_current_pid()))
29
- self.window.core.debug.add(self.id, 'current Type', str(self.window.controller.ui.tabs.get_current_type()))
30
- self.window.core.debug.add(self.id, '----', '')
31
- self.window.core.debug.add(self.id, 'last_pid', str(self.window.core.tabs.last_pid))
32
- self.window.core.debug.add(self.id, 'locked', str(self.window.controller.ui.tabs.locked))
33
- self.window.core.debug.add(self.id, 'col', str(self.window.controller.ui.tabs.col))
34
- self.window.core.debug.add(self.id, 'count(pids)', str(len(self.window.core.tabs.pids)))
35
- self.window.core.debug.add(self.id, 'count(ctx bags)', str(len(self.window.core.ctx.container.bags)))
36
- self.window.core.debug.add(self.id, '----', '')
24
+ debug = self.window.core.debug
25
+ tabs_controller = self.window.controller.ui.tabs
26
+ tabs_core = self.window.core.tabs
27
+ ctx_output = self.window.core.ctx.output
28
+ ctx_container = self.window.core.ctx.container
29
+
30
+ debug.begin(self.id)
31
+ debug.add(self.id, 'current Col', str(tabs_controller.get_current_column_idx()))
32
+ debug.add(self.id, 'current IDX', str(tabs_controller.get_current_idx()))
33
+ debug.add(self.id, 'current Tab', str(tabs_controller.get_current_tab()))
34
+ debug.add(self.id, 'current PID', str(tabs_controller.get_current_pid()))
35
+ debug.add(self.id, 'current Type', str(tabs_controller.get_current_type()))
36
+ debug.add(self.id, '----', '')
37
+ debug.add(self.id, 'last_pid', str(tabs_core.last_pid))
38
+ debug.add(self.id, 'locked', str(tabs_controller.locked))
39
+ debug.add(self.id, 'col', str(tabs_controller.col))
40
+ debug.add(self.id, 'count(pids)', str(len(tabs_core.pids)))
41
+ debug.add(self.id, 'count(ctx bags)', str(len(ctx_container.bags)))
42
+ debug.add(self.id, '----', '')
37
43
 
38
44
  # PIDs
39
- for pid in list(self.window.core.tabs.pids):
40
- tab = self.window.core.tabs.pids[pid]
45
+ for pid in list(tabs_core.pids):
46
+ tab = tabs_core.pids[pid]
41
47
  data = tab.to_dict()
42
- self.window.core.debug.add(self.id, "PID ["+str(pid)+"]", str(data))
48
+ debug.add(self.id, f"PID [{pid}]", str(data))
43
49
 
44
50
  # mapping PID => meta.id
45
- self.window.core.debug.add(self.id, '----', '')
46
- self.window.core.debug.add(self.id, 'PID => meta.id', str(self.window.core.ctx.output.mapping))
47
- self.window.core.debug.add(self.id, '(last) meta.id => PID', str(self.window.core.ctx.output.last_pids))
48
- self.window.core.debug.add(self.id, '(last) PID', str(self.window.core.ctx.output.last_pid))
49
- self.window.core.debug.end(self.id)
51
+ debug.add(self.id, '----', '')
52
+ debug.add(self.id, 'PID => meta.id', str(ctx_output.mapping))
53
+ debug.add(self.id, '(last) meta.id => PID', str(ctx_output.last_pids))
54
+ debug.add(self.id, '(last) PID', str(ctx_output.last_pid))
55
+ debug.end(self.id)