pygpt-net 2.6.60__py3-none-any.whl → 2.6.61__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 (60) hide show
  1. pygpt_net/CHANGELOG.txt +7 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/controller/chat/common.py +115 -6
  4. pygpt_net/controller/chat/input.py +4 -1
  5. pygpt_net/controller/presets/presets.py +121 -6
  6. pygpt_net/controller/settings/editor.py +0 -15
  7. pygpt_net/controller/theme/markdown.py +2 -5
  8. pygpt_net/controller/ui/ui.py +4 -7
  9. pygpt_net/core/agents/custom/__init__.py +7 -1
  10. pygpt_net/core/agents/custom/llama_index/factory.py +17 -6
  11. pygpt_net/core/agents/custom/llama_index/runner.py +35 -2
  12. pygpt_net/core/agents/custom/llama_index/utils.py +12 -1
  13. pygpt_net/core/agents/custom/router.py +45 -6
  14. pygpt_net/core/agents/custom/runner.py +2 -1
  15. pygpt_net/core/agents/custom/schema.py +3 -1
  16. pygpt_net/core/agents/custom/utils.py +13 -1
  17. pygpt_net/core/db/viewer.py +11 -5
  18. pygpt_net/core/node_editor/graph.py +18 -9
  19. pygpt_net/core/node_editor/models.py +9 -2
  20. pygpt_net/core/node_editor/types.py +3 -1
  21. pygpt_net/core/presets/presets.py +216 -29
  22. pygpt_net/core/render/markdown/parser.py +0 -2
  23. pygpt_net/data/config/config.json +5 -6
  24. pygpt_net/data/config/models.json +3 -3
  25. pygpt_net/data/config/settings.json +2 -38
  26. pygpt_net/data/locale/locale.de.ini +64 -1
  27. pygpt_net/data/locale/locale.en.ini +62 -3
  28. pygpt_net/data/locale/locale.es.ini +64 -1
  29. pygpt_net/data/locale/locale.fr.ini +64 -1
  30. pygpt_net/data/locale/locale.it.ini +64 -1
  31. pygpt_net/data/locale/locale.pl.ini +65 -2
  32. pygpt_net/data/locale/locale.uk.ini +64 -1
  33. pygpt_net/data/locale/locale.zh.ini +64 -1
  34. pygpt_net/data/locale/plugin.cmd_system.en.ini +62 -66
  35. pygpt_net/provider/agents/llama_index/flow_from_schema.py +2 -2
  36. pygpt_net/provider/core/config/patch.py +10 -1
  37. pygpt_net/provider/core/config/patches/patch_before_2_6_42.py +0 -6
  38. pygpt_net/tools/agent_builder/tool.py +42 -26
  39. pygpt_net/tools/agent_builder/ui/dialogs.py +60 -11
  40. pygpt_net/ui/__init__.py +2 -4
  41. pygpt_net/ui/dialog/about.py +58 -38
  42. pygpt_net/ui/dialog/db.py +142 -3
  43. pygpt_net/ui/dialog/preset.py +47 -8
  44. pygpt_net/ui/layout/toolbox/presets.py +52 -16
  45. pygpt_net/ui/widget/dialog/db.py +0 -0
  46. pygpt_net/ui/widget/lists/preset.py +644 -60
  47. pygpt_net/ui/widget/node_editor/command.py +10 -10
  48. pygpt_net/ui/widget/node_editor/config.py +157 -0
  49. pygpt_net/ui/widget/node_editor/editor.py +183 -151
  50. pygpt_net/ui/widget/node_editor/item.py +12 -11
  51. pygpt_net/ui/widget/node_editor/node.py +267 -12
  52. pygpt_net/ui/widget/node_editor/view.py +180 -63
  53. pygpt_net/ui/widget/tabs/output.py +1 -1
  54. pygpt_net/ui/widget/textarea/input.py +2 -2
  55. pygpt_net/utils.py +114 -2
  56. {pygpt_net-2.6.60.dist-info → pygpt_net-2.6.61.dist-info}/METADATA +11 -94
  57. {pygpt_net-2.6.60.dist-info → pygpt_net-2.6.61.dist-info}/RECORD +59 -58
  58. {pygpt_net-2.6.60.dist-info → pygpt_net-2.6.61.dist-info}/LICENSE +0 -0
  59. {pygpt_net-2.6.60.dist-info → pygpt_net-2.6.61.dist-info}/WHEEL +0 -0
  60. {pygpt_net-2.6.60.dist-info → pygpt_net-2.6.61.dist-info}/entry_points.txt +0 -0
@@ -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.24 00:00:00 #
9
+ # Updated Date: 2025.09.25 11:30:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from __future__ import annotations
@@ -33,7 +33,7 @@ class AddNodeCommand(QUndoCommand):
33
33
  type_name: Registered node type name.
34
34
  scene_pos: Target scene position to place the node.
