pygpt-net 2.6.20__py3-none-any.whl → 2.6.22__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 (221) hide show
  1. pygpt_net/CHANGELOG.txt +13 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +3 -1
  4. pygpt_net/controller/__init__.py +4 -8
  5. pygpt_net/controller/access/voice.py +2 -2
  6. pygpt_net/controller/agent/agent.py +130 -2
  7. pygpt_net/controller/agent/experts.py +93 -96
  8. pygpt_net/controller/agent/llama.py +2 -1
  9. pygpt_net/controller/assistant/assistant.py +18 -1
  10. pygpt_net/controller/assistant/batch.py +2 -3
  11. pygpt_net/controller/assistant/editor.py +2 -2
  12. pygpt_net/controller/assistant/files.py +2 -3
  13. pygpt_net/controller/assistant/store.py +2 -2
  14. pygpt_net/controller/attachment/attachment.py +17 -1
  15. pygpt_net/controller/audio/audio.py +2 -2
  16. pygpt_net/controller/camera/camera.py +15 -7
  17. pygpt_net/controller/chat/chat.py +2 -2
  18. pygpt_net/controller/chat/common.py +50 -33
  19. pygpt_net/controller/chat/image.py +67 -77
  20. pygpt_net/controller/chat/input.py +94 -166
  21. pygpt_net/controller/chat/output.py +83 -140
  22. pygpt_net/controller/chat/response.py +83 -102
  23. pygpt_net/controller/chat/text.py +116 -149
  24. pygpt_net/controller/ctx/common.py +2 -1
  25. pygpt_net/controller/ctx/ctx.py +87 -6
  26. pygpt_net/controller/files/files.py +13 -1
  27. pygpt_net/controller/idx/idx.py +26 -2
  28. pygpt_net/controller/idx/indexer.py +85 -76
  29. pygpt_net/controller/kernel/reply.py +53 -66
  30. pygpt_net/controller/kernel/stack.py +16 -16
  31. pygpt_net/controller/lang/lang.py +52 -34
  32. pygpt_net/controller/model/importer.py +3 -2
  33. pygpt_net/controller/model/model.py +62 -3
  34. pygpt_net/controller/notepad/notepad.py +86 -84
  35. pygpt_net/controller/plugins/settings.py +3 -4
  36. pygpt_net/controller/settings/editor.py +4 -4
  37. pygpt_net/controller/settings/profile.py +105 -124
  38. pygpt_net/controller/theme/menu.py +154 -57
  39. pygpt_net/controller/theme/nodes.py +51 -44
  40. pygpt_net/controller/theme/theme.py +33 -9
  41. pygpt_net/controller/tools/tools.py +2 -2
  42. pygpt_net/controller/ui/tabs.py +2 -3
  43. pygpt_net/controller/ui/ui.py +16 -2
  44. pygpt_net/core/agents/observer/evaluation.py +3 -3
  45. pygpt_net/core/agents/provider.py +25 -3
  46. pygpt_net/core/agents/runner.py +4 -1
  47. pygpt_net/core/agents/runners/llama_workflow.py +19 -7
  48. pygpt_net/core/agents/runners/loop.py +3 -1
  49. pygpt_net/core/agents/runners/openai_workflow.py +17 -3
  50. pygpt_net/core/agents/tools.py +4 -1
  51. pygpt_net/core/bridge/context.py +34 -37
  52. pygpt_net/core/ctx/container.py +13 -12
  53. pygpt_net/core/ctx/ctx.py +1 -1
  54. pygpt_net/core/ctx/output.py +7 -4
  55. pygpt_net/core/db/database.py +2 -2
  56. pygpt_net/core/debug/console/console.py +2 -2
  57. pygpt_net/core/debug/debug.py +12 -1
  58. pygpt_net/core/dispatcher/dispatcher.py +24 -1
  59. pygpt_net/core/events/app.py +7 -7
  60. pygpt_net/core/events/control.py +26 -26
  61. pygpt_net/core/events/event.py +6 -3
  62. pygpt_net/core/events/kernel.py +2 -2
  63. pygpt_net/core/events/render.py +13 -13
  64. pygpt_net/core/experts/experts.py +76 -82
  65. pygpt_net/core/experts/worker.py +12 -12
  66. pygpt_net/core/filesystem/actions.py +1 -2
  67. pygpt_net/core/models/models.py +5 -1
  68. pygpt_net/core/models/ollama.py +14 -5
  69. pygpt_net/core/render/plain/helpers.py +2 -5
  70. pygpt_net/core/render/plain/renderer.py +26 -30
  71. pygpt_net/core/render/web/body.py +1 -1
  72. pygpt_net/core/render/web/helpers.py +2 -2
  73. pygpt_net/core/render/web/renderer.py +4 -4
  74. pygpt_net/core/settings/settings.py +43 -13
  75. pygpt_net/core/tabs/tabs.py +20 -13
  76. pygpt_net/core/types/__init__.py +2 -1
  77. pygpt_net/core/types/agent.py +4 -4
  78. pygpt_net/core/types/base.py +19 -0
  79. pygpt_net/core/types/console.py +6 -6
  80. pygpt_net/core/types/mode.py +8 -8
  81. pygpt_net/core/types/multimodal.py +3 -3
  82. pygpt_net/core/types/openai.py +2 -1
  83. pygpt_net/data/config/config.json +5 -5
  84. pygpt_net/data/config/models.json +19 -3
  85. pygpt_net/data/config/settings.json +14 -14
  86. pygpt_net/data/locale/locale.de.ini +4 -1
  87. pygpt_net/data/locale/locale.en.ini +6 -3
  88. pygpt_net/data/locale/locale.es.ini +4 -1
  89. pygpt_net/data/locale/locale.fr.ini +4 -1
  90. pygpt_net/data/locale/locale.it.ini +4 -1
  91. pygpt_net/data/locale/locale.pl.ini +5 -4
  92. pygpt_net/data/locale/locale.uk.ini +4 -1
  93. pygpt_net/data/locale/locale.zh.ini +4 -1
  94. pygpt_net/item/ctx.py +256 -240
  95. pygpt_net/item/model.py +59 -116
  96. pygpt_net/item/preset.py +122 -105
  97. pygpt_net/plugin/twitter/plugin.py +2 -2
  98. pygpt_net/provider/agents/llama_index/workflow/planner.py +3 -3
  99. pygpt_net/provider/agents/openai/agent.py +4 -12
  100. pygpt_net/provider/agents/openai/agent_b2b.py +10 -15
  101. pygpt_net/provider/agents/openai/agent_planner.py +4 -4
  102. pygpt_net/provider/agents/openai/agent_with_experts.py +3 -7
  103. pygpt_net/provider/agents/openai/agent_with_experts_feedback.py +4 -8
  104. pygpt_net/provider/agents/openai/agent_with_feedback.py +4 -8
  105. pygpt_net/provider/agents/openai/bot_researcher.py +2 -18
  106. pygpt_net/provider/agents/openai/bots/__init__.py +0 -0
  107. pygpt_net/provider/agents/openai/bots/research_bot/__init__.py +0 -0
  108. pygpt_net/provider/agents/openai/bots/research_bot/agents/__init__.py +0 -0
  109. pygpt_net/provider/agents/openai/bots/research_bot/agents/planner_agent.py +1 -1
  110. pygpt_net/provider/agents/openai/bots/research_bot/agents/search_agent.py +1 -0
  111. pygpt_net/provider/agents/openai/bots/research_bot/agents/writer_agent.py +1 -1
  112. pygpt_net/provider/agents/openai/bots/research_bot/manager.py +1 -10
  113. pygpt_net/provider/agents/openai/evolve.py +5 -9
  114. pygpt_net/provider/agents/openai/supervisor.py +4 -8
  115. pygpt_net/provider/core/config/patch.py +10 -3
  116. pygpt_net/provider/core/ctx/db_sqlite/utils.py +43 -43
  117. pygpt_net/provider/core/model/patch.py +11 -1
  118. pygpt_net/provider/core/preset/json_file.py +47 -49
  119. pygpt_net/provider/gpt/agents/experts.py +2 -2
  120. pygpt_net/tools/audio_transcriber/ui/dialogs.py +44 -54
  121. pygpt_net/tools/code_interpreter/body.py +1 -2
  122. pygpt_net/tools/code_interpreter/tool.py +7 -4
  123. pygpt_net/tools/code_interpreter/ui/html.py +1 -3
  124. pygpt_net/tools/code_interpreter/ui/widgets.py +2 -3
  125. pygpt_net/tools/html_canvas/ui/widgets.py +1 -3
  126. pygpt_net/tools/image_viewer/ui/dialogs.py +40 -37
  127. pygpt_net/tools/indexer/ui/widgets.py +2 -4
  128. pygpt_net/tools/media_player/tool.py +2 -5
  129. pygpt_net/tools/media_player/ui/widgets.py +60 -36
  130. pygpt_net/tools/text_editor/ui/widgets.py +18 -19
  131. pygpt_net/tools/translator/ui/widgets.py +39 -35
  132. pygpt_net/ui/base/context_menu.py +9 -4
  133. pygpt_net/ui/dialog/db.py +1 -3
  134. pygpt_net/ui/dialog/models.py +1 -3
  135. pygpt_net/ui/dialog/models_importer.py +2 -4
  136. pygpt_net/ui/dialogs.py +34 -30
  137. pygpt_net/ui/layout/chat/attachments.py +72 -84
  138. pygpt_net/ui/layout/chat/attachments_ctx.py +40 -44
  139. pygpt_net/ui/layout/chat/attachments_uploaded.py +36 -39
  140. pygpt_net/ui/layout/chat/calendar.py +100 -70
  141. pygpt_net/ui/layout/chat/chat.py +23 -17
  142. pygpt_net/ui/layout/chat/input.py +95 -118
  143. pygpt_net/ui/layout/chat/output.py +100 -162
  144. pygpt_net/ui/layout/chat/painter.py +89 -61
  145. pygpt_net/ui/layout/ctx/ctx_list.py +43 -52
  146. pygpt_net/ui/layout/status.py +23 -14
  147. pygpt_net/ui/layout/toolbox/agent.py +27 -38
  148. pygpt_net/ui/layout/toolbox/agent_llama.py +42 -45
  149. pygpt_net/ui/layout/toolbox/assistants.py +42 -38
  150. pygpt_net/ui/layout/toolbox/computer_env.py +32 -23
  151. pygpt_net/ui/layout/toolbox/footer.py +13 -16
  152. pygpt_net/ui/layout/toolbox/image.py +18 -21
  153. pygpt_net/ui/layout/toolbox/indexes.py +46 -89
  154. pygpt_net/ui/layout/toolbox/mode.py +20 -7
  155. pygpt_net/ui/layout/toolbox/model.py +12 -10
  156. pygpt_net/ui/layout/toolbox/presets.py +68 -52
  157. pygpt_net/ui/layout/toolbox/prompt.py +31 -58
  158. pygpt_net/ui/layout/toolbox/toolbox.py +25 -21
  159. pygpt_net/ui/layout/toolbox/vision.py +20 -22
  160. pygpt_net/ui/main.py +2 -4
  161. pygpt_net/ui/menu/about.py +64 -84
  162. pygpt_net/ui/menu/audio.py +87 -63
  163. pygpt_net/ui/menu/config.py +121 -127
  164. pygpt_net/ui/menu/debug.py +69 -76
  165. pygpt_net/ui/menu/file.py +32 -35
  166. pygpt_net/ui/menu/menu.py +2 -3
  167. pygpt_net/ui/menu/plugins.py +69 -33
  168. pygpt_net/ui/menu/theme.py +45 -46
  169. pygpt_net/ui/menu/tools.py +56 -60
  170. pygpt_net/ui/menu/video.py +20 -25
  171. pygpt_net/ui/tray.py +1 -2
  172. pygpt_net/ui/widget/audio/bar.py +1 -3
  173. pygpt_net/ui/widget/audio/input_button.py +3 -4
  174. pygpt_net/ui/widget/calendar/select.py +1 -2
  175. pygpt_net/ui/widget/dialog/base.py +12 -9
  176. pygpt_net/ui/widget/dialog/editor_file.py +20 -23
  177. pygpt_net/ui/widget/dialog/find.py +25 -24
  178. pygpt_net/ui/widget/dialog/profile.py +57 -53
  179. pygpt_net/ui/widget/draw/painter.py +62 -93
  180. pygpt_net/ui/widget/element/button.py +42 -30
  181. pygpt_net/ui/widget/element/checkbox.py +23 -15
  182. pygpt_net/ui/widget/element/group.py +6 -5
  183. pygpt_net/ui/widget/element/labels.py +1 -2
  184. pygpt_net/ui/widget/filesystem/explorer.py +93 -102
  185. pygpt_net/ui/widget/image/display.py +1 -2
  186. pygpt_net/ui/widget/lists/assistant.py +1 -2
  187. pygpt_net/ui/widget/lists/attachment.py +1 -2
  188. pygpt_net/ui/widget/lists/attachment_ctx.py +1 -2
  189. pygpt_net/ui/widget/lists/context.py +2 -4
  190. pygpt_net/ui/widget/lists/index.py +1 -2
  191. pygpt_net/ui/widget/lists/model.py +1 -2
  192. pygpt_net/ui/widget/lists/model_editor.py +1 -2
  193. pygpt_net/ui/widget/lists/model_importer.py +1 -2
  194. pygpt_net/ui/widget/lists/preset.py +1 -2
  195. pygpt_net/ui/widget/lists/preset_plugins.py +1 -2
  196. pygpt_net/ui/widget/lists/profile.py +1 -2
  197. pygpt_net/ui/widget/lists/uploaded.py +1 -2
  198. pygpt_net/ui/widget/option/checkbox.py +2 -4
  199. pygpt_net/ui/widget/option/checkbox_list.py +1 -4
  200. pygpt_net/ui/widget/option/cmd.py +1 -4
  201. pygpt_net/ui/widget/option/dictionary.py +25 -28
  202. pygpt_net/ui/widget/option/input.py +1 -3
  203. pygpt_net/ui/widget/tabs/Input.py +16 -12
  204. pygpt_net/ui/widget/tabs/body.py +5 -3
  205. pygpt_net/ui/widget/tabs/layout.py +36 -25
  206. pygpt_net/ui/widget/tabs/output.py +96 -74
  207. pygpt_net/ui/widget/textarea/calendar_note.py +1 -2
  208. pygpt_net/ui/widget/textarea/editor.py +41 -73
  209. pygpt_net/ui/widget/textarea/find.py +11 -10
  210. pygpt_net/ui/widget/textarea/html.py +3 -6
  211. pygpt_net/ui/widget/textarea/input.py +63 -64
  212. pygpt_net/ui/widget/textarea/notepad.py +54 -38
  213. pygpt_net/ui/widget/textarea/output.py +65 -54
  214. pygpt_net/ui/widget/textarea/search_input.py +5 -4
  215. pygpt_net/ui/widget/textarea/web.py +2 -4
  216. pygpt_net/ui/widget/vision/camera.py +2 -31
  217. {pygpt_net-2.6.20.dist-info → pygpt_net-2.6.22.dist-info}/METADATA +25 -154
  218. {pygpt_net-2.6.20.dist-info → pygpt_net-2.6.22.dist-info}/RECORD +218 -217
  219. {pygpt_net-2.6.20.dist-info → pygpt_net-2.6.22.dist-info}/LICENSE +0 -0
  220. {pygpt_net-2.6.20.dist-info → pygpt_net-2.6.22.dist-info}/WHEEL +0 -0
  221. {pygpt_net-2.6.20.dist-info → pygpt_net-2.6.22.dist-info}/entry_points.txt +0 -0
