pygpt-net 2.6.3__py3-none-any.whl → 2.6.4__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 (66) hide show
  1. pygpt_net/CHANGELOG.txt +5 -0
  2. pygpt_net/__init__.py +1 -1
  3. pygpt_net/config.py +55 -65
  4. pygpt_net/controller/chat/chat.py +38 -35
  5. pygpt_net/controller/chat/render.py +144 -217
  6. pygpt_net/controller/chat/stream.py +51 -25
  7. pygpt_net/controller/config/config.py +39 -42
  8. pygpt_net/controller/config/field/checkbox.py +16 -12
  9. pygpt_net/controller/config/field/checkbox_list.py +36 -31
  10. pygpt_net/controller/config/field/cmd.py +51 -57
  11. pygpt_net/controller/config/field/combo.py +33 -16
  12. pygpt_net/controller/config/field/dictionary.py +48 -55
  13. pygpt_net/controller/config/field/input.py +50 -32
  14. pygpt_net/controller/config/field/slider.py +40 -45
  15. pygpt_net/controller/config/field/textarea.py +20 -6
  16. pygpt_net/controller/config/placeholder.py +110 -231
  17. pygpt_net/controller/lang/mapping.py +57 -95
  18. pygpt_net/controller/lang/plugins.py +64 -55
  19. pygpt_net/controller/lang/settings.py +39 -38
  20. pygpt_net/controller/layout/layout.py +11 -2
  21. pygpt_net/controller/plugins/plugins.py +19 -1
  22. pygpt_net/controller/ui/mode.py +107 -125
  23. pygpt_net/core/bridge/bridge.py +5 -5
  24. pygpt_net/core/command/command.py +149 -219
  25. pygpt_net/core/ctx/ctx.py +94 -146
  26. pygpt_net/core/debug/debug.py +48 -58
  27. pygpt_net/core/models/models.py +74 -112
  28. pygpt_net/core/modes/modes.py +13 -21
  29. pygpt_net/core/plugins/plugins.py +154 -177
  30. pygpt_net/core/presets/presets.py +103 -176
  31. pygpt_net/core/render/web/body.py +2 -3
  32. pygpt_net/core/render/web/renderer.py +109 -180
  33. pygpt_net/core/text/utils.py +28 -44
  34. pygpt_net/core/tokens/tokens.py +104 -203
  35. pygpt_net/data/config/config.json +2 -2
  36. pygpt_net/data/config/models.json +2 -2
  37. pygpt_net/item/ctx.py +141 -139
  38. pygpt_net/plugin/agent/plugin.py +2 -1
  39. pygpt_net/plugin/audio_output/plugin.py +5 -2
  40. pygpt_net/plugin/base/plugin.py +77 -93
  41. pygpt_net/plugin/bitbucket/plugin.py +3 -2
  42. pygpt_net/plugin/cmd_code_interpreter/plugin.py +3 -2
  43. pygpt_net/plugin/cmd_custom/plugin.py +3 -2
  44. pygpt_net/plugin/cmd_files/plugin.py +3 -2
  45. pygpt_net/plugin/cmd_history/plugin.py +3 -2
  46. pygpt_net/plugin/cmd_mouse_control/plugin.py +5 -2
  47. pygpt_net/plugin/cmd_serial/plugin.py +3 -2
  48. pygpt_net/plugin/cmd_system/plugin.py +3 -6
  49. pygpt_net/plugin/cmd_web/plugin.py +3 -2
  50. pygpt_net/plugin/experts/plugin.py +2 -2
  51. pygpt_net/plugin/facebook/plugin.py +3 -4
  52. pygpt_net/plugin/github/plugin.py +4 -2
  53. pygpt_net/plugin/google/plugin.py +3 -3
  54. pygpt_net/plugin/idx_llama_index/plugin.py +3 -2
  55. pygpt_net/plugin/mailer/plugin.py +3 -5
  56. pygpt_net/plugin/openai_vision/plugin.py +3 -2
  57. pygpt_net/plugin/real_time/plugin.py +52 -60
  58. pygpt_net/plugin/slack/plugin.py +3 -4
  59. pygpt_net/plugin/telegram/plugin.py +3 -4
  60. pygpt_net/plugin/twitter/plugin.py +3 -4
  61. pygpt_net/ui/widget/textarea/web.py +18 -14
  62. {pygpt_net-2.6.3.dist-info → pygpt_net-2.6.4.dist-info}/METADATA +7 -2
  63. {pygpt_net-2.6.3.dist-info → pygpt_net-2.6.4.dist-info}/RECORD +66 -66
  64. {pygpt_net-2.6.3.dist-info → pygpt_net-2.6.4.dist-info}/LICENSE +0 -0
  65. {pygpt_net-2.6.3.dist-info → pygpt_net-2.6.4.dist-info}/WHEEL +0 -0
  66. {pygpt_net-2.6.3.dist-info → pygpt_net-2.6.4.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.08.15 01:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import copy
@@ -22,13 +22,32 @@ from pygpt_net.utils import trans
22
22
 
23
23
 
24
24
  class BasePlugin(QObject):
25
+ DEFAULT_OPTION = {
26
+ "value": None,
27
+ "label": "",
28
+ "description": "",
29
+ "tooltip": None,
30
+ "min": None,
31
+ "max": None,
32
+ "multiplier": 1,
33
+ "step": 1,
34
+ "slider": False,
35
+ "keys": None,
36
+ "advanced": False,
37
+ "secret": False,
38
+ "persist": False,
39
+ "urls": None,
40
+ "use": None,
41
+ }
42
+ _ALLOW_OUTPUT_KEYS = ("request", "result", "context")
43
+ _IGNORE_EXTRA_KEYS = ("request", "context")
44
+
25
45
  def __init__(self, *args, **kwargs):
26
46
  super(BasePlugin, self).__init__()
27
47
  self.window = kwargs.get('window', None)
28
48
  self.id = ""
29
49
  self.name = ""
30
- self.type = [] # Types:
31
- # audio.input, audio.output, image.input, image.output, schedule, text.input, text.output, vision
50
+ self.type = []
32
51
  self.description = ""
33
52
  self.prefix = "Plugin"
34
53
  self.urls = {}
@@ -63,24 +82,8 @@ class BasePlugin(QObject):
63
82
  :param kwargs: additional keyword arguments for option properties
64
83
  :return: added option config dict
65
84
  """
66
- defaults = {
67
- "value": None,
68
- "label": "",
69
- "description": "",
70
- "tooltip": None,
71
- "min": None,
72
- "max": None,
73
- "multiplier": 1,
74
- "step": 1,
75
- "slider": False,
76
- "keys": None,
77
- "advanced": False,
78
- "secret": False,
79
- "persist": False,
80
- "urls": None,
81
- "use": None,
82
- }
83
- option = {**defaults, **kwargs}
85
+ option = BasePlugin.DEFAULT_OPTION.copy()
86
+ option.update(kwargs)
84
87
  option['tooltip'] = option['tooltip'] or option['description']
85
88
  option["id"] = name
86
89
  option["type"] = type
@@ -100,25 +103,24 @@ class BasePlugin(QObject):
100
103
  :return: added option config dict
101
104
  """
102
105
  cmd_syntax = {
103
- "instruction": "", # instruction for model
104
- "params": {}, # parameters
105
- "enabled": True, # enabled
106
+ "instruction": "",
107
+ "params": {},
108
+ "enabled": True,
106
109
  }
107
110
  if "instruction" in kwargs and isinstance(kwargs.get("instruction"), str):
108
111
  cmd_syntax["instruction"] = kwargs.get("instruction")
109
112
  kwargs.pop("instruction")
110
- if "params" in kwargs and isinstance(kwargs.get("params"), list):
113
+ if "params" in kwargs and isinstance(kwargs.get("params"), (dict, list)):
111
114
  cmd_syntax["params"] = kwargs.get("params")
112
115
  kwargs.pop("params")
113
116
  if "enabled" in kwargs and isinstance(kwargs.get("enabled"), bool):
114
117
  cmd_syntax["enabled"] = kwargs.get("enabled")
115
118
  kwargs.pop("enabled")
116
119
 
117
- name = "cmd." + cmd
120
+ name = f"cmd.{cmd}"
118
121
  kwargs["cmd"] = cmd
119
122
  kwargs["value"] = cmd_syntax
120
123
 
121
- # static keys
122
124
  kwargs["params_keys"] = {
123
125
  "name": "text",
124
126
  "type": {
@@ -142,11 +144,7 @@ class BasePlugin(QObject):
142
144
  :param cmd: command name
143
145
  :return: True if exists
144
146
  """
145
- key = "cmd." + cmd
146
- if key in self.options:
147
- if "value" in self.options[key] and "enabled" in self.options[key]["value"]:
148
- return self.options[key]["value"]["enabled"]
149
- return False
147
+ return bool(self.options.get(f"cmd.{cmd}", {}).get("value", {}).get("enabled", False))
150
148
 
151
149
  def cmd_allowed(
152
150
  self,
@@ -158,9 +156,7 @@ class BasePlugin(QObject):
158
156
  :param cmd: command name
159
157
  :return: True if allowed
160
158
  """
161
- if cmd in self.allowed_cmds:
162
- return True
163
- return False
159
+ return cmd in self.allowed_cmds
164
160
 
165
161
  def cmd_exe(self) -> bool:
166
162
  """
@@ -180,11 +176,13 @@ class BasePlugin(QObject):
180
176
  :param cmd: command name
181
177
  :return: command dict
182
178
  """
183
- key = "cmd." + cmd
184
- if key in self.options:
185
- data = copy.deepcopy(self.options[key]["value"]) # make copy to prevent changes in original data
179
+ key = f"cmd.{cmd}"
180
+ opt = self.options.get(key)
181
+ if opt:
182
+ data = copy.deepcopy(opt["value"])
186
183
  data = {"cmd": cmd, **data}
187
184
  return data
185
+ return None
188
186
 
189
187
  def has_option(
190
188
  self,
@@ -208,8 +206,7 @@ class BasePlugin(QObject):
208
206
  :param name: option name
209
207
  :return: option dict
210
208
  """
211
- if self.has_option(name):
212
- return self.options[name]
209
+ return self.options.get(name)
213
210
 
214
211
  def get_option_value(
215
212
  self,
@@ -221,15 +218,18 @@ class BasePlugin(QObject):
221
218
  :param name: option name
222
219
  :return: option value
223
220
  """
224
- if self.has_option(name):
225
- value = self.options[name]["value"]
226
- if self.options[name]["type"] == "bool":
227
- return bool(value)
228
- elif self.options[name]["type"] == "int":
229
- return int(value)
230
- elif self.options[name]["type"] == "float":
231
- return float(value)
232
- return self.options[name]["value"]
221
+ opt = self.options.get(name)
222
+ if not opt:
223
+ return None
224
+ value = opt["value"]
225
+ t = opt["type"]
226
+ if t == "bool":
227
+ return bool(value)
228
+ elif t == "int":
229
+ return int(value)
230
+ elif t == "float":
231
+ return float(value)
232
+ return value
233
233
 
234
234
  def set_option_value(
235
235
  self,
@@ -242,15 +242,18 @@ class BasePlugin(QObject):
242
242
  :param name: option name
243
243
  :param value: option value
244
244
  """
245
- if self.has_option(name):
246
- if self.options[name]["type"] == "bool":
247
- value = bool(value)
248
- elif self.options[name]["type"] == "int":
249
- value = int(value)
250
- elif self.options[name]["type"] == "float":
251
- value = float(value)
252
- self.options[name]["value"] = value
253
- self.refresh_option(name)
245
+ opt = self.options.get(name)
246
+ if not opt:
247
+ return
248
+ t = opt["type"]
249
+ if t == "bool":
250
+ value = bool(value)
251
+ elif t == "int":
252
+ value = int(value)
253
+ elif t == "float":
254
+ value = float(value)
255
+ opt["value"] = value
256
+ self.refresh_option(name)
254
257
 
255
258
  def attach(self, window):
256
259
  """
@@ -314,7 +317,7 @@ class BasePlugin(QObject):
314
317
  """
315
318
  if text is None:
316
319
  return ""
317
- domain = 'plugin.{}'.format(self.id)
320
+ domain = f'plugin.{self.id}'
318
321
  return trans(text, False, domain)
319
322
 
320
323
  def error(self, err: Any):
@@ -325,7 +328,7 @@ class BasePlugin(QObject):
325
328
  """
326
329
  self.window.core.debug.log(err)
327
330
  msg = self.window.core.debug.parse_alert(err)
328
- self.window.ui.dialogs.alert("{}: {}".format(self.name, msg))
331
+ self.window.ui.dialogs.alert(f"{self.name}: {msg}")
329
332
 
330
333
  def debug(self, data: Any, console: bool = True):
331
334
  """
@@ -365,10 +368,8 @@ class BasePlugin(QObject):
365
368
 
366
369
  :return: True if log is enabled
367
370
  """
368
- if self.window.core.config.has("log.plugins") \
369
- and self.window.core.config.get("log.plugins"):
370
- return True
371
- return False
371
+ cfg = self.window.core.config
372
+ return bool(cfg.has("log.plugins") and cfg.get("log.plugins"))
372
373
 
373
374
  def is_async(self, ctx: CtxItem) -> bool:
374
375
  """
@@ -387,12 +388,13 @@ class BasePlugin(QObject):
387
388
 
388
389
  :param msg: message to log
389
390
  """
390
- msg = "[{}] {}".format(self.prefix, msg)
391
- self.debug(msg, not self.is_log())
391
+ msg = f"[{self.prefix}] {msg}"
392
+ log_enabled = self.is_log()
393
+ self.debug(msg, not log_enabled)
392
394
  if self.is_threaded():
393
395
  return
394
396
  self.window.update_status(msg.replace("\n", " "))
395
- if self.is_log():
397
+ if log_enabled:
396
398
  print(msg)
397
399
 
398
400
  def cmd_prepare(self, ctx: CtxItem, cmds: list):
@@ -402,7 +404,6 @@ class BasePlugin(QObject):
402
404
  :param ctx: CtxItem
403
405
  :param cmds: commands dict
404
406
  """
405
- # set state: busy
406
407
  self.window.dispatch(KernelEvent(KernelEvent.STATE_BUSY, {
407
408
  "id": "img",
408
409
  }))
@@ -421,15 +422,11 @@ class BasePlugin(QObject):
421
422
  :param ctx: context (CtxItem)
422
423
  :param extra_data: extra data
423
424
  """
424
- # send response (reply)
425
425
  if ctx is not None:
426
426
  self.prepare_reply_ctx(response, ctx)
427
-
428
427
  context = BridgeContext()
429
428
  context.ctx = ctx
430
- extra = {}
431
- if extra_data:
432
- extra = extra_data
429
+ extra = extra_data if extra_data else {}
433
430
  extra["response_type"] = "single"
434
431
  event = KernelEvent(KernelEvent.REPLY_ADD, {
435
432
  'context': context,
@@ -451,16 +448,13 @@ class BasePlugin(QObject):
451
448
  :param ctx: context (CtxItem)
452
449
  :param extra_data: extra data
453
450
  """
454
- # send multiple responses (reply)
455
451
  for response in responses:
456
452
  if ctx is not None:
457
453
  self.prepare_reply_ctx(response, ctx)
458
454
 
459
455
  context = BridgeContext()
460
456
  context.ctx = ctx
461
- extra = {}
462
- if extra_data:
463
- extra = extra_data
457
+ extra = extra_data if extra_data else {}
464
458
  extra["response_type"] = "multiple"
465
459
  event = KernelEvent(KernelEvent.REPLY_ADD, {
466
460
  'context': context,
@@ -480,35 +474,26 @@ class BasePlugin(QObject):
480
474
  :param ctx: context (CtxItem)
481
475
  :return: response dict
482
476
  """
483
- ignore_extra = ["request", "context"]
484
- allow_output = ["request", "result", "context"]
485
- clean_response = {}
486
- for key in response:
487
- if key in allow_output or key.startswith("agent_"):
488
- clean_response[key] = response[key]
489
-
477
+ clean_response = {k: v for k, v in response.items() if k in self._ALLOW_OUTPUT_KEYS or k.startswith("agent_")}
490
478
  ctx.results.append(clean_response)
491
479
  ctx.reply = True
492
480
 
493
- extras = {}
494
- for key in response:
495
- if key not in ignore_extra:
496
- extras[key] = response[key]
481
+ extras = {k: v for k, v in response.items() if k not in self._IGNORE_EXTRA_KEYS}
497
482
 
498
- # add extra data to context, into `tool_output` list
499
483
  if not isinstance(ctx.extra, dict):
500
484
  ctx.extra = {}
501
485
  if "tool_output" not in ctx.extra:
502
486
  ctx.extra["tool_output"] = []
503
- ctx.extra["tool_output"].append(extras) # allow more extra data
487
+ ctx.extra["tool_output"].append(extras)
504
488
 
505
489
  if "context" in response:
506
- if self.window.core.config.get("ctx.use_extra"):
490
+ cfg = self.window.core.config
491
+ if cfg.get("ctx.use_extra"):
507
492
  if ctx.extra_ctx is None:
508
493
  ctx.extra_ctx = ""
509
494
  if ctx.extra_ctx != "":
510
495
  ctx.extra_ctx += "\n\n"
511
- ctx.extra_ctx += str(response["context"]) # allow more context data
496
+ ctx.extra_ctx += str(response["context"])
512
497
  response["result"] = "OK"
513
498
  else:
514
499
  del response["context"]
@@ -563,7 +548,6 @@ class BasePlugin(QObject):
563
548
  """
564
549
  return self.window.controller.kernel.is_threaded()
565
550
 
566
-
567
551
  def open_url(self, url: str):
568
552
  """
569
553
  Open URL in the default web browser
@@ -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 00:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.plugin.base.plugin import BasePlugin
@@ -14,7 +14,6 @@ from pygpt_net.core.events import Event
14
14
  from pygpt_net.item.ctx import CtxItem
15
15
 
16
16
  from .config import Config
17
- from .worker import Worker
18
17
 
19
18
 
20
19
  class Plugin(BasePlugin):
@@ -97,6 +96,8 @@ class Plugin(BasePlugin):
97
96
  :param ctx: CtxItem
98
97
  :param cmds: commands dict
99
98
  """
99
+ from .worker import Worker
100
+
100
101
  is_cmd = False
101
102
  my_commands = []
102
103
  for item in cmds:
@@ -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.07.17 19:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -26,7 +26,6 @@ from .ipython import LocalKernel
26
26
  from .ipython import DockerKernel
27
27
  from .output import Output
28
28
  from .runner import Runner
29
- from .worker import Worker
30
29
 
31
30
  from pygpt_net.utils import trans
32
31
 
@@ -151,6 +150,8 @@ class Plugin(BasePlugin):
151
150
  :param cmds: commands dict
152
151
  :param silent: silent mode
153
152
  """
153
+ from .worker import Worker
154
+
154
155
  is_cmd = False
155
156
  force = False
156
157
  my_commands = []
@@ -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.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.plugin.base.plugin import BasePlugin
@@ -14,7 +14,6 @@ from pygpt_net.core.events import Event
14
14
  from pygpt_net.item.ctx import CtxItem
15
15
 
16
16
  from .config import Config
17
- from .worker import Worker
18
17
 
19
18
 
20
19
  class Plugin(BasePlugin):
@@ -83,6 +82,8 @@ class Plugin(BasePlugin):
83
82
  :param ctx: CtxItem
84
83
  :param cmds: commands dict
85
84
  """
85
+ from .worker import Worker
86
+
86
87
  is_cmd = False
87
88
  my_commands = []
88
89
  for item in cmds:
@@ -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.07.14 00:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -17,7 +17,6 @@ from pygpt_net.item.ctx import CtxItem
17
17
 
18
18
  from .config import Config
19
19
  from .output import Output
20
- from .worker import Worker
21
20
 
22
21
 
23
22
  class Plugin(BasePlugin):
@@ -130,6 +129,8 @@ class Plugin(BasePlugin):
130
129
  :param ctx: CtxItem
131
130
  :param cmds: commands dict
132
131
  """
132
+ from .worker import Worker
133
+
133
134
  is_cmd = False
134
135
  my_commands = []
135
136
  for item in cmds:
@@ -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.06.30 02:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
@@ -21,7 +21,6 @@ from pygpt_net.core.events import Event, KernelEvent
21
21
  from pygpt_net.item.ctx import CtxItem
22
22
 
23
23
  from .config import Config
24
- from .worker import Worker
25
24
 
26
25
 
27
26
  class Plugin(BasePlugin):
@@ -201,6 +200,8 @@ class Plugin(BasePlugin):
201
200
  :param ctx: CtxItem
202
201
  :param cmds: commands dict
203
202
  """
203
+ from .worker import Worker
204
+
204
205
  is_cmd = False
205
206
  my_commands = []
206
207
  for item in cmds:
@@ -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.07.30 00:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from PySide6.QtCore import Slot, QTimer
@@ -17,7 +17,6 @@ from pygpt_net.core.events import Event, KernelEvent
17
17
  from pygpt_net.item.ctx import CtxItem
18
18
 
19
19
  from .config import Config
20
- from .worker import Worker
21
20
 
22
21
 
23
22
  class Plugin(BasePlugin):
@@ -93,6 +92,8 @@ class Plugin(BasePlugin):
93
92
  :param ctx: CtxItem
94
93
  :param cmds: commands dict
95
94
  """
95
+ from .worker import Worker
96
+
96
97
  is_cmd = False
97
98
  my_commands = []
98
99
  for item in cmds:
@@ -128,6 +129,8 @@ class Plugin(BasePlugin):
128
129
  :param item: command item to execute
129
130
  :return:
130
131
  """
132
+ from .worker import Worker
133
+
131
134
  item["params"]["no_screenshot"] = True # do not take screenshot for single command call
132
135
  worker = Worker()
133
136
  worker.from_defaults(self)
@@ -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.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.plugin.base.plugin import BasePlugin
@@ -14,7 +14,6 @@ from pygpt_net.core.events import Event
14
14
  from pygpt_net.item.ctx import CtxItem
15
15
 
16
16
  from .config import Config
17
- from .worker import Worker
18
17
 
19
18
 
20
19
  class Plugin(BasePlugin):
@@ -77,6 +76,8 @@ class Plugin(BasePlugin):
77
76
  :param ctx: CtxItem
78
77
  :param cmds: commands dict
79
78
  """
79
+ from .worker import Worker
80
+
80
81
  is_cmd = False
81
82
  my_commands = []
82
83
  for item in cmds:
@@ -6,13 +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.11.24 06:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
- import os
13
-
14
- from PySide6.QtCore import Slot
15
-
16
12
  from pygpt_net.plugin.base.plugin import BasePlugin
17
13
  from pygpt_net.core.events import Event
18
14
  from pygpt_net.item.ctx import CtxItem
@@ -21,7 +17,6 @@ from .config import Config
21
17
  from .docker import Docker
22
18
  from .output import Output
23
19
  from .runner import Runner
24
- from .worker import Worker
25
20
 
26
21
  from pygpt_net.utils import trans
27
22
 
@@ -110,6 +105,8 @@ class Plugin(BasePlugin):
110
105
  :param cmds: commands dict
111
106
  :param silent: silent mode
112
107
  """
108
+ from .worker import Worker
109
+
113
110
  is_cmd = False
114
111
  force = False
115
112
  my_commands = []
@@ -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.06.30 02:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import ssl
@@ -19,7 +19,6 @@ from pygpt_net.item.ctx import CtxItem
19
19
 
20
20
  from .config import Config
21
21
  from .websearch import WebSearch
22
- from .worker import Worker
23
22
 
24
23
 
25
24
  class Plugin(BasePlugin):
@@ -347,6 +346,8 @@ class Plugin(BasePlugin):
347
346
  :param ctx: CtxItem
348
347
  :param cmds: commands dict
349
348
  """
349
+ from .worker import Worker
350
+
350
351
  my_commands = []
351
352
  for item in cmds:
352
353
  if item["cmd"] in self.allowed_cmds and self.has_cmd(item["cmd"]):
@@ -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.21 20:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.core.types import (
@@ -33,7 +33,7 @@ class Plugin(BasePlugin):
33
33
  ]
34
34
  self.order = 9998
35
35
  self.use_locale = True
36
- self.disallowed_modes = [MODE_AGENT, MODE_EXPERT]
36
+ self.disallowed_modes = (MODE_AGENT, MODE_EXPERT)
37
37
  self.config = Config(self)
38
38
  self.init_options()
39
39
 
@@ -6,17 +6,14 @@
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.14 00:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
- import os
13
-
14
12
  from pygpt_net.plugin.base.plugin import BasePlugin
15
13
  from pygpt_net.core.events import Event
16
14
  from pygpt_net.item.ctx import CtxItem
17
15
 
18
16
  from .config import Config
19
- from .worker import Worker
20
17
 
21
18
 
22
19
  class Plugin(BasePlugin):
@@ -86,6 +83,8 @@ class Plugin(BasePlugin):
86
83
  :param ctx: CtxItem
87
84
  :param cmds: commands dict
88
85
  """
86
+ from .worker import Worker
87
+
89
88
  is_cmd = False
90
89
  my_commands = []
91
90
  for item in cmds:
@@ -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 00:00:00 #
9
+ # Updated Date: 2025.08.15 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.plugin.base.plugin import BasePlugin
@@ -14,7 +14,6 @@ from pygpt_net.core.events import Event
14
14
  from pygpt_net.item.ctx import CtxItem
15
15
 
16
16
  from .config import Config
17
- from .worker import Worker
18
17
 
19
18
 
20
19
  class Plugin(BasePlugin):
@@ -96,6 +95,9 @@ class Plugin(BasePlugin):
96
95
  :param ctx: CtxItem
97
96
  :param cmds: commands dict
98
97
  """
98
+
99
+ from .worker import Worker
100
+
99
101
  is_cmd = False
100
102
  my_commands = []
101
103
  for item in cmds: