pygpt-net 2.5.95__py3-none-any.whl → 2.5.97__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 (35) hide show
  1. pygpt_net/CHANGELOG.txt +8 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/controller/chat/output.py +4 -3
  4. pygpt_net/controller/chat/response.py +1 -1
  5. pygpt_net/controller/chat/stream.py +171 -207
  6. pygpt_net/controller/ctx/ctx.py +5 -5
  7. pygpt_net/controller/kernel/kernel.py +200 -223
  8. pygpt_net/core/bridge/worker.py +7 -11
  9. pygpt_net/core/ctx/bag.py +2 -4
  10. pygpt_net/core/ctx/container.py +3 -4
  11. pygpt_net/core/ctx/ctx.py +1 -0
  12. pygpt_net/core/ctx/output.py +137 -93
  13. pygpt_net/core/dispatcher/dispatcher.py +60 -80
  14. pygpt_net/core/idx/chat.py +0 -21
  15. pygpt_net/core/render/web/body.py +873 -853
  16. pygpt_net/core/render/web/helpers.py +99 -59
  17. pygpt_net/core/render/web/parser.py +144 -126
  18. pygpt_net/core/render/web/renderer.py +354 -296
  19. pygpt_net/data/config/config.json +4 -4
  20. pygpt_net/data/config/models.json +3 -3
  21. pygpt_net/item/ctx.py +11 -1
  22. pygpt_net/launcher.py +4 -1
  23. pygpt_net/provider/gpt/__init__.py +0 -3
  24. pygpt_net/provider/gpt/worker/assistants.py +1 -2
  25. pygpt_net/ui/layout/chat/input.py +4 -2
  26. pygpt_net/ui/layout/ctx/ctx_list.py +106 -104
  27. pygpt_net/ui/layout/toolbox/presets.py +4 -0
  28. pygpt_net/ui/main.py +6 -1
  29. pygpt_net/ui/widget/textarea/web.py +162 -164
  30. pygpt_net/utils.py +48 -2
  31. {pygpt_net-2.5.95.dist-info → pygpt_net-2.5.97.dist-info}/METADATA +10 -2
  32. {pygpt_net-2.5.95.dist-info → pygpt_net-2.5.97.dist-info}/RECORD +35 -35
  33. {pygpt_net-2.5.95.dist-info → pygpt_net-2.5.97.dist-info}/LICENSE +0 -0
  34. {pygpt_net-2.5.95.dist-info → pygpt_net-2.5.97.dist-info}/WHEEL +0 -0
  35. {pygpt_net-2.5.95.dist-info → pygpt_net-2.5.97.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt CHANGED
@@ -1,3 +1,11 @@
1
+ 2.5.97 (2025-08-11)
2
+
3
+ - Fix: attribute error in prev ctx.
4
+
5
+ 2.5.96 (2025-08-10)
6
+
7
+ - Fixed memory leaks.
8
+
1
9
  2.5.95 (2025-08-09)
2
10
 
3
11
  - Added user info personalization in Config -> Personalization, where you can provide information about yourself to the model.
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.95"
17
- __build__ = "2025-08-09"
16
+ __version__ = "2.5.97"
17
+ __build__ = "2025-08-11"
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,9 @@ class Output:
294
294
  event = RenderEvent(RenderEvent.RELOAD)
295
295
  self.window.dispatch(event) # reload chat window
296
296
 
297
+ mem_clean()
298
+
297
299
  # self.window.core.debug.mem("END") # debug memory usage
298
- # gc.collect()
299
300
 
300
301
  def log(self, data: Any):
301
302
  """
@@ -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