pygpt_net/ui/menu/file.py CHANGED
@@ -6,13 +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: 2024.08.27 19:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtGui import QAction, QIcon
13
13
 
14
14
  from pygpt_net.utils import trans
15
- import pygpt_net.icons_rc
16
15
 
17
16
 
18
17
  class File:
@@ -26,43 +25,41 @@ class File:
26
25
 
27
26
  def setup(self):
28
27
  """Setup file menu"""
29
- self.window.ui.menu['app.exit'] = QAction(QIcon(":/icons/logout.svg"), trans("menu.file.exit"),
30
- self.window, shortcut="Ctrl+Q", triggered=self.window.close)
31
- self.window.ui.menu['app.exit'].setMenuRole(QAction.MenuRole.NoRole)
28
+ w = self.window
29
+ m = w.ui.menu
30
+ ctx = w.controller.ctx
32
31
 
33
- self.window.ui.menu['app.clear_history'] = QAction(QIcon(":/icons/delete.svg"),
34
- trans("menu.file_clear_history"), self.window)
35
- self.window.ui.menu['app.clear_history_groups'] = QAction(QIcon(":/icons/delete.svg"),
36
- trans("menu.file_clear_history_groups"), self.window)
32
+ icon_logout = QIcon(":/icons/logout.svg")
33
+ icon_delete = QIcon(":/icons/delete.svg")
34
+ icon_add = QIcon(":/icons/add.svg")
35
+ icon_folder = QIcon(":/icons/folder_filled.svg")
36
+ icon_fullscreen = QIcon(":/icons/fullscreen.svg")
37
37
 
