pygpt-net 2.6.38__py3-none-any.whl → 2.6.40__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.
pygpt_net/CHANGELOG.txt CHANGED
@@ -1,3 +1,12 @@
1
+ 2.6.40 (2025-09-06)
2
+
3
+ - CSS fixes.
4
+
5
+ 2.6.39 (2025-09-06)
6
+
7
+ - Added: Search input to the models editor.
8
+ - Fixed: Brush color switching when changing modes in the Painter.
9
+
1
10
  2.6.38 (2025-09-05)
2
11
 
3
12
  - Fixed: Detection of chunk type in Ollama.
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.09.05 00:00:00 #
9
+ # Updated Date: 2025.09.06 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.6.38"
17
- __build__ = "2025-09-05"
16
+ __version__ = "2.6.40"
17
+ __build__ = "2025-09-06"
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,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.14 01:00:00 #
9
+ # Updated Date: 2025.09.05 18:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import copy
@@ -69,7 +69,6 @@ class Editor:
69
69
  "type": "bool",
70
70
  "label": "model.tool_calls",
71
71
  "description": "model.tool_calls.desc",
72
- "advanced": True,
73
72
  },
74
73
  "input": {
75
74
  "type": "bool_list", # list of comma separated values
@@ -424,15 +423,14 @@ class Editor:
424
423
 
425
424
  :param idx: tab index
426
425
  """
427
- model_idx = 0
428
- self.window.core.models.sort_items()
429
- for id in self.window.core.models.get_ids():
430
- if model_idx == idx:
431
- self.current = id
432
- break
433
- model_idx += 1
434
- current = self.window.ui.models['models.list'].index(idx, 0)
435
- self.window.ui.nodes['models.list'].setCurrentIndex(current)
426
+ if idx is None:
427
+ return
428
+ # Resolve model id using the filtered view mapping
429
+ model_id = self.window.model_settings.get_model_id_by_row(idx)
430
+ if model_id is not None:
431
+ self.current = model_id
432
+ current = self.window.ui.models['models.list'].index(idx, 0)
433
+ self.window.ui.nodes['models.list'].setCurrentIndex(current)
436
434
 
437
435
  def set_tab_by_id(self, model_id: str):
438
436
  """
@@ -441,57 +439,37 @@ class Editor:
441
439
  :param model_id: model id
442
440
  """
443
441
  idx = self.get_tab_idx(model_id)
442
+ if idx is None:
443
+ return
444
444
  current = self.window.ui.models['models.list'].index(idx, 0)
445
445
  self.window.ui.nodes['models.list'].setCurrentIndex(current)
446
446
 
447
- def get_tab_idx(self, model_id: str) -> int:
447
+ def get_tab_idx(self, model_id: str) -> Optional[int]:
448
448
  """
449
- Get model list index
449
+ Get model list index (in the current filtered view)
450
450
 
451
451
  :param model_id: model id
452
452
  :return: list index
453
453
  """
454
- model_idx = None
455
- i = 0
456
- self.window.core.models.sort_items()
457
- for id in self.window.core.models.get_ids():
458
- if id == model_id:
459
- model_idx = i
460
- break
461
- i += 1
462
- return model_idx
454
+ return self.window.model_settings.get_row_by_model_id(model_id)
463
455
 
464
- def get_tab_by_id(self, model_id: str) -> int:
456
+ def get_tab_by_id(self, model_id: str) -> Optional[int]:
465
457
  """
466
- Get model list index
458
+ Get model list index (alias to get_tab_idx for compatibility)
467
459
 
468
460
  :param model_id: model id
469
461
  :return: list index
470
462
  """
471
- model_idx = None
472
- i = 0
473
- self.window.core.models.sort_items()
474
- for id in self.window.core.models.get_ids():
475
- if id == model_id:
476
- model_idx = i
477
- break
478
- i += 1
479
- return model_idx
463
+ return self.get_tab_idx(model_id)
480
464
 
481
465
  def get_model_by_tab_idx(self, idx: int) -> Optional[str]:
482
466
  """
483
- Get model key by list index
467
+ Get model key by list index (in the current filtered view)
484
468
 
485
469
  :param idx: list index
486
470
  :return: model key
487
471
  """
488
- model_idx = 0
489
- self.window.core.models.sort_items()
490
- for id in self.window.core.models.get_ids():
491
- if model_idx == idx:
492
- return id
493
- model_idx += 1
494
- return None
472
+ return self.window.model_settings.get_model_id_by_row(idx)
495
473
 
496
474
  def open_by_idx(self, idx: int):
497
475
  """
@@ -534,4 +512,4 @@ class Editor:
534
512
 
535
513
  def clear_selected(self):
536
514
  """Clear selected list"""
537
- self.selected = []
515
+ self.selected = []
@@ -56,10 +56,6 @@ class Common:
56
56
  :param enabled: bool
57
57
  """
58
58
  if enabled:
59
- # keep UI color for compatibility
60
- self.window.ui.nodes['painter.select.brush.color'].setCurrentText("Black")
61
- self.window.ui.painter.set_brush_color(Qt.black)
62
- # switch widget to brush mode (layered painting)
63
59
  self.window.ui.painter.set_mode("brush")
64
60
  self.window.core.config.set('painter.brush.mode', "brush")
65
61
  self.window.core.config.save()
@@ -71,10 +67,6 @@ class Common:
71
67
  :param enabled: bool
72
68
  """
73
69
  if enabled:
74
- # keep UI color for compatibility
75
- self.window.ui.nodes['painter.select.brush.color'].setCurrentText("White")
76
- self.window.ui.painter.set_brush_color(Qt.white)
77
- # switch widget to erase mode (layered erasing)
78
70
  self.window.ui.painter.set_mode("erase")
79
71
  self.window.core.config.set('painter.brush.mode', "erase")
80
72
  self.window.core.config.save()