pygpt-net 2.5.94__py3-none-any.whl → 2.5.96__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 (70) hide show
  1. pygpt_net/CHANGELOG.txt +11 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/controller/chat/output.py +5 -3
  4. pygpt_net/controller/chat/response.py +1 -1
  5. pygpt_net/controller/chat/stream.py +171 -207
  6. pygpt_net/controller/chat/text.py +3 -1
  7. pygpt_net/controller/ctx/ctx.py +5 -5
  8. pygpt_net/controller/dialogs/confirm.py +4 -1
  9. pygpt_net/controller/kernel/kernel.py +200 -223
  10. pygpt_net/controller/presets/editor.py +117 -1
  11. pygpt_net/controller/ui/mode.py +1 -3
  12. pygpt_net/controller/ui/tabs.py +58 -40
  13. pygpt_net/core/bridge/worker.py +7 -11
  14. pygpt_net/core/ctx/bag.py +2 -4
  15. pygpt_net/core/ctx/container.py +3 -4
  16. pygpt_net/core/ctx/ctx.py +5 -2
  17. pygpt_net/core/ctx/output.py +137 -93
  18. pygpt_net/core/dispatcher/dispatcher.py +60 -80
  19. pygpt_net/core/idx/chat.py +0 -21
  20. pygpt_net/core/presets/presets.py +12 -1
  21. pygpt_net/core/prompt/prompt.py +10 -1
  22. pygpt_net/core/render/web/body.py +873 -861
  23. pygpt_net/core/render/web/helpers.py +98 -51
  24. pygpt_net/core/render/web/parser.py +144 -126
  25. pygpt_net/core/render/web/renderer.py +388 -289
  26. pygpt_net/core/tabs/tabs.py +40 -5
  27. pygpt_net/core/text/text.py +31 -2
  28. pygpt_net/data/config/config.json +6 -4
  29. pygpt_net/data/config/models.json +3 -3
  30. pygpt_net/data/config/settings.json +28 -1
  31. pygpt_net/data/config/settings_section.json +3 -0
  32. pygpt_net/data/css/web-blocks.css +13 -2
  33. pygpt_net/data/css/web-blocks.dark.css +3 -0
  34. pygpt_net/data/css/web-blocks.light.css +3 -0
  35. pygpt_net/data/css/web-chatgpt.css +19 -2
  36. pygpt_net/data/css/web-chatgpt.dark.css +3 -0
  37. pygpt_net/data/css/web-chatgpt.light.css +3 -0
  38. pygpt_net/data/css/web-chatgpt_wide.css +19 -2
  39. pygpt_net/data/css/web-chatgpt_wide.dark.css +3 -0
  40. pygpt_net/data/css/web-chatgpt_wide.light.css +3 -0
  41. pygpt_net/data/locale/locale.de.ini +19 -0
  42. pygpt_net/data/locale/locale.en.ini +19 -0
  43. pygpt_net/data/locale/locale.es.ini +19 -0
  44. pygpt_net/data/locale/locale.fr.ini +19 -0
  45. pygpt_net/data/locale/locale.it.ini +19 -0
  46. pygpt_net/data/locale/locale.pl.ini +19 -0
  47. pygpt_net/data/locale/locale.uk.ini +19 -0
  48. pygpt_net/data/locale/locale.zh.ini +19 -0
  49. pygpt_net/item/ctx.py +11 -1
  50. pygpt_net/item/preset.py +9 -1
  51. pygpt_net/launcher.py +4 -1
  52. pygpt_net/provider/agents/openai/agent_b2b.py +17 -12
  53. pygpt_net/provider/core/config/patch.py +21 -1
  54. pygpt_net/provider/core/preset/json_file.py +6 -0
  55. pygpt_net/tools/translator/tool.py +9 -2
  56. pygpt_net/tools/translator/ui/widgets.py +45 -3
  57. pygpt_net/ui/base/config_dialog.py +1 -1
  58. pygpt_net/ui/dialog/preset.py +126 -8
  59. pygpt_net/ui/layout/chat/input.py +4 -2
  60. pygpt_net/ui/layout/ctx/ctx_list.py +106 -104
  61. pygpt_net/ui/layout/toolbox/presets.py +4 -0
  62. pygpt_net/ui/main.py +6 -1
  63. pygpt_net/ui/widget/textarea/search_input.py +68 -2
  64. pygpt_net/ui/widget/textarea/web.py +162 -164
  65. pygpt_net/utils.py +48 -2
  66. {pygpt_net-2.5.94.dist-info → pygpt_net-2.5.96.dist-info}/METADATA +19 -2
  67. {pygpt_net-2.5.94.dist-info → pygpt_net-2.5.96.dist-info}/RECORD +70 -70
  68. {pygpt_net-2.5.94.dist-info → pygpt_net-2.5.96.dist-info}/LICENSE +0 -0
  69. {pygpt_net-2.5.94.dist-info → pygpt_net-2.5.96.dist-info}/WHEEL +0 -0
  70. {pygpt_net-2.5.94.dist-info → pygpt_net-2.5.96.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt CHANGED
@@ -1,3 +1,14 @@
1
+ 2.5.96 (2025-08-10)
2
+
3
+ - Fixed memory leaks.
4
+
5
+ 2.5.95 (2025-08-09)
6
+
7
+ - Added user info personalization in Config -> Personalization, where you can provide information about yourself to the model.
8
+ - Added presets personalization with configurable AI names and avatars.
9
+ - Added a search field in the Translator tool.
10
+ - Fixed <> tags replacement in code blocks.
11
+
1
12
  2.5.94 (2025-08-09)
2
13
 
3
14
  - Added a new LLM provider: HuggingFace Router.
pygpt_net/__init__.py CHANGED
@@ -6,15 +6,15 @@
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.09 00:00:00 #
9
+ # Updated Date: 2025.08.10 00:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  __author__ = "Marcin Szczygliński"
13
13
  __copyright__ = "Copyright 2025, Marcin Szczygliński"
14
14
  __credits__ = ["Marcin Szczygliński"]
15
15
  __license__ = "MIT"
16
- __version__ = "2.5.94"
17
- __build__ = "2025-08-09"
16
+ __version__ = "2.5.96"
17
+ __build__ = "2025-08-10"
18
18
  __maintainer__ = "Marcin Szczygliński"
19
19
  __github__ = "https://github.com/szczyglis-dev/py-gpt"
20
20
  __report__ = "https://github.com/szczyglis-dev/py-gpt/issues"
@@ -6,10 +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.08.07 03:00:00 #
9
+ # Updated Date: 2025.08.11 00:00:00 #
10
10
  # ================================================== #
11
11
 
12
- import gc
13
12
  from typing import Any, Optional
14
13
 
15
14
  from pygpt_net.core.bridge import BridgeContext
@@ -20,6 +19,7 @@ from pygpt_net.core.types import (
20
19
  )
21
20
  from pygpt_net.core.events import Event, AppEvent, RenderEvent, KernelEvent
22
21
  from pygpt_net.item.ctx import CtxItem
22
+ from pygpt_net.utils import mem_clean
23
23
 
24
24
 
25
25
  class Output:
@@ -294,8 +294,10 @@ class Output:
294
294
  event = RenderEvent(RenderEvent.RELOAD)
295
295
  self.window.dispatch(event) # reload chat window
296
296
 
297
+ del ctx.prev_ctx # clear previous context to free memory
298
+ mem_clean()
299
+
297
300
  # self.window.core.debug.mem("END") # debug memory usage
298
- # gc.collect()
299
301
 
300
302
  def log(self, data: Any):
301
303
  """
@@ -181,7 +181,7 @@ class Response:
181
181
  # at first, handle previous context (user input) if not handled yet
182
182
  prev_ctx = ctx.prev_ctx
183
183
  stream = False
184
- if prev_ctx.current:
184
+ if prev_ctx and prev_ctx.current:
185
185
  prev_ctx.current = False # reset previous context
186
186
  self.window.core.ctx.update_item(prev_ctx)
187
187
  prev_ctx.from_previous() # append previous result if exists