38
- self.window.ui.menu['app.ctx.new'] = QAction(QIcon(":/icons/add.svg"), trans("menu.file.new"), self.window)
39
- self.window.ui.menu['app.ctx.group.new'] = QAction(QIcon(":/icons/folder_filled.svg"),
40
- trans("menu.file.group.new"), self.window)
41
- self.window.ui.menu['app.ctx.current'] = QAction(QIcon(":/icons/fullscreen.svg"), trans("menu.file.current"), self.window)
38
+ m['app.exit'] = QAction(icon_logout, trans("menu.file.exit"), w, shortcut="Ctrl+Q", triggered=w.close)
39
+ m['app.exit'].setMenuRole(QAction.MenuRole.NoRole)
42
40
 
43
- self.window.ui.menu['app.clear_history'].triggered.connect(
44
- lambda: self.window.controller.ctx.delete_history()
45
- )
46
- self.window.ui.menu['app.clear_history_groups'].triggered.connect(
47
- lambda: self.window.controller.ctx.delete_history_groups()
48
- )
41
+ m['app.clear_history'] = QAction(icon_delete, trans("menu.file_clear_history"), w)
42
+ m['app.clear_history_groups'] = QAction(icon_delete, trans("menu.file_clear_history_groups"), w)
49
43
 