35
35
  """
36
- super().__init__(f"Add {type_name}")
36
+ super().__init__(editor.config.cmd_add_node(type_name))
37
37
  self.editor = editor
38
38
  self.type_name = type_name
39
39
  self.scene_pos = scene_pos
@@ -67,7 +67,7 @@ class MoveNodeCommand(QUndoCommand):
67
67
 
68
68
  def __init__(self, item: "NodeItem", old_pos: QPointF, new_pos: QPointF):
69
69
  """Store references and positions for undo/redo."""
70
- super().__init__("Move Node")
70
+ super().__init__(item.editor.config.cmd_move_node())
71
71
  self.item = item
72
72
  self.old_pos = old_pos
73
73
  self.new_pos = new_pos
@@ -86,7 +86,7 @@ class ResizeNodeCommand(QUndoCommand):
86
86
 
87
87
  def __init__(self, item: "NodeItem", old_size: QSizeF, new_size: QSizeF):
88
88
  """Store sizes for undo/redo (QSizeF copies kept)."""
89
- super().__init__("Resize Node")
89
+ super().__init__(item.editor.config.cmd_resize_node())
90
90
  self.item = item
91
91
  self.old_size = QSizeF(old_size)
92
92
  self.new_size = QSizeF(new_size)
@@ -111,7 +111,7 @@ class ConnectCommand(QUndoCommand):
111
111
  src: Source PortItem (output).
112
112
  dst: Destination PortItem (input).
113
113
  """
114
- super().__init__("Connect")
114
+ super().__init__(editor.config.cmd_connect())
115
115
  self.editor = editor
116
116
  self.src_port = src
117
117
  self.dst_port = dst
@@ -161,7 +161,7 @@ class RewireConnectionCommand(QUndoCommand):
161
161
  new_src: New source port (or None to delete).
162
162
  new_dst: New destination port (or None to delete).
163
163
  """
164
- title = "Delete Connection" if (new_src is None or new_dst is None) else "Rewire Connection"
164
+ title = editor.config.cmd_delete_connection() if (new_src is None or new_dst is None) else editor.config.cmd_rewire_connection()
165
165
  super().__init__(title)
166
166
  self.editor = editor
167
167
  self.old_conn_data = old_conn.to_dict()
@@ -206,7 +206,7 @@ class ClearGraphCommand(QUndoCommand):
206
206
 
207
207
  def __init__(self, editor: "NodeEditor"):
208
208
  """Take an internal snapshot on first redo to enable undo restoration."""
209
- super().__init__("Clear")
209
+ super().__init__(editor.config.cmd_clear())
210
210
  self.editor = editor
211
211
  self._snapshot: Optional[dict] = None
212
212
 
@@ -234,7 +234,7 @@ class DeleteConnectionCommand(QUndoCommand):
234
234
  editor: Owning NodeEditor.
235
235
  conn: Existing ConnectionModel to delete/restore.
236
236
  """
237
- super().__init__("Delete Connection")
237
+ super().__init__(editor.config.cmd_delete_connection())
238
238
  self.editor = editor
239
239
  self.conn_uuid: Optional[str] = conn.uuid
240
240
  # Keep a serializable snapshot for undo
@@ -280,7 +280,7 @@ class DeleteNodeCommand(QUndoCommand):
280
280
  editor: Owning NodeEditor.
281
281
  item: NodeItem to delete (used only to take a snapshot at construction time).
