pygpt-net 2.6.29__py3-none-any.whl → 2.6.30__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 (113) hide show
  1. pygpt_net/CHANGELOG.txt +7 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/{container.py → app_core.py} +5 -6
  4. pygpt_net/controller/access/control.py +1 -9
  5. pygpt_net/controller/assistant/assistant.py +4 -4
  6. pygpt_net/controller/assistant/batch.py +7 -7
  7. pygpt_net/controller/assistant/files.py +4 -4
  8. pygpt_net/controller/assistant/threads.py +3 -3
  9. pygpt_net/controller/attachment/attachment.py +4 -7
  10. pygpt_net/controller/chat/common.py +1 -1
  11. pygpt_net/controller/chat/stream.py +961 -294
  12. pygpt_net/controller/chat/vision.py +11 -19
  13. pygpt_net/controller/config/placeholder.py +1 -1
  14. pygpt_net/controller/ctx/ctx.py +1 -1
  15. pygpt_net/controller/ctx/summarizer.py +1 -1
  16. pygpt_net/controller/mode/mode.py +21 -12
  17. pygpt_net/controller/plugins/settings.py +3 -2
  18. pygpt_net/controller/presets/editor.py +112 -99
  19. pygpt_net/controller/theme/theme.py +3 -2
  20. pygpt_net/controller/ui/vision.py +4 -4
  21. pygpt_net/core/agents/legacy.py +2 -2
  22. pygpt_net/core/agents/runners/openai_workflow.py +2 -2
  23. pygpt_net/core/assistants/files.py +5 -5
  24. pygpt_net/core/assistants/store.py +4 -4
  25. pygpt_net/core/bridge/bridge.py +3 -3
  26. pygpt_net/core/bridge/worker.py +28 -9
  27. pygpt_net/core/debug/console/console.py +2 -2
  28. pygpt_net/core/debug/presets.py +2 -2
  29. pygpt_net/core/experts/experts.py +2 -2
  30. pygpt_net/core/modes/modes.py +2 -2
  31. pygpt_net/core/presets/presets.py +3 -3
  32. pygpt_net/core/tokens/tokens.py +4 -4
  33. pygpt_net/core/types/mode.py +5 -2
  34. pygpt_net/core/vision/analyzer.py +1 -1
  35. pygpt_net/data/config/config.json +6 -3
  36. pygpt_net/data/config/models.json +75 -3
  37. pygpt_net/data/config/modes.json +3 -9
  38. pygpt_net/data/config/settings.json +89 -31
  39. pygpt_net/data/config/settings_section.json +2 -2
  40. pygpt_net/data/locale/locale.de.ini +2 -2
  41. pygpt_net/data/locale/locale.en.ini +9 -2
  42. pygpt_net/data/locale/locale.es.ini +2 -2
  43. pygpt_net/data/locale/locale.fr.ini +2 -2
  44. pygpt_net/data/locale/locale.it.ini +2 -2
  45. pygpt_net/data/locale/locale.pl.ini +3 -3
  46. pygpt_net/data/locale/locale.uk.ini +2 -2
  47. pygpt_net/data/locale/locale.zh.ini +2 -2
  48. pygpt_net/item/model.py +23 -3
  49. pygpt_net/plugin/openai_dalle/plugin.py +4 -4
  50. pygpt_net/plugin/openai_vision/plugin.py +12 -13
  51. pygpt_net/provider/agents/openai/agent.py +5 -5
  52. pygpt_net/provider/agents/openai/agent_b2b.py +5 -5
  53. pygpt_net/provider/agents/openai/agent_planner.py +5 -6
  54. pygpt_net/provider/agents/openai/agent_with_experts.py +5 -5
  55. pygpt_net/provider/agents/openai/agent_with_experts_feedback.py +4 -4
  56. pygpt_net/provider/agents/openai/agent_with_feedback.py +4 -4
  57. pygpt_net/provider/agents/openai/bot_researcher.py +2 -2
  58. pygpt_net/provider/agents/openai/bots/research_bot/agents/planner_agent.py +1 -1
  59. pygpt_net/provider/agents/openai/bots/research_bot/agents/search_agent.py +1 -1
  60. pygpt_net/provider/agents/openai/bots/research_bot/agents/writer_agent.py +1 -1
  61. pygpt_net/provider/agents/openai/evolve.py +5 -5
  62. pygpt_net/provider/agents/openai/supervisor.py +4 -4
  63. pygpt_net/provider/api/__init__.py +27 -0
  64. pygpt_net/provider/api/anthropic/__init__.py +68 -0
  65. pygpt_net/provider/api/google/__init__.py +262 -0
  66. pygpt_net/provider/api/google/audio.py +114 -0
  67. pygpt_net/provider/api/google/chat.py +552 -0
  68. pygpt_net/provider/api/google/image.py +287 -0
  69. pygpt_net/provider/api/google/tools.py +222 -0
  70. pygpt_net/provider/api/google/vision.py +129 -0
  71. pygpt_net/provider/{gpt → api/openai}/__init__.py +2 -2
  72. pygpt_net/provider/{gpt → api/openai}/agents/computer.py +1 -1
  73. pygpt_net/provider/{gpt → api/openai}/agents/experts.py +1 -1
  74. pygpt_net/provider/{gpt → api/openai}/agents/response.py +1 -1
  75. pygpt_net/provider/{gpt → api/openai}/assistants.py +1 -1
  76. pygpt_net/provider/{gpt → api/openai}/chat.py +15 -8
  77. pygpt_net/provider/{gpt → api/openai}/completion.py +1 -1
  78. pygpt_net/provider/{gpt → api/openai}/image.py +1 -1
  79. pygpt_net/provider/{gpt → api/openai}/remote_tools.py +1 -1
  80. pygpt_net/provider/{gpt → api/openai}/responses.py +34 -20
  81. pygpt_net/provider/{gpt → api/openai}/store.py +2 -2
  82. pygpt_net/provider/{gpt → api/openai}/vision.py +1 -1
  83. pygpt_net/provider/{gpt → api/openai}/worker/assistants.py +4 -4
  84. pygpt_net/provider/{gpt → api/openai}/worker/importer.py +10 -10
  85. pygpt_net/provider/audio_input/openai_whisper.py +1 -1
  86. pygpt_net/provider/audio_output/google_tts.py +12 -0
  87. pygpt_net/provider/audio_output/openai_tts.py +1 -1
  88. pygpt_net/provider/core/config/patch.py +11 -0
  89. pygpt_net/provider/core/model/patch.py +9 -0
  90. pygpt_net/provider/core/preset/json_file.py +2 -4
  91. pygpt_net/provider/llms/anthropic.py +2 -5
  92. pygpt_net/provider/llms/base.py +4 -3
  93. pygpt_net/provider/llms/openai.py +1 -1
  94. pygpt_net/provider/loaders/hub/image_vision/base.py +1 -1
  95. pygpt_net/ui/dialog/preset.py +71 -55
  96. pygpt_net/ui/main.py +6 -4
  97. pygpt_net/utils.py +9 -0
  98. {pygpt_net-2.6.29.dist-info → pygpt_net-2.6.30.dist-info}/METADATA +32 -44
  99. {pygpt_net-2.6.29.dist-info → pygpt_net-2.6.30.dist-info}/RECORD +113 -105
  100. /pygpt_net/provider/{gpt → api/openai}/agents/__init__.py +0 -0
  101. /pygpt_net/provider/{gpt → api/openai}/agents/client.py +0 -0
  102. /pygpt_net/provider/{gpt → api/openai}/agents/remote_tools.py +0 -0
  103. /pygpt_net/provider/{gpt → api/openai}/agents/utils.py +0 -0
  104. /pygpt_net/provider/{gpt → api/openai}/audio.py +0 -0
  105. /pygpt_net/provider/{gpt → api/openai}/computer.py +0 -0
  106. /pygpt_net/provider/{gpt → api/openai}/container.py +0 -0
  107. /pygpt_net/provider/{gpt → api/openai}/summarizer.py +0 -0
  108. /pygpt_net/provider/{gpt → api/openai}/tools.py +0 -0
  109. /pygpt_net/provider/{gpt → api/openai}/utils.py +0 -0
  110. /pygpt_net/provider/{gpt → api/openai}/worker/__init__.py +0 -0
  111. {pygpt_net-2.6.29.dist-info → pygpt_net-2.6.30.dist-info}/LICENSE +0 -0
  112. {pygpt_net-2.6.29.dist-info → pygpt_net-2.6.30.dist-info}/WHEEL +0 -0
  113. {pygpt_net-2.6.29.dist-info → pygpt_net-2.6.30.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.07.30 00:00:00 #
9
+ # Updated Date: 2025.08.28 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.core.types import (
@@ -18,7 +18,8 @@ from pygpt_net.core.types import (
18
18
  MODE_LANGCHAIN,
19
19
  MODE_LLAMA_INDEX,
20
20
  MODE_VISION,
21
- MODE_RESEARCH, MULTIMODAL_IMAGE,
21
+ MODE_RESEARCH,
22
+ MULTIMODAL_IMAGE,
22
23
  )
23
24
 
24
25
  class Vision:
@@ -64,20 +65,21 @@ class Vision:
64
65
 
65
66
  def switch_to_vision(self):
66
67
  """Switch to vision mode"""
68
+ return # DO NOT SWITCH, deprecated
67
69
  mode = self.window.core.config.get('mode')
68
70
  model = self.window.core.config.get('model')
69
71
  model_data = self.window.core.models.get(model)
70
72
  if mode in [MODE_AGENT, MODE_AGENT_LLAMA, MODE_AGENT_OPENAI]:
71
73
  return # disallow change in agent modes
72
- if mode == MODE_CHAT and MODE_VISION in model_data.mode:
74
+ if mode == MODE_CHAT and MODE_CHAT in model_data.mode:
73
75
  return # abort if vision is already allowed
74
- if mode == MODE_VISION:
75
- return
76
+ # if mode == MODE_VISION:
77
+ # return
76
78
  # abort if vision is already enabled
77
79
  if not self.window.controller.plugins.is_enabled('openai_vision') \
78
80
  or (self.window.controller.plugins.is_enabled('openai_vision')
79
81
  and mode not in self.allowed_modes):
80
- self.window.controller.mode.set(MODE_VISION)
82
+ self.window.controller.mode.set(MODE_CHAT)
81
83
 
82
84
  def allowed(self) -> bool:
83
85
  """
@@ -85,10 +87,7 @@ class Vision:
85
87
 
86
88
  :return: True if allowed
87
89
  """
88
- if self.window.controller.plugins.is_enabled('openai_vision') \
89
- or self.window.core.config.get('mode') in self.allowed_modes:
90
- return True
91
- return False
90
+ return self.window.controller.plugins.is_enabled('openai_vision') or self.is_vision_model()
92
91
 
93
92
  def is_vision_model(self) -> bool:
94
93
  """
@@ -96,17 +95,10 @@ class Vision:
96
95
 
97
96
  :return: True if vision model
98
97
  """
99
- allowed_modes = [
100
- MODE_CHAT,
101
- MODE_COMPLETION,
102
- MODE_LANGCHAIN,
103
- MODE_LLAMA_INDEX,
104
- MODE_RESEARCH,
105
- ]
106
98
  mode = self.window.core.config.get('mode')
107
99
  model = self.window.core.config.get('model')
108
100
  model_data = self.window.core.models.get(model)
109
- if MULTIMODAL_IMAGE in model_data.input and mode in allowed_modes:
110
- return True
101
+ if model_data:
102
+ return model_data.is_image_input() and mode in self.allowed_modes
111
103
  return False
112
104
 
@@ -219,7 +219,7 @@ class Placeholder:
219
219
 
220
220
  :return: placeholders list
221
221
  """
222
- return self.window.core.gpt.remote_tools.get_choices()
222
+ return self.window.core.api.openai.remote_tools.get_choices()
223
223
 
224
224
  def get_llama_index_chat_modes(self) -> List[Dict[str, str]]:
225
225
  """
@@ -295,7 +295,7 @@ class Ctx:
295
295
 
296
296
  def clean_memory(self):
297
297
  """Clean memory"""
298
- self.window.core.gpt.close() # clear gpt client
298
+ self.window.core.api.openai.close() # clear gpt client
299
299
 
300
300
  def new_in_group(
301
301
  self,
@@ -59,7 +59,7 @@ class Summarizer:
59
59
  :param window: Window instance
60
60
  :param updated_signal: WorkerSignals: updated signal
61
61
  """
62
- title = window.core.gpt.summarizer.summary_ctx(ctx)
62
+ title = window.core.api.openai.summarizer.summary_ctx(ctx)
63
63
  if title:
64
64
  updated_signal.emit(id, ctx, title)
65
65
  updated_signal.disconnect()
@@ -6,10 +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.08.20 23:00:00 #
9
+ # Updated Date: 2025.08.28 09:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.core.events import Event, AppEvent
13
+ from pygpt_net.core.types import (
14
+ MODE_ASSISTANT,
15
+ MODE_CHAT,
16
+ )
13
17
  from pygpt_net.item.ctx import CtxItem
14
18
  from pygpt_net.utils import trans
15
19
 
@@ -26,25 +30,33 @@ class Mode:
26
30
 
27
31
  @staticmethod
28
32
  def _normalize_mode(mode: str) -> str:
33
+ """
34
+ Normalize mode name (handle deprecated modes)
35
+
36
+ :param mode: mode name
37
+ :return: normalized mode name
38
+ """
29
39
  if mode == "langchain":
30
40
  print("Langchain mode is deprecated from v2.5.20 and no longer supported. "
31
41
  "Please use LlamaIndex or Chat mode instead.")
32
- return "chat"
42
+ return MODE_CHAT
43
+ elif mode == "vision":
44
+ print("Vision mode is deprecated from v2.6.30 and no longer supported. "
45
+ "Please use Chat mode with multimodal models instead.")
46
+ return MODE_CHAT
33
47
  return mode
34
48
 
35
49
  def select(self, mode: str):
36
50
  """
37
51
  Select mode by id
38
52
 
39
- :param mode
53
+ :param mode: mode to select
40
54
  """
41
55
  mode = self._normalize_mode(mode)
42
-
43
- # check if mode change is not locked
44
56
  if self.change_locked() or mode is None:
45
- return
46
- self.set(mode)
57
+ return # abort if mode is locked
47
58
 
59
+ self.set(mode)
48
60
  event = Event(Event.MODE_SELECT, {
49
61
  'value': mode,
50
62
  })
@@ -70,7 +82,7 @@ class Mode:
70
82
  core = w.core
71
83
  cfg = core.config
72
84
  try:
73
- if mode == "assistant":
85
+ if mode == MODE_ASSISTANT:
74
86
  c.presets.select_default()
75
87
  core_ctx = core.ctx
76
88
  current = core_ctx.get_current()
@@ -172,9 +184,7 @@ class Mode:
172
184
  *args,
173
185
  **kwargs
174
186
  ):
175
- """
176
- Hook: on update current temperature global field
177
- """
187
+ """Hook: on update current temperature global field"""
178
188
  if caller != "slider":
179
189
  return # accept call only from slider (has already validated min/max)
180
190
 
@@ -240,6 +250,5 @@ class Mode:
240
250
  Check if mode change is locked
241
251
 
242
252
  :return: True if locked
243
- :rtype: bool
244
253
  """
245
254
  return bool(self.window.controller.chat.input.generating)
@@ -14,7 +14,7 @@ from typing import Any
14
14
  from PySide6.QtWidgets import QApplication
15
15
 
16
16
  from pygpt_net.core.events import Event, KernelEvent
17
- from pygpt_net.utils import trans
17
+ from pygpt_net.utils import trans, freeze_updates
18
18
 
19
19
 
20
20
  class Settings:
@@ -52,7 +52,8 @@ class Settings:
52
52
  'status': trans("status.loading")
53
53
  }))
54
54
  QApplication.processEvents()
55
- self.setup()
55
+ with freeze_updates(self.window):
56
+ self.setup()
56
57
  self.config_initialized = True
57
58
  if self.config_dialog:
58
59
  return