50
- self.window.ui.menu['app.ctx.new'].triggered.connect(
51
- lambda: self.window.controller.ctx.new_ungrouped()
52
- ) # new context without group
53
-
54
- self.window.ui.menu['app.ctx.group.new'].triggered.connect(
55
- lambda: self.window.controller.ctx.new_group()
56
- )
44
+ m['app.ctx.new'] = QAction(icon_add, trans("menu.file.new"), w)
45
+ m['app.ctx.group.new'] = QAction(icon_folder, trans("menu.file.group.new"), w)
46
+ m['app.ctx.current'] = QAction(icon_fullscreen, trans("menu.file.current"), w)
57
47
 
58
- self.window.ui.menu['app.ctx.current'].triggered.connect(
59
- lambda: self.window.controller.ctx.select_by_current(True)
48
+ m['app.clear_history'].triggered.connect(ctx.delete_history)
49
+ m['app.clear_history_groups'].triggered.connect(ctx.delete_history_groups)
50
+ m['app.ctx.new'].triggered.connect(ctx.new_ungrouped) # new context without group
51
+ m['app.ctx.group.new'].triggered.connect(ctx.new_group)
52
+ m['app.ctx.current'].triggered.connect(
53
+ lambda checked=False: ctx.select_by_current(True)
60
54
  ) # new context without group
61
55
 
62
- self.window.ui.menu['menu.app'] = self.window.menuBar().addMenu(trans("menu.file"))
63
- self.window.ui.menu['menu.app'].addAction(self.window.ui.menu['app.ctx.new'])
64
- self.window.ui.menu['menu.app'].addAction(self.window.ui.menu['app.ctx.group.new'])
65
- self.window.ui.menu['menu.app'].addAction(self.window.ui.menu['app.ctx.current'])
66
- self.window.ui.menu['menu.app'].addAction(self.window.ui.menu['app.clear_history'])
67
- self.window.ui.menu['menu.app'].addAction(self.window.ui.menu['app.clear_history_groups'])
68
- self.window.ui.menu['menu.app'].addAction(self.window.ui.menu['app.exit'])
56
+ m['menu.app'] = w.menuBar().addMenu(trans("menu.file"))
57
+ m_app = m['menu.app']
58
+ m_app.addActions([
59
+ m['app.ctx.new'],
60
+ m['app.ctx.group.new'],
61
+ m['app.ctx.current'],
62
+ m['app.clear_history'],
63
+ m['app.clear_history_groups'],
64
+ m['app.exit'],
65
+ ])
pygpt_net/ui/menu/menu.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.01.17 02:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from .about import About
@@ -56,6 +56,5 @@ class Menu:
56
56
  self.about.setup()
57
57
 
58
58
  # debug menu
59
- show = self.window.core.config.get('debug')
60
59
  self.debug.setup()
61
- self.window.ui.menu['menu.debug'].menuAction().setVisible(show)
60
+ self.window.ui.menu['menu.debug'].menuAction().setVisible(self.window.core.config.get('debug'))
@@ -6,14 +6,13 @@
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 22:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtGui import QAction, QIcon
13
13
  from PySide6.QtWidgets import QMenu
14
14
 
15
15
  from pygpt_net.utils import trans
16
- import pygpt_net.icons_rc
17
16
 
18
17
 
19
18
  class Plugins:
@@ -27,34 +26,71 @@ class Plugins:
27
26
 
28
27
  def setup(self):
29
28
  """Setup plugins menu"""
30
- self.window.ui.menu['plugins.settings'] = QAction(QIcon(":/icons/settings_filled.svg"),
31
- trans("menu.plugins.settings"), self.window)
32
- self.window.ui.menu['plugins.settings'].setMenuRole(QAction.MenuRole.NoRole)
33
-
34
- self.window.ui.menu['plugins.settings'].triggered.connect(
35
- lambda: self.window.controller.plugins.settings.toggle_editor())
36
-
37
- self.window.ui.menu['plugins_presets'] = {}
38
- self.window.ui.menu['menu.plugins.presets'] = QMenu(trans("menu.plugins.presets"), self.window)
39
-
40
- # add new
41
- self.window.ui.menu['plugins.presets.new'] = QAction(
42
- QIcon(":/icons/add.svg"), trans("menu.plugins.presets.new"), self.window, checkable=False)
43
- self.window.ui.menu['plugins.presets.new'].triggered.connect(
44
- lambda: self.window.controller.plugins.presets.new())
45
- self.window.ui.menu['plugins.presets.new'].setMenuRole(QAction.MenuRole.NoRole)
46
- self.window.ui.menu['menu.plugins.presets'].addAction(self.window.ui.menu['plugins.presets.new'])
47
-
48
- # edit
49
- self.window.ui.menu['plugins.presets.edit'] = QAction(
50
- QIcon(":/icons/edit.svg"), trans("menu.plugins.presets.edit"), self.window, checkable=False)
51
- self.window.ui.menu['plugins.presets.edit'].triggered.connect(
52
- lambda: self.window.controller.plugins.presets.toggle_editor())
53
- self.window.ui.menu['plugins.presets.edit'].setMenuRole(QAction.MenuRole.NoRole)
54
- self.window.ui.menu['menu.plugins.presets'].addAction(self.window.ui.menu['plugins.presets.edit'])
55
-
56
- self.window.ui.menu['plugins'] = {}
57
- self.window.ui.menu['menu.plugins'] = self.window.menuBar().addMenu(trans("menu.plugins"))
58
- self.window.ui.menu['menu.plugins'].addMenu(self.window.ui.menu['menu.plugins.presets'])
59
- self.window.ui.menu['menu.plugins'].addAction(self.window.ui.menu['plugins.settings'])
60
- self.window.ui.menu['menu.plugins'].setToolTipsVisible(True)
29
+ w = self.window
30
+ ui_menu = w.ui.menu
31
+ plugins_ctrl = w.controller.plugins
32
+
33
+ txt_plugins = trans("menu.plugins")
34
+ txt_settings = trans("menu.plugins.settings")
35
+ txt_presets = trans("menu.plugins.presets")
36
+ txt_presets_new = trans("menu.plugins.presets.new")
37
+ txt_presets_edit = trans("menu.plugins.presets.edit")
38
+
39
+ settings_action = ui_menu.get('plugins.settings')
40
+ if settings_action is None:
41
+ settings_action = QAction(QIcon(":/icons/settings_filled.svg"), txt_settings, w)
42
+ settings_action.setMenuRole(QAction.MenuRole.NoRole)
43
+ settings_action.triggered.connect(lambda _=False, f=plugins_ctrl.settings.toggle_editor: f())
44
+ ui_menu['plugins.settings'] = settings_action
45
+ else:
46
+ settings_action.setText(txt_settings)
47
+ settings_action.setIcon(QIcon(":/icons/settings_filled.svg"))
48
+ settings_action.setMenuRole(QAction.MenuRole.NoRole)
49
+
50
+ ui_menu.setdefault('plugins_presets', {})
51
+ presets_menu = ui_menu.get('menu.plugins.presets')
52
+ if presets_menu is None:
53
+ presets_menu = QMenu(txt_presets, w)
54
+ ui_menu['menu.plugins.presets'] = presets_menu
55
+ else:
56
+ presets_menu.setTitle(txt_presets)
57
+
58
+ new_action = ui_menu.get('plugins.presets.new')
59
+ if new_action is None:
60
+ new_action = QAction(QIcon(":/icons/add.svg"), txt_presets_new, w, checkable=False)
61
+ new_action.triggered.connect(lambda _=False, f=plugins_ctrl.presets.new: f())
62
+ new_action.setMenuRole(QAction.MenuRole.NoRole)
63
+ ui_menu['plugins.presets.new'] = new_action
64
+ else:
65
+ new_action.setText(txt_presets_new)
66
+ new_action.setIcon(QIcon(":/icons/add.svg"))
67
+ new_action.setMenuRole(QAction.MenuRole.NoRole)
68
+ if new_action not in presets_menu.actions():
69
+ presets_menu.addAction(new_action)
70
+
71
+ edit_action = ui_menu.get('plugins.presets.edit')
72
+ if edit_action is None:
73
+ edit_action = QAction(QIcon(":/icons/edit.svg"), txt_presets_edit, w, checkable=False)
74
+ edit_action.triggered.connect(lambda _=False, f=plugins_ctrl.presets.toggle_editor: f())
75
+ edit_action.setMenuRole(QAction.MenuRole.NoRole)
76
+ ui_menu['plugins.presets.edit'] = edit_action
77
+ else:
78
+ edit_action.setText(txt_presets_edit)
79
+ edit_action.setIcon(QIcon(":/icons/edit.svg"))
80
+ edit_action.setMenuRole(QAction.MenuRole.NoRole)
81
+ if edit_action not in presets_menu.actions():
82
+ presets_menu.addAction(edit_action)
83
+
84
+ ui_menu.setdefault('plugins', {})
85
+ plugins_menu = ui_menu.get('menu.plugins')
86
+ if plugins_menu is None:
87
+ plugins_menu = w.menuBar().addMenu(txt_plugins)
88
+ ui_menu['menu.plugins'] = plugins_menu
89
+ else:
90
+ plugins_menu.setTitle(txt_plugins)
91
+
92
+ if presets_menu.menuAction() not in plugins_menu.actions():
93
+ plugins_menu.addMenu(presets_menu)
94
+ if settings_action not in plugins_menu.actions():
95
+ plugins_menu.addAction(settings_action)
96
+ plugins_menu.setToolTipsVisible(True)
@@ -6,14 +6,13 @@
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.07 21:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtGui import QAction, QIcon
13
13
  from PySide6.QtWidgets import QMenu
14
14
 
15
15
  from pygpt_net.utils import trans
16
- import pygpt_net.icons_rc
17
16
 
18
17
 
19
18
  class Theme:
@@ -24,55 +23,55 @@ class Theme:
24
23
  :param window: Window instance
25
24
  """
26
25
  self.window = window
26
+ self._loaded = False
27
+
28
+ def _on_toggle_tooltips(self, checked=False):
29
+ self.window.controller.theme.toggle_option('layout.tooltips')
30
+
31
+ def _open_settings(self, checked=False):
32
+ self.window.controller.settings.open_section('layout')
27
33
 
28
34
  def setup(self):
29
35
  """Setup theme menu"""
30
- self.window.ui.menu['theme'] = {}
31
- self.window.ui.menu['theme_style'] = {}
32
- self.window.ui.menu['theme_syntax'] = {}
33
- self.window.ui.menu['theme.layout.density'] = {}
34
- self.window.ui.menu['menu.theme'] = QMenu(trans("menu.theme"), self.window)
36
+ w = self.window
37
+ m = w.ui.menu
35
38
 
36
- # styles
37
- self.window.ui.menu['theme.style'] = QMenu(trans("menu.theme.style"), self.window)
39
+ if self._loaded:
40
+ act = m.get('theme.tooltips')
41
+ if isinstance(act, QAction):
42
+ act.setChecked(w.core.config.get('layout.tooltips'))
43
+ return
38
44
 
39
- # color themes
40
- self.window.ui.menu['theme.dark'] = QMenu(trans("menu.theme.dark"), self.window)
41
- self.window.ui.menu['theme.light'] = QMenu(trans("menu.theme.light"), self.window)
42
- self.window.ui.menu['theme.syntax'] = QMenu(trans("menu.theme.syntax"), self.window)
45
+ m['theme'] = {}
46
+ m['theme_style'] = {}
47
+ m['theme_syntax'] = {}
48
+ m['theme.layout.density'] = {}
49
+ m['menu.theme'] = QMenu(trans("menu.theme"), w)
43
50
 
44
- # layout density
45
- self.window.ui.menu['theme.density'] = QMenu(trans("menu.theme.density"), self.window)
51
+ m['theme.style'] = QMenu(trans("menu.theme.style"), w)
46
52
 
47
- """
48
- # blocks
49
- self.window.ui.menu['theme.blocks'] = QAction(trans("menu.theme.blocks"), self.window, checkable=True)
50
- self.window.ui.menu['theme.blocks'].triggered.connect(
51
- lambda: self.window.controller.theme.toggle_option('render.blocks'))
52
- self.window.ui.menu['theme.blocks'].setCheckable(True)
53
- self.window.ui.menu['theme.blocks'].setChecked(self.window.core.config.get('render.blocks'))
54
- """
53
+ m['theme.dark'] = QMenu(trans("menu.theme.dark"), w)
54
+ m['theme.light'] = QMenu(trans("menu.theme.light"), w)
55
+ m['theme.syntax'] = QMenu(trans("menu.theme.syntax"), w)
56
+
57
+ m['theme.density'] = QMenu(trans("menu.theme.density"), w)
58
+
59
+ m['theme.tooltips'] = QAction(trans("menu.theme.tooltips"), w, checkable=True)
60
+ m['theme.tooltips'].triggered.connect(self._on_toggle_tooltips)
61
+ m['theme.tooltips'].setChecked(w.core.config.get('layout.tooltips'))
62
+
63
+ m['theme.settings'] = QAction(QIcon(":/icons/settings_filled.svg"),
64
+ trans("menu.theme.settings"), w)
65
+ m['theme.settings'].setMenuRole(QAction.MenuRole.NoRole)
66
+ m['theme.settings'].triggered.connect(self._open_settings)
67
+
68
+ menu_theme = m['menu.theme']
69
+ menu_theme.addMenu(m['theme.style'])
70
+ menu_theme.addMenu(m['theme.dark'])
71
+ menu_theme.addMenu(m['theme.light'])
72
+ menu_theme.addMenu(m['theme.syntax'])
73
+ menu_theme.addMenu(m['theme.density'])
74
+ menu_theme.addAction(m['theme.tooltips'])
75
+ menu_theme.addAction(m['theme.settings'])
55
76
 
56
- # tooltips
57
- self.window.ui.menu['theme.tooltips'] = QAction(trans("menu.theme.tooltips"), self.window, checkable=True)
58
- self.window.ui.menu['theme.tooltips'].triggered.connect(
59
- lambda: self.window.controller.theme.toggle_option('layout.tooltips'))
60
- self.window.ui.menu['theme.tooltips'].setCheckable(True)
61
- self.window.ui.menu['theme.tooltips'].setChecked(self.window.core.config.get('layout.tooltips'))
62
-
63
- # settings
64
- self.window.ui.menu['theme.settings'] = QAction(QIcon(":/icons/settings_filled.svg"),
65
- trans("menu.theme.settings"), self.window)
66
- self.window.ui.menu['theme.settings'].setMenuRole(QAction.MenuRole.NoRole)
67
-
68
- self.window.ui.menu['theme.settings'].triggered.connect(
69
- lambda: self.window.controller.settings.open_section('layout'))
70
-
71
- self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.style'])
72
- self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.dark'])
73
- self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.light'])
74
- self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.syntax'])
75
- self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.density'])
76
- # self.window.ui.menu['menu.theme'].addAction(self.window.ui.menu['theme.blocks'])
77
- self.window.ui.menu['menu.theme'].addAction(self.window.ui.menu['theme.tooltips'])
78
- self.window.ui.menu['menu.theme'].addAction(self.window.ui.menu['theme.settings'])
77
+ self._loaded = True
@@ -6,13 +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: 2024.11.24 22:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtGui import QAction, QIcon
13
13
 
14
14
  from pygpt_net.utils import trans
15
- import pygpt_net.icons_rc
16
15
 
17
16
  class Tools:
18
17
  def __init__(self, window=None):
@@ -23,70 +22,67 @@ class Tools:
23
22
  """
24
23
  self.window = window
25
24
 
25
+ def _open_tab_action(self, checked=False):
26
+ action = self.window.sender()
27
+ self.window.controller.tools.open_tab(action.data())
28
+
29
+ def _toggle_assistant_store(self, checked=False):
30
+ self.window.controller.assistant.store.toggle_editor()
31
+
32
+ def _rebuild_ipython(self, checked=False):
33
+ self.window.core.plugins.get("cmd_code_interpreter").builder.build_and_restart()
34
+
35
+ def _rebuild_python_legacy(self, checked=False):
36
+ self.window.core.plugins.get("cmd_code_interpreter").docker.build_and_restart()
37
+
38
+ def _rebuild_system(self, checked=False):
39
+ self.window.core.plugins.get("cmd_system").docker.build_and_restart()
40
+
26
41
  def setup(self):
27
42
  """Setup tools menu"""
28
- # tab tools
29
- tab_tools = self.window.controller.tools.get_tab_tools()
30
- for key in tab_tools:
31
- self.window.ui.menu[key] = QAction(QIcon(":/icons/" + tab_tools[key][1] + ".svg"),
32
- trans("output.tab." + tab_tools[key][0]), self.window)
33
- self.window.ui.menu[key].triggered.connect(
34
- lambda checked=False, type=tab_tools[key][2] : self.window.controller.tools.open_tab(type)
35
- )
36
- self.window.ui.menu[key].setCheckable(False)
37
-
38
- # add menu
39
- self.window.ui.menu['menu.tools'] = self.window.menuBar().addMenu(trans("menu.tools"))
40
-
41
- # add tab tools
42
- for key in tab_tools:
43
- self.window.ui.menu['menu.tools'].addAction(self.window.ui.menu[key])
44
-
45
- # add custom tools
46
- actions = self.window.tools.setup_menu_actions()
43
+ window = self.window
44
+ ui_menu = window.ui.menu
45
+
46
+ tab_tools = window.controller.tools.get_tab_tools()
47
+ ui_menu['menu.tools'] = window.menuBar().addMenu(trans("menu.tools"))
48
+ menu_tools = ui_menu['menu.tools']
49
+
50
+ for key, val in tab_tools.items():
51
+ label_key, icon_name, type_ = val[0], val[1], val[2]
52
+ action = QAction(QIcon(f":/icons/{icon_name}.svg"), trans(f"output.tab.{label_key}"), window)
53
+ action.setCheckable(False)
54
+ action.triggered.connect(lambda checked=False, t=type_: window.controller.tools.open_tab(t))
55
+ ui_menu[key] = action
56
+ menu_tools.addAction(action)
57
+
58
+ actions = window.tools.setup_menu_actions()
47
59
  if len(actions) == 0:
48
60
  return
49
61
 
50
- # add separator
51
- self.window.ui.menu['menu.tools'].addSeparator()
62
+ menu_tools.addSeparator()
52
63
 
53
- # build custom tools menu
54
- for key in actions:
55
- self.window.ui.menu[key] = actions[key]
56
- self.window.ui.menu['menu.tools'].addAction(self.window.ui.menu[key])
64
+ for key, action in actions.items():
65
+ ui_menu[key] = action
66
+ menu_tools.addAction(action)
57
67
 
58
68
  # ------------------------------------------------- #
59
69
 
60
- # OpenAI vector stores
61
- self.window.ui.menu['menu.tools'].addSeparator()
62
- self.window.ui.menu['menu.tools.openai.stores'] = QAction(QIcon(":/icons/db.svg"),
63
- trans("dialog.assistant.store"), self.window)
64
- self.window.ui.menu['menu.tools'].addAction(self.window.ui.menu['menu.tools.openai.stores'])
65
- self.window.ui.menu['menu.tools.openai.stores'].triggered.connect(
66
- lambda: self.window.controller.assistant.store.toggle_editor()
67
- )
68
-
69
- # Docker images rebuild:
70
-
71
- # IPython container
72
- self.window.ui.menu['menu.tools'].addSeparator()
73
- self.window.ui.menu['menu.tools.ipython.rebuild'] = QAction(QIcon(":/icons/reload.svg"),
74
- "Rebuild IPython Docker Image", self.window)
75
- self.window.ui.menu['menu.tools'].addAction(self.window.ui.menu['menu.tools.ipython.rebuild'])
76
- self.window.ui.menu['menu.tools.ipython.rebuild'].triggered.connect(
77
- lambda: self.window.core.plugins.get("cmd_code_interpreter").builder.build_and_restart()
78
- )
79
- # Python Legacy container
80
- self.window.ui.menu['menu.tools.python_legacy.rebuild'] = QAction(QIcon(":/icons/reload.svg"),
81
- "Rebuild Python (Legacy) Docker Image", self.window)
82
- self.window.ui.menu['menu.tools'].addAction(self.window.ui.menu['menu.tools.python_legacy.rebuild'])
83
- self.window.ui.menu['menu.tools.python_legacy.rebuild'].triggered.connect(
84
- lambda: self.window.core.plugins.get("cmd_code_interpreter").docker.build_and_restart()
85
- )
86
- # System container
87
- self.window.ui.menu['menu.tools.system.rebuild'] = QAction(QIcon(":/icons/reload.svg"),
88
- "Rebuild System Sandbox Docker Image", self.window)
89
- self.window.ui.menu['menu.tools'].addAction(self.window.ui.menu['menu.tools.system.rebuild'])
90
- self.window.ui.menu['menu.tools.system.rebuild'].triggered.connect(
91
- lambda: self.window.core.plugins.get("cmd_system").docker.build_and_restart()
92
- )
70
+ menu_tools.addSeparator()
71
+ db_icon = QIcon(":/icons/db.svg")
72
+ ui_menu['menu.tools.openai.stores'] = QAction(db_icon, trans("dialog.assistant.store"), window)
73
+ menu_tools.addAction(ui_menu['menu.tools.openai.stores'])
74
+ ui_menu['menu.tools.openai.stores'].triggered.connect(self._toggle_assistant_store)
75
+
76
+ menu_tools.addSeparator()
77
+ reload_icon = QIcon(":/icons/reload.svg")
78
+ ui_menu['menu.tools.ipython.rebuild'] = QAction(reload_icon, "Rebuild IPython Docker Image", window)
79
+ menu_tools.addAction(ui_menu['menu.tools.ipython.rebuild'])
80
+ ui_menu['menu.tools.ipython.rebuild'].triggered.connect(self._rebuild_ipython)
81
+
82
+ ui_menu['menu.tools.python_legacy.rebuild'] = QAction(reload_icon, "Rebuild Python (Legacy) Docker Image", window)
83
+ menu_tools.addAction(ui_menu['menu.tools.python_legacy.rebuild'])
84
+ ui_menu['menu.tools.python_legacy.rebuild'].triggered.connect(self._rebuild_python_legacy)
85
+
86
+ ui_menu['menu.tools.system.rebuild'] = QAction(reload_icon, "Rebuild System Sandbox Docker Image", window)
87
+ menu_tools.addAction(ui_menu['menu.tools.system.rebuild'])
88
+ ui_menu['menu.tools.system.rebuild'].triggered.connect(self._rebuild_system)
@@ -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.03.20 06:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtGui import QAction
@@ -25,27 +25,22 @@ class Video:
25
25
 
26
26
  def setup(self):
27
27
  """Setup video menu"""
28
- self.window.ui.menu['video.capture'] = QAction(
29
- trans("menu.video.capture"),
30
- self.window,
31
- checkable=True,
32
- )
33
- self.window.ui.menu['video.capture'].setToolTip(trans('vision.capture.enable.tooltip'))
34
- self.window.ui.menu['video.capture'].triggered.connect(
35
- lambda: self.window.controller.camera.toggle(self.window.ui.menu['video.capture'].isChecked())
36
- )
37
-
38
- self.window.ui.menu['video.capture.auto'] = QAction(
39
- trans("menu.video.capture.auto"),
40
- self.window,
41
- checkable=True,
42
- )
43
- self.window.ui.menu['video.capture.auto'].setToolTip(trans('vision.capture.auto.tooltip'))
44
- self.window.ui.menu['video.capture.auto'].triggered.connect(
45
- lambda: self.window.controller.camera.toggle_auto(self.window.ui.menu['video.capture.auto'].isChecked())
46
- )
47
-
48
- self.window.ui.menu['menu.video'] = self.window.menuBar().addMenu(trans("menu.video"))
49
- self.window.ui.menu['menu.video'].addAction(self.window.ui.menu['video.capture'])
50
- self.window.ui.menu['menu.video'].addAction(self.window.ui.menu['video.capture.auto'])
51
- self.window.ui.menu['menu.video'].setToolTipsVisible(True)
28
+ w = self.window
29
+ ui_menu = w.ui.menu
30
+ cam = w.controller.camera
31
+
32
+ capture = QAction(trans("menu.video.capture"), w, checkable=True)
33
+ capture.setToolTip(trans('vision.capture.enable.tooltip'))
34
+ capture.triggered.connect(cam.toggle)
35
+
36
+ capture_auto = QAction(trans("menu.video.capture.auto"), w, checkable=True)
37
+ capture_auto.setToolTip(trans('vision.capture.auto.tooltip'))
38
+ capture_auto.triggered.connect(cam.toggle_auto)
39
+
40
+ menu_video = w.menuBar().addMenu(trans("menu.video"))
41
+ menu_video.addActions([capture, capture_auto])
42
+ menu_video.setToolTipsVisible(True)
43
+
44
+ ui_menu['video.capture'] = capture
45
+ ui_menu['video.capture.auto'] = capture_auto
46
+ ui_menu['menu.video'] = menu_video
pygpt_net/ui/tray.py CHANGED
@@ -6,14 +6,13 @@
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.16 00:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtGui import QAction, QIcon
13
13
  from PySide6.QtWidgets import QSystemTrayIcon, QMenu
14
14
 
15
15
  from pygpt_net.utils import trans
16
- import pygpt_net.icons_rc
17
16
 
18
17
 
19
18
  class Tray:
@@ -6,15 +6,13 @@
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.01.18 03:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtCore import Qt
13
13
  from PySide6.QtGui import QPainter, QPalette
14
14
  from PySide6.QtWidgets import QWidget
15
15
 
16
- import pygpt_net.icons_rc
17
-
18
16
  class InputBar(QWidget):
19
17
  def __init__(self, parent=None):
20
18
  super().__init__(parent)
@@ -6,19 +6,18 @@
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.22 15:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtCore import Qt
13
- from PySide6.QtGui import QPainter, QIcon
13
+ from PySide6.QtGui import QIcon
14
14
  from PySide6.QtWidgets import QLabel, QHBoxLayout, QWidget, QPushButton, QVBoxLayout
15
15
 
16
16
  from pygpt_net.core.events import Event, AppEvent
17
17
  from pygpt_net.ui.widget.option.toggle_label import ToggleLabel
18
18
  from pygpt_net.utils import trans
19
- from .bar import InputBar
20
19
 
21
- import pygpt_net.icons_rc
20
+ from .bar import InputBar
22
21
 
23
22
  class VoiceControlButton(QWidget):
24
23
  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: 2025.08.15 03:00:00 #
9
+ # Updated Date: 2025.08.24 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from typing import Tuple
@@ -17,7 +17,6 @@ from PySide6.QtWidgets import QCalendarWidget, QMenu
17
17
 
18
18
  from pygpt_net.core.tabs.tab import Tab
19
19
  from pygpt_net.utils import trans
20
- import pygpt_net.icons_rc
21
20
 
22
21
 
23
22
  class CalendarSelect(QCalendarWidget):