pygpt-net 2.6.28__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 (115) hide show
  1. pygpt_net/CHANGELOG.txt +13 -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/common.py +2 -0
  20. pygpt_net/controller/theme/theme.py +6 -2
  21. pygpt_net/controller/ui/vision.py +4 -4
  22. pygpt_net/core/agents/legacy.py +2 -2
  23. pygpt_net/core/agents/runners/openai_workflow.py +2 -2
  24. pygpt_net/core/assistants/files.py +5 -5
  25. pygpt_net/core/assistants/store.py +4 -4
  26. pygpt_net/core/bridge/bridge.py +3 -3
  27. pygpt_net/core/bridge/worker.py +28 -9
  28. pygpt_net/core/debug/console/console.py +2 -2
  29. pygpt_net/core/debug/presets.py +2 -2
  30. pygpt_net/core/experts/experts.py +2 -2
  31. pygpt_net/core/idx/llm.py +21 -3
  32. pygpt_net/core/modes/modes.py +2 -2
  33. pygpt_net/core/presets/presets.py +3 -3
  34. pygpt_net/core/tokens/tokens.py +4 -4
  35. pygpt_net/core/types/mode.py +5 -2
  36. pygpt_net/core/vision/analyzer.py +1 -1
  37. pygpt_net/data/config/config.json +6 -3
  38. pygpt_net/data/config/models.json +75 -3
  39. pygpt_net/data/config/modes.json +3 -9
  40. pygpt_net/data/config/settings.json +112 -55
  41. pygpt_net/data/config/settings_section.json +2 -2
  42. pygpt_net/data/locale/locale.de.ini +2 -2
  43. pygpt_net/data/locale/locale.en.ini +9 -2
  44. pygpt_net/data/locale/locale.es.ini +2 -2
  45. pygpt_net/data/locale/locale.fr.ini +2 -2
  46. pygpt_net/data/locale/locale.it.ini +2 -2
  47. pygpt_net/data/locale/locale.pl.ini +3 -3
  48. pygpt_net/data/locale/locale.uk.ini +2 -2
  49. pygpt_net/data/locale/locale.zh.ini +2 -2
  50. pygpt_net/item/model.py +23 -3
  51. pygpt_net/plugin/openai_dalle/plugin.py +4 -4
  52. pygpt_net/plugin/openai_vision/plugin.py +12 -13
  53. pygpt_net/provider/agents/openai/agent.py +5 -5
  54. pygpt_net/provider/agents/openai/agent_b2b.py +5 -5
  55. pygpt_net/provider/agents/openai/agent_planner.py +5 -6
  56. pygpt_net/provider/agents/openai/agent_with_experts.py +5 -5
  57. pygpt_net/provider/agents/openai/agent_with_experts_feedback.py +4 -4
  58. pygpt_net/provider/agents/openai/agent_with_feedback.py +4 -4
  59. pygpt_net/provider/agents/openai/bot_researcher.py +2 -2
  60. pygpt_net/provider/agents/openai/bots/research_bot/agents/planner_agent.py +1 -1
  61. pygpt_net/provider/agents/openai/bots/research_bot/agents/search_agent.py +1 -1
  62. pygpt_net/provider/agents/openai/bots/research_bot/agents/writer_agent.py +1 -1
  63. pygpt_net/provider/agents/openai/evolve.py +5 -5
  64. pygpt_net/provider/agents/openai/supervisor.py +4 -4
  65. pygpt_net/provider/api/__init__.py +27 -0
  66. pygpt_net/provider/api/anthropic/__init__.py +68 -0
  67. pygpt_net/provider/api/google/__init__.py +262 -0
  68. pygpt_net/provider/api/google/audio.py +114 -0
  69. pygpt_net/provider/api/google/chat.py +552 -0
  70. pygpt_net/provider/api/google/image.py +287 -0
  71. pygpt_net/provider/api/google/tools.py +222 -0
  72. pygpt_net/provider/api/google/vision.py +129 -0
  73. pygpt_net/provider/{gpt → api/openai}/__init__.py +2 -2
  74. pygpt_net/provider/{gpt → api/openai}/agents/computer.py +1 -1
  75. pygpt_net/provider/{gpt → api/openai}/agents/experts.py +1 -1
  76. pygpt_net/provider/{gpt → api/openai}/agents/response.py +1 -1
  77. pygpt_net/provider/{gpt → api/openai}/assistants.py +1 -1
  78. pygpt_net/provider/{gpt → api/openai}/chat.py +15 -8
  79. pygpt_net/provider/{gpt → api/openai}/completion.py +1 -1
  80. pygpt_net/provider/{gpt → api/openai}/image.py +1 -1
  81. pygpt_net/provider/{gpt → api/openai}/remote_tools.py +1 -1
  82. pygpt_net/provider/{gpt → api/openai}/responses.py +34 -20
  83. pygpt_net/provider/{gpt → api/openai}/store.py +2 -2
  84. pygpt_net/provider/{gpt → api/openai}/vision.py +1 -1
  85. pygpt_net/provider/{gpt → api/openai}/worker/assistants.py +4 -4
  86. pygpt_net/provider/{gpt → api/openai}/worker/importer.py +10 -10
  87. pygpt_net/provider/audio_input/openai_whisper.py +1 -1
  88. pygpt_net/provider/audio_output/google_tts.py +12 -0
  89. pygpt_net/provider/audio_output/openai_tts.py +1 -1
  90. pygpt_net/provider/core/config/patch.py +11 -0
  91. pygpt_net/provider/core/model/patch.py +9 -0
  92. pygpt_net/provider/core/preset/json_file.py +2 -4
  93. pygpt_net/provider/llms/anthropic.py +2 -5
  94. pygpt_net/provider/llms/base.py +4 -3
  95. pygpt_net/provider/llms/openai.py +1 -1
  96. pygpt_net/provider/loaders/hub/image_vision/base.py +1 -1
  97. pygpt_net/ui/dialog/preset.py +71 -55
  98. pygpt_net/ui/main.py +6 -4
  99. pygpt_net/utils.py +9 -0
  100. {pygpt_net-2.6.28.dist-info → pygpt_net-2.6.30.dist-info}/METADATA +42 -48
  101. {pygpt_net-2.6.28.dist-info → pygpt_net-2.6.30.dist-info}/RECORD +115 -107
  102. /pygpt_net/provider/{gpt → api/openai}/agents/__init__.py +0 -0
  103. /pygpt_net/provider/{gpt → api/openai}/agents/client.py +0 -0
  104. /pygpt_net/provider/{gpt → api/openai}/agents/remote_tools.py +0 -0
  105. /pygpt_net/provider/{gpt → api/openai}/agents/utils.py +0 -0
  106. /pygpt_net/provider/{gpt → api/openai}/audio.py +0 -0
  107. /pygpt_net/provider/{gpt → api/openai}/computer.py +0 -0
  108. /pygpt_net/provider/{gpt → api/openai}/container.py +0 -0
  109. /pygpt_net/provider/{gpt → api/openai}/summarizer.py +0 -0
  110. /pygpt_net/provider/{gpt → api/openai}/tools.py +0 -0
  111. /pygpt_net/provider/{gpt → api/openai}/utils.py +0 -0
  112. /pygpt_net/provider/{gpt → api/openai}/worker/__init__.py +0 -0
  113. {pygpt_net-2.6.28.dist-info → pygpt_net-2.6.30.dist-info}/LICENSE +0 -0
  114. {pygpt_net-2.6.28.dist-info → pygpt_net-2.6.30.dist-info}/WHEEL +0 -0
  115. {pygpt_net-2.6.28.dist-info → pygpt_net-2.6.30.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt CHANGED
@@ -1,3 +1,16 @@
1
+ 2.6.30 (2025-08-29)
2
+
3
+ - Added native Google GenAI API support (beta); live audio is not supported yet (#132).
4
+ - Added new predefined models for image generation: Google Imagen3 and Imagen4.
5
+ - Optimized token usage in the Responses API.
6
+ - Removed Vision mode (it is now integrated into Chat).
7
+
8
+ 2.6.29 (2025-08-28)
9
+
10
+ - Verbose options have been moved to the Developer section in settings.
11
+ - Enhanced logging of embeddings usage.
12
+ - Fixed styles list.
13
+
1
14
  2.6.28 (2025-08-27)
2
15
 
3
16
  - Added new plugins: Tuya (IoT) and Wikipedia.
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.27 00:00:00 #
9
+ # Updated Date: 2025.08.29 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.28"
17
- __build__ = "2025-08-27"
16
+ __version__ = "2.6.30"
17
+ __build__ = "2025-08-29"
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.08 05:00:00 #
9
+ # Updated Date: 2025.08.28 09:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.config import Config
@@ -45,21 +45,21 @@ from pygpt_net.core.tokens import Tokens
45
45
  from pygpt_net.core.updater import Updater
46
46
  from pygpt_net.core.vision import Vision
47
47
  from pygpt_net.core.web import Web
48
- from pygpt_net.provider.gpt import Gpt
49
48
 
49
+ from pygpt_net.provider.api import Api
50
50
 
51
- class Container:
51
+ class Core:
52
52
  def __init__(self, window=None):
53
53
  """
54
- Service container
54
+ App core
55
55
 
56
56
  :param window: Window instance
57
57
  """
58
58
  self.window = window
59
59
 
60
- # core
61
60
  self.access = Access(window)
62
61
  self.agents = Agents(window)
62
+ self.api = Api(window)
63
63
  self.assistants = Assistants(window)
64
64
  self.attachments = Attachments(window)
65
65
  self.audio = Audio(window)
@@ -75,7 +75,6 @@ class Container:
75
75
  self.dispatcher = Dispatcher(window)
76
76
  self.experts = Experts(window)
77
77
  self.filesystem = Filesystem(window)
78
- self.gpt = Gpt(window)
79
78
  self.history = History(window)
80
79
  self.idx = Idx(window)
81
80
  self.image = Image(window)
@@ -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.12.14 08:00:00 #
9
+ # Updated Date: 2025.08.28 09:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import re
@@ -14,16 +14,8 @@ import re
14
14
  from PySide6.QtCore import QTimer
15
15
 
16
16
  from pygpt_net.core.types import (
17
- MODE_AGENT,
18
- MODE_AGENT_LLAMA,
19
- MODE_ASSISTANT,
20
17
  MODE_CHAT,
21
- MODE_COMPLETION,
22
- MODE_EXPERT,
23
- MODE_LANGCHAIN,
24
18
  MODE_LLAMA_INDEX,
25
- MODE_VISION,
26
- MODE_IMAGE,
27
19
  )
28
20
  from pygpt_net.core.tabs.tab import Tab
29
21
  from pygpt_net.core.events import ControlEvent
@@ -91,7 +91,7 @@ class Assistant:
91
91
 
92
92
  # get status
93
93
  try:
94
- status = self.window.core.gpt.assistants.run_stop(ctx)
94
+ status = self.window.core.api.openai.assistants.run_stop(ctx)
95
95
  if status == "cancelling" or status == "cancelled":
96
96
  print("Run has been canceled.")
97
97
  self.threads.log("Run status: {}".format(status))
@@ -227,7 +227,7 @@ class Assistant:
227
227
  assistant = self.window.core.assistants.create()
228
228
  self.editor.assign_data(assistant)
229
229
  try:
230
- return self.window.core.gpt.assistants.create(assistant)
230
+ return self.window.core.api.openai.assistants.create(assistant)
231
231
  except Exception as e:
232
232
  self.window.core.debug.log(e)
233
233
  self.window.ui.dialogs.alert(e)
@@ -240,7 +240,7 @@ class Assistant:
240
240
  """
241
241
  self.editor.assign_data(assistant)
242
242
  try:
243
- return self.window.core.gpt.assistants.update(assistant)
243
+ return self.window.core.api.openai.assistants.update(assistant)
244
244
  except Exception as e:
245
245
  self.window.core.debug.log(e)
246
246
  self.window.ui.dialogs.alert(e)
@@ -300,7 +300,7 @@ class Assistant:
300
300
 
301
301
  # delete in API
302
302
  try:
303
- self.window.core.gpt.assistants.delete(id)
303
+ self.window.core.api.openai.assistants.delete(id)
304
304
  except Exception as e:
305
305
  self.window.ui.dialogs.alert(e)
306
306
 
@@ -42,7 +42,7 @@ class Batch:
42
42
 
43
43
  # run asynchronous
44
44
  self.window.update_status("Importing assistants...please wait...")
45
- self.window.core.gpt.assistants.importer.import_assistants()
45
+ self.window.core.api.openai.assistants.importer.import_assistants()
46
46
 
47
47
  def import_stores(self, force: bool = False):
48
48
  """
@@ -60,7 +60,7 @@ class Batch:
60
60
  # run asynchronous
61
61
  self.window.update_status("Importing vector stores...please wait...")
62
62
  self.window.core.assistants.store.truncate() # clear all stores
63
- self.window.core.gpt.assistants.importer.import_vector_stores()
63
+ self.window.core.api.openai.assistants.importer.import_vector_stores()
64
64
  self.window.controller.assistant.files.update()
65
65
  self.window.controller.assistant.store.update()
66
66
 
@@ -140,7 +140,7 @@ class Batch:
140
140
  # run asynchronous
141
141
  self.window.update_status("Removing files...please wait...")
142
142
  QApplication.processEvents()
143
- self.window.core.gpt.assistants.importer.truncate_files() # remove all files from API
143
+ self.window.core.api.openai.assistants.importer.truncate_files() # remove all files from API
144
144
 
145
145
  def truncate_store_files_by_idx(self, idx: int, force: bool = False):
146
146
  """
@@ -173,7 +173,7 @@ class Batch:
173
173
  # run asynchronous
174
174
  self.window.update_status("Removing files...please wait...")
175
175
  QApplication.processEvents()
176
- self.window.core.gpt.assistants.importer.truncate_files(store_id) # remove all files from API
176
+ self.window.core.api.openai.assistants.importer.truncate_files(store_id) # remove all files from API
177
177
 
178
178
  def clear_store_files_by_idx(
179
179
  self,
@@ -277,7 +277,7 @@ class Batch:
277
277
  self.window.update_status("Removing vector stores...please wait...")
278
278
  QApplication.processEvents()
279
279
  self.window.core.assistants.store.truncate() # clear all stores
280
- self.window.core.gpt.assistants.importer.truncate_vector_stores()
280
+ self.window.core.api.openai.assistants.importer.truncate_vector_stores()
281
281
  self.window.controller.assistant.files.update()
282
282
  self.window.controller.assistant.store.update()
283
283
  self.window.controller.assistant.store.current = None
@@ -298,7 +298,7 @@ class Batch:
298
298
  return
299
299
  self.window.update_status("Refreshing vector stores...please wait...")
300
300
  QApplication.processEvents()
301
- self.window.core.gpt.assistants.importer.refresh_vector_stores()
301
+ self.window.core.api.openai.assistants.importer.refresh_vector_stores()
302
302
 
303
303
  def handle_imported_assistants(self, num: int):
304
304
  """
@@ -539,7 +539,7 @@ class Batch:
539
539
  store_id = self.window.controller.assistant.store.current
540
540
  self.window.update_status("Uploading files...please wait...")
541
541
  QApplication.processEvents()
542
- self.window.core.gpt.assistants.importer.upload_files(store_id, self.files_to_upload)
542
+ self.window.core.api.openai.assistants.importer.upload_files(store_id, self.files_to_upload)
543
543
  self.files_to_upload = [] # clear files
544
544
 
545
545
  def handle_uploaded_files(self, num: int):
@@ -75,7 +75,7 @@ class Files:
75
75
  """
76
76
  # run asynchronous
77
77
  self.window.update_status("Importing files...please wait...")
78
- self.window.core.gpt.assistants.importer.import_files(store_id)
78
+ self.window.core.api.openai.assistants.importer.import_files(store_id)
79
79
 
80
80
  def download(self, idx: int):
81
81
  """
@@ -276,7 +276,7 @@ class Files:
276
276
  continue
277
277
 
278
278
  # upload local attachment file and get new ID (file_id)
279
- new_id = self.window.core.gpt.store.upload(
279
+ new_id = self.window.core.api.openai.store.upload(
280
280
  attachment.path,
281
281
  )
282
282
  if new_id is not None:
@@ -287,14 +287,14 @@ class Files:
287
287
 
288
288
  """
289
289
  if assistant.vector_store is None or assistant.vector_store == "":
290
- assistant.vector_store = self.window.core.gpt.store.create_store(
290
+ assistant.vector_store = self.window.core.api.openai.store.create_store(
291
291
  "thread-" + thread_id,
292
292
  )
293
293
  """
294
294
 
295
295
  # add to vector store if defined in assistant, otherwise file will be added to thread store
296
296
  if assistant.vector_store:
297
- self.window.core.gpt.store.add_file(
297
+ self.window.core.api.openai.store.add_file(
298
298
  assistant.vector_store,
299
299
  new_id,
300
300
  )
@@ -42,7 +42,7 @@ class Threads(QObject):
42
42
 
43
43
  :return: thread id
44
44
  """
45
- thread_id = self.window.core.gpt.assistants.thread_create()
45
+ thread_id = self.window.core.api.openai.assistants.thread_create()
46
46
  self.window.core.config.set('assistant_thread', thread_id)
47
47
  self.window.core.ctx.append_thread(thread_id)
48
48
  return thread_id
@@ -245,7 +245,7 @@ class Threads(QObject):
245
245
 
246
246
  :param ctx: CtxItem
247
247
  """
248
- data = self.window.core.gpt.assistants.msg_list(ctx.thread)
248
+ data = self.window.core.api.openai.assistants.msg_list(ctx.thread)
249
249
  for msg in data:
250
250
  if msg.role == "assistant":
251
251
  try:
@@ -640,7 +640,7 @@ class RunWorker(QRunnable):
640
640
  while self.check \
641
641
  and not self.window.is_closing \
642
642
  and not self.window.controller.assistant.threads.stop:
643
- run = self.window.core.gpt.assistants.run_get(self.ctx)
643
+ run = self.window.core.api.openai.assistants.run_get(self.ctx)
644
644
  status = None
645
645
  if run is not None:
646
646
  status = run.status
@@ -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.23 15:00:00 #
9
+ # Updated Date: 2025.08.28 09:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -17,9 +17,6 @@ from urllib.parse import urlparse
17
17
  from PySide6.QtGui import QImage
18
18
  from PySide6.QtWidgets import QFileDialog, QApplication
19
19
 
20
- from pygpt_net.core.types import (
21
- MODE_VISION,
22
- )
23
20
  from pygpt_net.core.events import AppEvent, KernelEvent
24
21
  from pygpt_net.item.attachment import AttachmentItem
25
22
  from pygpt_net.item.ctx import CtxItem
@@ -73,7 +70,7 @@ class Attachment:
73
70
  if not self.has(mode):
74
71
  self.window.controller.chat.vision.unavailable()
75
72
  else:
76
- if mode == MODE_VISION or self.window.controller.plugins.is_type_enabled('vision'):
73
+ if self.window.controller.chat.vision.allowed():
77
74
  self.window.controller.chat.vision.available()
78
75
 
79
76
  # update tokens counter (vision plugin, etc.)
@@ -480,7 +477,7 @@ class Attachment:
480
477
  """
481
478
  try:
482
479
  # get file info from assistant API
483
- data = self.window.core.gpt.store.get_file(file_id)
480
+ data = self.window.core.api.openai.store.get_file(file_id)
484
481
  if data is None:
485
482
  return
486
483
 
@@ -506,7 +503,7 @@ class Attachment:
506
503
  path = self.get_download_path(filename)
507
504
 
508
505
  # download file
509
- self.window.core.gpt.store.download(
506
+ self.window.core.api.openai.store.download(
510
507
  file_id=file_id,
511
508
  path=path,
512
509
  )
@@ -307,7 +307,7 @@ class Common:
307
307
  controller.kernel.halt = True
308
308
  dispatch(RenderEvent(RenderEvent.TOOL_END)) # show waiting
309
309
 
310
- core.gpt.stop()
310
+ core.api.openai.stop()
311
311
  self.unlock_input()
312
312
 
313
313
  controller.chat.input.generating = False