pygpt-net 2.7.4__py3-none-any.whl → 2.7.6__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 (159) hide show
  1. pygpt_net/CHANGELOG.txt +15 -0
  2. pygpt_net/__init__.py +4 -4
  3. pygpt_net/app_core.py +4 -2
  4. pygpt_net/controller/__init__.py +5 -1
  5. pygpt_net/controller/assistant/assistant.py +1 -4
  6. pygpt_net/controller/assistant/batch.py +5 -504
  7. pygpt_net/controller/assistant/editor.py +5 -5
  8. pygpt_net/controller/assistant/files.py +16 -16
  9. pygpt_net/controller/chat/handler/google_stream.py +307 -1
  10. pygpt_net/controller/chat/handler/worker.py +10 -25
  11. pygpt_net/controller/chat/handler/xai_stream.py +621 -52
  12. pygpt_net/controller/chat/image.py +2 -2
  13. pygpt_net/controller/debug/fixtures.py +3 -2
  14. pygpt_net/controller/dialogs/confirm.py +73 -101
  15. pygpt_net/controller/files/files.py +65 -4
  16. pygpt_net/controller/lang/mapping.py +9 -9
  17. pygpt_net/controller/painter/capture.py +50 -1
  18. pygpt_net/controller/presets/presets.py +2 -1
  19. pygpt_net/controller/remote_store/__init__.py +12 -0
  20. pygpt_net/{provider/core/assistant_file/db_sqlite → controller/remote_store/google}/__init__.py +2 -2
  21. pygpt_net/controller/remote_store/google/batch.py +402 -0
  22. pygpt_net/controller/remote_store/google/store.py +615 -0
  23. pygpt_net/controller/remote_store/openai/__init__.py +12 -0
  24. pygpt_net/controller/remote_store/openai/batch.py +524 -0
  25. pygpt_net/controller/{assistant → remote_store/openai}/store.py +63 -60
  26. pygpt_net/controller/remote_store/remote_store.py +35 -0
  27. pygpt_net/controller/ui/ui.py +20 -1
  28. pygpt_net/core/assistants/assistants.py +3 -15
  29. pygpt_net/core/db/database.py +5 -3
  30. pygpt_net/core/filesystem/url.py +4 -1
  31. pygpt_net/core/locale/placeholder.py +35 -0
  32. pygpt_net/core/remote_store/__init__.py +12 -0
  33. pygpt_net/core/remote_store/google/__init__.py +11 -0
  34. pygpt_net/core/remote_store/google/files.py +224 -0
  35. pygpt_net/core/remote_store/google/store.py +248 -0
  36. pygpt_net/core/remote_store/openai/__init__.py +11 -0
  37. pygpt_net/core/{assistants → remote_store/openai}/files.py +26 -19
  38. pygpt_net/core/{assistants → remote_store/openai}/store.py +32 -15
  39. pygpt_net/core/remote_store/remote_store.py +24 -0
  40. pygpt_net/core/render/web/body.py +3 -2
  41. pygpt_net/core/types/chunk.py +27 -0
  42. pygpt_net/data/config/config.json +8 -4
  43. pygpt_net/data/config/models.json +77 -3
  44. pygpt_net/data/config/settings.json +45 -0
  45. pygpt_net/data/js/app/template.js +1 -1
  46. pygpt_net/data/js/app.min.js +2 -2
  47. pygpt_net/data/locale/locale.de.ini +44 -41
  48. pygpt_net/data/locale/locale.en.ini +56 -43
  49. pygpt_net/data/locale/locale.es.ini +44 -41
  50. pygpt_net/data/locale/locale.fr.ini +44 -41
  51. pygpt_net/data/locale/locale.it.ini +44 -41
  52. pygpt_net/data/locale/locale.pl.ini +45 -42
  53. pygpt_net/data/locale/locale.uk.ini +44 -41
  54. pygpt_net/data/locale/locale.zh.ini +44 -41
  55. pygpt_net/data/locale/plugin.cmd_history.de.ini +1 -1
  56. pygpt_net/data/locale/plugin.cmd_history.en.ini +1 -1
  57. pygpt_net/data/locale/plugin.cmd_history.es.ini +1 -1
  58. pygpt_net/data/locale/plugin.cmd_history.fr.ini +1 -1
  59. pygpt_net/data/locale/plugin.cmd_history.it.ini +1 -1
  60. pygpt_net/data/locale/plugin.cmd_history.pl.ini +1 -1
  61. pygpt_net/data/locale/plugin.cmd_history.uk.ini +1 -1
  62. pygpt_net/data/locale/plugin.cmd_history.zh.ini +1 -1
  63. pygpt_net/data/locale/plugin.cmd_mouse_control.en.ini +14 -0
  64. pygpt_net/data/locale/plugin.cmd_web.de.ini +1 -1
  65. pygpt_net/data/locale/plugin.cmd_web.en.ini +1 -1
  66. pygpt_net/data/locale/plugin.cmd_web.es.ini +1 -1
  67. pygpt_net/data/locale/plugin.cmd_web.fr.ini +1 -1
  68. pygpt_net/data/locale/plugin.cmd_web.it.ini +1 -1
  69. pygpt_net/data/locale/plugin.cmd_web.pl.ini +1 -1
  70. pygpt_net/data/locale/plugin.cmd_web.uk.ini +1 -1
  71. pygpt_net/data/locale/plugin.cmd_web.zh.ini +1 -1
  72. pygpt_net/data/locale/plugin.idx_llama_index.de.ini +2 -2
  73. pygpt_net/data/locale/plugin.idx_llama_index.en.ini +2 -2
  74. pygpt_net/data/locale/plugin.idx_llama_index.es.ini +2 -2
  75. pygpt_net/data/locale/plugin.idx_llama_index.fr.ini +2 -2
  76. pygpt_net/data/locale/plugin.idx_llama_index.it.ini +2 -2
  77. pygpt_net/data/locale/plugin.idx_llama_index.pl.ini +2 -2
  78. pygpt_net/data/locale/plugin.idx_llama_index.uk.ini +2 -2
  79. pygpt_net/data/locale/plugin.idx_llama_index.zh.ini +2 -2
  80. pygpt_net/item/assistant.py +1 -211
  81. pygpt_net/item/ctx.py +3 -3
  82. pygpt_net/item/store.py +238 -0
  83. pygpt_net/js_rc.py +2449 -2447
  84. pygpt_net/migrations/Version20260102190000.py +35 -0
  85. pygpt_net/migrations/__init__.py +3 -1
  86. pygpt_net/plugin/cmd_mouse_control/config.py +471 -1
  87. pygpt_net/plugin/cmd_mouse_control/plugin.py +487 -22
  88. pygpt_net/plugin/cmd_mouse_control/worker.py +464 -87
  89. pygpt_net/plugin/cmd_mouse_control/worker_sandbox.py +729 -0
  90. pygpt_net/plugin/idx_llama_index/config.py +2 -2
  91. pygpt_net/provider/api/anthropic/__init__.py +10 -8
  92. pygpt_net/provider/api/google/__init__.py +21 -58
  93. pygpt_net/provider/api/google/chat.py +545 -129
  94. pygpt_net/provider/api/google/computer.py +190 -0
  95. pygpt_net/provider/api/google/realtime/realtime.py +2 -2
  96. pygpt_net/provider/api/google/remote_tools.py +93 -0
  97. pygpt_net/provider/api/google/store.py +546 -0
  98. pygpt_net/provider/api/google/worker/__init__.py +0 -0
  99. pygpt_net/provider/api/google/worker/importer.py +392 -0
  100. pygpt_net/provider/api/openai/__init__.py +7 -3
  101. pygpt_net/provider/api/openai/computer.py +10 -1
  102. pygpt_net/provider/api/openai/responses.py +0 -0
  103. pygpt_net/provider/api/openai/store.py +6 -6
  104. pygpt_net/provider/api/openai/worker/importer.py +24 -24
  105. pygpt_net/provider/api/x_ai/__init__.py +10 -9
  106. pygpt_net/provider/api/x_ai/chat.py +272 -102
  107. pygpt_net/provider/core/config/patch.py +16 -1
  108. pygpt_net/provider/core/config/patches/patch_before_2_6_42.py +3 -3
  109. pygpt_net/provider/core/model/patch.py +17 -3
  110. pygpt_net/provider/core/preset/json_file.py +13 -7
  111. pygpt_net/provider/core/{assistant_file → remote_file}/__init__.py +1 -1
  112. pygpt_net/provider/core/{assistant_file → remote_file}/base.py +9 -9
  113. pygpt_net/provider/core/remote_file/db_sqlite/__init__.py +12 -0
  114. pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/patch.py +1 -1
  115. pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/provider.py +23 -20
  116. pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/storage.py +35 -27
  117. pygpt_net/provider/core/{assistant_file → remote_file}/db_sqlite/utils.py +5 -4
  118. pygpt_net/provider/core/{assistant_store → remote_store}/__init__.py +1 -1
  119. pygpt_net/provider/core/{assistant_store → remote_store}/base.py +10 -10
  120. pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/__init__.py +1 -1
  121. pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/patch.py +1 -1
  122. pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/provider.py +16 -15
  123. pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/storage.py +30 -23
  124. pygpt_net/provider/core/{assistant_store → remote_store}/db_sqlite/utils.py +5 -4
  125. pygpt_net/provider/core/{assistant_store → remote_store}/json_file.py +9 -9
  126. pygpt_net/provider/llms/google.py +2 -2
  127. pygpt_net/tools/image_viewer/ui/dialogs.py +298 -12
  128. pygpt_net/tools/text_editor/ui/widgets.py +5 -1
  129. pygpt_net/ui/base/config_dialog.py +3 -2
  130. pygpt_net/ui/base/context_menu.py +44 -1
  131. pygpt_net/ui/dialog/assistant.py +3 -3
  132. pygpt_net/ui/dialog/plugins.py +3 -1
  133. pygpt_net/ui/dialog/remote_store_google.py +539 -0
  134. pygpt_net/ui/dialog/{assistant_store.py → remote_store_openai.py} +95 -95
  135. pygpt_net/ui/dialogs.py +5 -3
  136. pygpt_net/ui/layout/chat/attachments_uploaded.py +3 -3
  137. pygpt_net/ui/layout/toolbox/computer_env.py +26 -8
  138. pygpt_net/ui/layout/toolbox/indexes.py +22 -19
  139. pygpt_net/ui/layout/toolbox/model.py +28 -5
  140. pygpt_net/ui/menu/tools.py +13 -5
  141. pygpt_net/ui/widget/dialog/remote_store_google.py +56 -0
  142. pygpt_net/ui/widget/dialog/{assistant_store.py → remote_store_openai.py} +9 -9
  143. pygpt_net/ui/widget/element/button.py +4 -4
  144. pygpt_net/ui/widget/image/display.py +25 -8
  145. pygpt_net/ui/widget/lists/remote_store_google.py +248 -0
  146. pygpt_net/ui/widget/lists/{assistant_store.py → remote_store_openai.py} +21 -21
  147. pygpt_net/ui/widget/option/checkbox_list.py +47 -9
  148. pygpt_net/ui/widget/option/combo.py +39 -3
  149. pygpt_net/ui/widget/tabs/output.py +9 -1
  150. pygpt_net/ui/widget/textarea/editor.py +14 -1
  151. pygpt_net/ui/widget/textarea/input.py +20 -7
  152. pygpt_net/ui/widget/textarea/notepad.py +24 -1
  153. pygpt_net/ui/widget/textarea/output.py +23 -1
  154. pygpt_net/ui/widget/textarea/web.py +16 -1
  155. {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/METADATA +41 -2
  156. {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/RECORD +158 -132
  157. {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/LICENSE +0 -0
  158. {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.dist-info}/WHEEL +0 -0
  159. {pygpt_net-2.7.4.dist-info → pygpt_net-2.7.6.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.14 00:00:00 #
9
+ # Updated Date: 2026.01.01 15:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.core.types import MODEL_DEFAULT_MINI
@@ -65,7 +65,7 @@ class Config(BaseConfig):
65
65
  use="models",
66
66
  value=MODEL_DEFAULT_MINI,
67
67
  label="Model for question preparation",
68
- description="Model used to prepare question before asking Llama-index, default: gpt-40-mini",
68
+ description="Model used to prepare question before asking Llama-index, default: gpt-4o-mini",
69
69
  tooltip="Model",
70
70
  )
71
71
  plugin.add_option(
@@ -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.09.15 01:00:00 #
9
+ # Updated Date: 2026.01.03 17:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from typing import Optional, Dict, Any
@@ -21,6 +21,7 @@ from pygpt_net.core.types import (
21
21
  MODE_RESEARCH,
22
22
  )
23
23
  from pygpt_net.core.bridge.context import BridgeContext
24
+ from pygpt_net.core.types.chunk import ChunkType
24
25
  from pygpt_net.item.model import ModelItem
25
26
 
26
27
  from .chat import Chat
@@ -94,15 +95,16 @@ class ApiAnthropic:
94
95
  stream = context.stream
95
96
  ctx = context.ctx
96
97
  ai_name = ctx.output_name if ctx else "assistant"
97
-
98
- # Anthropic: no Responses API; stream events are custom to Anthropic
99
- if ctx:
100
- ctx.use_responses_api = False
101
-
102
98
  used_tokens = 0
103
99
  response = None
104
-
105
- if mode in (MODE_COMPLETION, MODE_CHAT, MODE_AUDIO, MODE_RESEARCH):
100
+ ctx.chunk_type = ChunkType.ANTHROPIC
101
+
102
+ if mode in (
103
+ MODE_COMPLETION,
104
+ MODE_CHAT,
105
+ MODE_AUDIO,
106
+ MODE_RESEARCH
107
+ ):
106
108
  # MODE_AUDIO fallback: treat as normal chat (no native audio API)
107
109
  response = self.chat.send(context=context, extra=extra)
108
110
  used_tokens = self.chat.get_used_tokens()
@@ -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.12.25 20:00:00 #
9
+ # Updated Date: 2026.01.03 17:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -22,16 +22,21 @@ from pygpt_net.core.types import (
22
22
  MODE_COMPLETION,
23
23
  MODE_IMAGE,
24
24
  MODE_RESEARCH,
25
+ MODE_COMPUTER,
25
26
  )
26
27
  from pygpt_net.core.bridge.context import BridgeContext
28
+ from pygpt_net.core.types.chunk import ChunkType
27
29
  from pygpt_net.item.model import ModelItem
28
30
 
29
31
  from .chat import Chat
32
+ from .computer import Computer
30
33
  from .vision import Vision
31
34
  from .tools import Tools
32
35
  from .audio import Audio
33
36
  from .image import Image
34
37
  from .realtime import Realtime
38
+ from .remote_tools import RemoteTools
39
+ from .store import Store
35
40
  from .video import Video
36
41
  from .music import Music
37
42
 
@@ -51,6 +56,9 @@ class ApiGoogle:
51
56
  self.realtime = Realtime(window)
52
57
  self.video = Video(window)
53
58
  self.music = Music(window)
59
+ self.computer = Computer(window)
60
+ self.remote_tools = RemoteTools(window)
61
+ self.store = Store(window)
54
62
  self.client: Optional[genai.Client] = None
55
63
  self.locked = False
56
64
  self.last_client_args: Optional[Dict[str, Any]] = None
@@ -117,15 +125,18 @@ class ApiGoogle:
117
125
  stream = context.stream
118
126
  ctx = context.ctx
119
127
  ai_name = ctx.output_name if ctx else "assistant"
120
-
121
- # No Responses API in google-genai
122
- if ctx:
123
- ctx.use_responses_api = False
128
+ ctx.chunk_type = ChunkType.GOOGLE
124
129
 
125
130
  used_tokens = 0
126
131
  response = None
127
132
 
128
- if mode in [MODE_COMPLETION, MODE_CHAT, MODE_AUDIO, MODE_RESEARCH]:
133
+ if mode in [
134
+ MODE_COMPLETION,
135
+ MODE_CHAT,
136
+ MODE_AUDIO,
137
+ MODE_RESEARCH,
138
+ MODE_COMPUTER
139
+ ]:
129
140
 
130
141
  # Live API for audio streaming
131
142
  if mode == MODE_AUDIO and stream:
@@ -138,6 +149,9 @@ class ApiGoogle:
138
149
  if is_realtime:
139
150
  return True
140
151
 
152
+ if mode == MODE_RESEARCH:
153
+ ctx.chunk_type = ChunkType.GOOGLE_INTERACTIONS_API # use interactions API for research
154
+
141
155
  response = self.chat.send(context=context, extra=extra)
142
156
  used_tokens = self.chat.get_used_tokens()
143
157
  if ctx:
@@ -226,7 +240,7 @@ class ApiGoogle:
226
240
  """
227
241
  # with remote tools
228
242
  base_tools = self.tools.prepare(model, functions)
229
- remote_tools = self.build_remote_tools(model)
243
+ remote_tools = self.remote_tools.build_remote_tools(model)
230
244
  tools = (base_tools or []) + (remote_tools or [])
231
245
  """
232
246
 
@@ -262,57 +276,6 @@ class ApiGoogle:
262
276
  finally:
263
277
  self.locked = False
264
278
 
265
- def build_remote_tools(self, model: ModelItem = None) -> list:
266
- """
267
- Build Google GenAI remote tools based on config flags.
268
- - remote_tools.google.web_search: enables grounding via Google Search (Gemini 2.x)
269
- or GoogleSearchRetrieval (Gemini 1.5 fallback).
270
- - remote_tools.google.code_interpreter: enables code execution tool.
271
-
272
- Returns a list of gtypes.Tool objects (can be empty).
273
-
274
- :param model: ModelItem
275
- :return: list of gtypes.Tool
276
- """
277
- tools: list = []
278
- cfg = self.window.core.config
279
- model_id = (model.id if model and getattr(model, "id", None) else "").lower()
280
- is_web = self.window.controller.chat.remote_tools.enabled(model, "web_search") # get global config
281
-
282
- # Google Search tool
283
- if is_web and "image" not in model.id:
284
- try:
285
- if not model_id.startswith("gemini-1.5") and not model_id.startswith("models/gemini-1.5"):
286
- # Gemini 2.x uses GoogleSearch
287
- tools.append(gtypes.Tool(google_search=gtypes.GoogleSearch()))
288
- else:
289
- # Gemini 1.5 fallback uses GoogleSearchRetrieval
290
- # Note: Supported only for 1.5 models.
291
- tools.append(gtypes.Tool(
292
- google_search_retrieval=gtypes.GoogleSearchRetrieval()
293
- ))
294
- except Exception as e:
295
- # Do not break the request if tool construction fails
296
- self.window.core.debug.log(e)
297
-
298
- # Code Execution tool
299
- if cfg.get("remote_tools.google.code_interpreter") and "image" not in model.id:
300
- try:
301
- tools.append(gtypes.Tool(code_execution=gtypes.ToolCodeExecution))
302
- except Exception as e:
303
- self.window.core.debug.log(e)
304
-
305
- # URL Context tool
306
- if cfg.get("remote_tools.google.url_ctx") and "image" not in model.id:
307
- try:
308
- # Supported on Gemini 2.x+ models (not on 1.5)
309
- if not model_id.startswith("gemini-1.5") and not model_id.startswith("models/gemini-1.5"):
310
- tools.append(gtypes.Tool(url_context=gtypes.UrlContext))
311
- except Exception as e:
312
- self.window.core.debug.log(e)
313
-
314
- return tools
315
-
316
279
  def setup_env(self) -> bool:
317
280
  """
318
281
  Setup environment variables for VertexAI via Google GenAI API