282
282
  """
283
- super().__init__("Delete Node")
283
+ super().__init__(editor.config.cmd_delete_node())
284
284
  self.editor = editor
285
285
  node = item.node
286
286
  self.node_uuid: str = node.uuid
@@ -370,4 +370,4 @@ class DeleteNodeCommand(QUndoCommand):
370
370
  self.editor.graph.connect((s_n, s_p), (d_n, d_p))
371
371
  except Exception:
372
372
  # Best-effort: ignore a single failing connection to not break the undo sequence
373
- pass
373
+ pass
@@ -0,0 +1,157 @@
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.25 11:30:00 #
10
+ # ================================================== #
11
+
12
+ from __future__ import annotations
13
+
14
+ try:
15
+ from pygpt_net.utils import trans as _trans
16
+ except Exception:
17
+ _trans = None
18
+
19
+
20
+ class EditorConfig:
21
+ """Central place for all user-facing strings used by NodeEditor.
22
+
23
+ Each method returns a final string. If a translator (pygpt_net.utils.trans)
24
+ is available, keys are looked up; otherwise English defaults are used.
25
+ """
26
+
27
+ def _t(self, key: str, default: str) -> str:
28
+ try:
29
+ if _trans is None:
30
+ return default
31
+ val = _trans(key)
32
+ # Fallback to default when translator returns key or empty
33
+ if not val or val == key:
34
+ return default
35
+ return val
36
+ except Exception:
37
+ return default
38
+
39
+ # ----- Commands / Undo text -----
40
+
41
+ def cmd_add_node(self, type_name: str) -> str:
42
+ return f"{self._t('node.editor.cmd.add', 'Add')} {type_name}"
43
+
44
+ def cmd_move_node(self) -> str:
45
+ return self._t('node.editor.cmd.move_node', 'Move Node')
46
+
47
+ def cmd_resize_node(self) -> str:
48
+ return self._t('node.editor.cmd.resize_node', 'Resize Node')
49
+
50
+ def cmd_connect(self) -> str:
51
+ return self._t('node.editor.cmd.connect', 'Connect')
52
+
53
+ def cmd_rewire_connection(self) -> str:
54
+ return self._t('node.editor.cmd.rewire_connection', 'Rewire Connection')
55
+
56
+ def cmd_delete_connection(self) -> str:
57
+ return self._t('node.editor.cmd.delete_connection', 'Delete Connection')
58
+
59
+ def cmd_delete_node(self) -> str:
60
+ return self._t('node.editor.cmd.delete_node', 'Delete Node')
61
+
62
+ def cmd_clear(self) -> str:
63
+ return self._t('node.editor.cmd.clear', 'Clear')
64
+
65
+ def macro_delete_selection(self) -> str:
66
+ return self._t('node.editor.macro.delete_selection', 'Delete selection')
67
+
68
+ # ----- Scene / Context menus -----
69
+
70
+ def menu_add(self) -> str:
71
+ return self._t('node.editor.menu.add', 'Add')
72
+
73
+ def menu_undo(self) -> str:
74
+ return self._t('node.editor.menu.undo', 'Undo')
75
+
76
+ def menu_redo(self) -> str:
77
+ return self._t('node.editor.menu.redo', 'Redo')
78
+
79
+ def menu_clear(self) -> str:
80
+ return self._t('node.editor.menu.clear', 'Clear')
81
+
82
+ def edge_context_delete(self) -> str:
83
+ return self._t('node.editor.edge.delete', 'Delete connection')
84
+
85
+ def node_context_rename(self) -> str:
86
+ return self._t('node.editor.node.rename', 'Rename')
87
+
88
+ def node_context_delete(self) -> str:
89
+ return self._t('node.editor.node.delete', 'Delete')
90
+
91
+ def rename_dialog_title(self) -> str:
92
+ return self._t('node.editor.rename.title', 'Rename Node')
93
+
94
+ def rename_dialog_label(self) -> str:
95
+ return self._t('node.editor.rename.label', 'Name:')
96
+
97
+ # ----- Overlays / Status -----
98
+
99
+ def overlay_grab_tooltip(self) -> str:
100
+ return self._t('node.editor.overlay.grab', 'Grab: toggle global panning with Left Mouse Button')
101
+
102
+ def overlay_zoom_in_tooltip(self) -> str:
103
+ return self._t('node.editor.overlay.zoom_in', 'Zoom In')
104
+
105
+ def overlay_zoom_out_tooltip(self) -> str:
106
+ return self._t('node.editor.overlay.zoom_out', 'Zoom Out')
107
+
108
+ def status_no_nodes(self) -> str:
109
+ return self._t('node.editor.status.no_nodes', 'No nodes')
110
+
111
+ def type_unknown(self) -> str:
112
+ return self._t('node.editor.type.unknown', 'Unknown')
113
+
114
+ # ----- Labels / Tooltips -----
115
+
116
+ def label_id(self) -> str:
117
+ return self._t('node.editor.label.id', 'ID')
118
+
119
+ def lbl_node(self) -> str:
120
+ return self._t('node.editor.lbl.node', 'Node:')
121
+
122
+ def lbl_port(self) -> str:
123
+ return self._t('node.editor.lbl.port', 'Port:')
124
+
125
+ def lbl_allowed_connections(self) -> str:
126
+ return self._t('node.editor.lbl.allowed', 'Allowed connections:')
127
+
128
+ def cap_unlimited(self) -> str:
129
+ return self._t('node.editor.cap.unlimited', 'unlimited (∞)')
130
+
131
+ def cap_na(self) -> str:
132
+ return self._t('node.editor.cap.na', 'n/a')
133
+
134
+ def side_label(self, side: str) -> str:
135
+ if side == "input":
136
+ return self._t('node.editor.side.input', 'Input')
137
+ if side == "output":
138
+ return self._t('node.editor.side.output', 'Output')
139
+ return side
140
+
141
+ def hint_click_start(self) -> str:
142
+ return self._t('node.editor.hint.click_start', 'Click: start a new connection')
143
+
144
+ def hint_ctrl_click_rewire(self) -> str:
145
+ return self._t('node.editor.hint.ctrl_rewire', 'Ctrl+Click: rewire/detach existing')
146
+
147
+ def port_tooltip(self, node_name: str, side_label: str, prop_id: str, cap_str: str) -> str:
148
+ return (
149
+ f"{self.lbl_node()} {node_name}\n"
150
+ f"{self.lbl_port()} {side_label} • {prop_id}\n"
151
+ f"{self.lbl_allowed_connections()} {cap_str}\n\n"
152
+ f"{self.hint_click_start()}\n"
153
+ f"{self.hint_ctrl_click_rewire()}"
154
+ )
155
+
156
+ def port_capacity_tooltip(self, cap_text: str) -> str:
157
+ return f"{self.lbl_allowed_connections()} (IN/OUT): {cap_text}"