pygpt-net 2.6.55__py3-none-any.whl → 2.6.57__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 (218) hide show
  1. pygpt_net/CHANGELOG.txt +12 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +26 -22
  4. pygpt_net/config.py +44 -0
  5. pygpt_net/controller/audio/audio.py +0 -0
  6. pygpt_net/controller/calendar/calendar.py +0 -0
  7. pygpt_net/controller/calendar/note.py +0 -0
  8. pygpt_net/controller/chat/chat.py +0 -0
  9. pygpt_net/controller/chat/handler/openai_stream.py +2 -1
  10. pygpt_net/controller/chat/handler/worker.py +0 -0
  11. pygpt_net/controller/chat/remote_tools.py +5 -3
  12. pygpt_net/controller/chat/render.py +0 -0
  13. pygpt_net/controller/chat/text.py +0 -0
  14. pygpt_net/controller/ctx/common.py +0 -0
  15. pygpt_net/controller/debug/debug.py +26 -2
  16. pygpt_net/controller/debug/fixtures.py +1 -1
  17. pygpt_net/controller/dialogs/confirm.py +15 -1
  18. pygpt_net/controller/dialogs/debug.py +2 -0
  19. pygpt_net/controller/lang/mapping.py +0 -0
  20. pygpt_net/controller/launcher/launcher.py +0 -0
  21. pygpt_net/controller/mode/mode.py +0 -0
  22. pygpt_net/controller/presets/presets.py +0 -0
  23. pygpt_net/controller/realtime/realtime.py +0 -0
  24. pygpt_net/controller/theme/theme.py +0 -0
  25. pygpt_net/controller/ui/mode.py +5 -3
  26. pygpt_net/controller/ui/tabs.py +0 -0
  27. pygpt_net/core/agents/agents.py +3 -1
  28. pygpt_net/core/agents/custom.py +150 -0
  29. pygpt_net/core/agents/provider.py +0 -0
  30. pygpt_net/core/builder/__init__.py +12 -0
  31. pygpt_net/core/builder/graph.py +478 -0
  32. pygpt_net/core/calendar/calendar.py +0 -0
  33. pygpt_net/core/ctx/ctx.py +0 -0
  34. pygpt_net/core/ctx/output.py +0 -0
  35. pygpt_net/core/debug/agent.py +0 -0
  36. pygpt_net/core/debug/agent_builder.py +29 -0
  37. pygpt_net/core/debug/console/console.py +0 -0
  38. pygpt_net/core/debug/db.py +0 -0
  39. pygpt_net/core/debug/debug.py +0 -0
  40. pygpt_net/core/debug/events.py +0 -0
  41. pygpt_net/core/debug/indexes.py +0 -0
  42. pygpt_net/core/debug/kernel.py +0 -0
  43. pygpt_net/core/debug/tabs.py +0 -0
  44. pygpt_net/core/filesystem/filesystem.py +0 -0
  45. pygpt_net/core/fixtures/__init__ +0 -0
  46. pygpt_net/core/fixtures/stream/__init__.py +0 -0
  47. pygpt_net/core/fixtures/stream/generator.py +0 -0
  48. pygpt_net/core/models/models.py +2 -1
  49. pygpt_net/core/plugins/plugins.py +60 -0
  50. pygpt_net/core/render/plain/pid.py +0 -0
  51. pygpt_net/core/render/plain/renderer.py +26 -4
  52. pygpt_net/core/render/web/body.py +46 -4
  53. pygpt_net/core/render/web/debug.py +0 -0
  54. pygpt_net/core/render/web/helpers.py +0 -0
  55. pygpt_net/core/render/web/pid.py +0 -0
  56. pygpt_net/core/render/web/renderer.py +15 -20
  57. pygpt_net/core/tabs/tab.py +0 -0
  58. pygpt_net/core/tabs/tabs.py +0 -0
  59. pygpt_net/core/text/utils.py +0 -0
  60. pygpt_net/css.qrc +0 -0
  61. pygpt_net/css_rc.py +0 -0
  62. pygpt_net/data/config/config.json +8 -7
  63. pygpt_net/data/config/models.json +3 -3
  64. pygpt_net/data/config/settings.json +14 -0
  65. pygpt_net/data/css/web-blocks.css +9 -0
  66. pygpt_net/data/css/web-blocks.dark.css +6 -0
  67. pygpt_net/data/css/web-blocks.darkest.css +6 -0
  68. pygpt_net/data/css/web-chatgpt.css +14 -6
  69. pygpt_net/data/css/web-chatgpt.dark.css +6 -0
  70. pygpt_net/data/css/web-chatgpt.darkest.css +6 -0
  71. pygpt_net/data/css/web-chatgpt.light.css +6 -0
  72. pygpt_net/data/css/web-chatgpt_wide.css +14 -6
  73. pygpt_net/data/css/web-chatgpt_wide.dark.css +6 -0
  74. pygpt_net/data/css/web-chatgpt_wide.darkest.css +6 -0
  75. pygpt_net/data/css/web-chatgpt_wide.light.css +6 -0
  76. pygpt_net/data/fixtures/fake_stream.txt +14 -1
  77. pygpt_net/data/icons/case.svg +0 -0
  78. pygpt_net/data/icons/chat1.svg +0 -0
  79. pygpt_net/data/icons/chat2.svg +0 -0
  80. pygpt_net/data/icons/chat3.svg +0 -0
  81. pygpt_net/data/icons/chat4.svg +0 -0
  82. pygpt_net/data/icons/fit.svg +0 -0
  83. pygpt_net/data/icons/note1.svg +0 -0
  84. pygpt_net/data/icons/note2.svg +0 -0
  85. pygpt_net/data/icons/note3.svg +0 -0
  86. pygpt_net/data/icons/stt.svg +0 -0
  87. pygpt_net/data/icons/translate.svg +0 -0
  88. pygpt_net/data/icons/tts.svg +0 -0
  89. pygpt_net/data/icons/url.svg +0 -0
  90. pygpt_net/data/icons/vision.svg +0 -0
  91. pygpt_net/data/icons/web_off.svg +0 -0
  92. pygpt_net/data/icons/web_on.svg +0 -0
  93. pygpt_net/data/js/app/async.js +166 -0
  94. pygpt_net/data/js/app/bridge.js +88 -0
  95. pygpt_net/data/js/app/common.js +212 -0
  96. pygpt_net/data/js/app/config.js +223 -0
  97. pygpt_net/data/js/app/custom.js +961 -0
  98. pygpt_net/data/js/app/data.js +84 -0
  99. pygpt_net/data/js/app/dom.js +322 -0
  100. pygpt_net/data/js/app/events.js +400 -0
  101. pygpt_net/data/js/app/highlight.js +542 -0
  102. pygpt_net/data/js/app/logger.js +305 -0
  103. pygpt_net/data/js/app/markdown.js +1137 -0
  104. pygpt_net/data/js/app/math.js +167 -0
  105. pygpt_net/data/js/app/nodes.js +395 -0
  106. pygpt_net/data/js/app/queue.js +260 -0
  107. pygpt_net/data/js/app/raf.js +250 -0
  108. pygpt_net/data/js/app/runtime.js +582 -0
  109. pygpt_net/data/js/app/scroll.js +433 -0
  110. pygpt_net/data/js/app/stream.js +2708 -0
  111. pygpt_net/data/js/app/template.js +287 -0
  112. pygpt_net/data/js/app/tool.js +87 -0
  113. pygpt_net/data/js/app/ui.js +86 -0
  114. pygpt_net/data/js/app/user.js +380 -0
  115. pygpt_net/data/js/app/utils.js +64 -0
  116. pygpt_net/data/js/app.min.js +880 -0
  117. pygpt_net/data/js/markdown-it/markdown-it-katex.min.js +1 -1
  118. pygpt_net/data/js/markdown-it/markdown-it.min.js +0 -0
  119. pygpt_net/data/locale/locale.de.ini +3 -1
  120. pygpt_net/data/locale/locale.en.ini +8 -0
  121. pygpt_net/data/locale/locale.es.ini +2 -0
  122. pygpt_net/data/locale/locale.fr.ini +2 -0
  123. pygpt_net/data/locale/locale.it.ini +2 -0
  124. pygpt_net/data/locale/locale.pl.ini +3 -1
  125. pygpt_net/data/locale/locale.uk.ini +3 -1
  126. pygpt_net/data/locale/locale.zh.ini +2 -0
  127. pygpt_net/data/locale/plugin.osm.en.ini +24 -24
  128. pygpt_net/data/locale/plugin.wolfram.en.ini +9 -9
  129. pygpt_net/fonts.qrc +0 -0
  130. pygpt_net/fonts_rc.py +0 -0
  131. pygpt_net/icons.qrc +0 -0
  132. pygpt_net/icons_rc.py +0 -0
  133. pygpt_net/item/agent.py +62 -0
  134. pygpt_net/item/builder_layout.py +62 -0
  135. pygpt_net/js.qrc +24 -1
  136. pygpt_net/js_rc.py +51394 -33687
  137. pygpt_net/plugin/base/worker.py +0 -0
  138. pygpt_net/plugin/cmd_web/config.py +17 -17
  139. pygpt_net/plugin/cmd_web/worker.py +325 -171
  140. pygpt_net/plugin/mcp/__init__.py +0 -0
  141. pygpt_net/plugin/mcp/config.py +0 -0
  142. pygpt_net/plugin/mcp/plugin.py +0 -0
  143. pygpt_net/plugin/mcp/worker.py +0 -0
  144. pygpt_net/plugin/osm/__init__.py +0 -0
  145. pygpt_net/plugin/osm/config.py +0 -0
  146. pygpt_net/plugin/osm/plugin.py +0 -0
  147. pygpt_net/plugin/osm/worker.py +0 -0
  148. pygpt_net/plugin/wolfram/__init__.py +0 -0
  149. pygpt_net/plugin/wolfram/config.py +0 -0
  150. pygpt_net/plugin/wolfram/plugin.py +0 -0
  151. pygpt_net/plugin/wolfram/worker.py +0 -0
  152. pygpt_net/provider/api/anthropic/tools.py +0 -0
  153. pygpt_net/provider/api/google/__init__.py +0 -0
  154. pygpt_net/provider/api/google/video.py +0 -0
  155. pygpt_net/provider/api/openai/agents/experts.py +0 -0
  156. pygpt_net/provider/api/openai/agents/remote_tools.py +0 -0
  157. pygpt_net/provider/api/openai/remote_tools.py +0 -0
  158. pygpt_net/provider/api/openai/responses.py +0 -0
  159. pygpt_net/provider/api/x_ai/__init__.py +2 -0
  160. pygpt_net/provider/api/x_ai/remote.py +0 -0
  161. pygpt_net/provider/core/agent/__init__.py +10 -0
  162. pygpt_net/provider/core/agent/base.py +51 -0
  163. pygpt_net/provider/core/agent/json_file.py +200 -0
  164. pygpt_net/provider/core/config/patch.py +33 -0
  165. pygpt_net/provider/core/config/patches/__init__.py +0 -0
  166. pygpt_net/provider/core/config/patches/patch_before_2_6_42.py +1 -0
  167. pygpt_net/provider/core/ctx/db_sqlite/storage.py +0 -0
  168. pygpt_net/provider/core/model/patches/__init__.py +0 -0
  169. pygpt_net/provider/core/model/patches/patch_before_2_6_42.py +0 -0
  170. pygpt_net/provider/core/preset/patch.py +0 -0
  171. pygpt_net/provider/core/preset/patches/__init__.py +0 -0
  172. pygpt_net/provider/core/preset/patches/patch_before_2_6_42.py +0 -0
  173. pygpt_net/provider/llms/anthropic.py +4 -0
  174. pygpt_net/provider/llms/base.py +2 -0
  175. pygpt_net/provider/llms/deepseek_api.py +2 -0
  176. pygpt_net/provider/llms/google.py +2 -0
  177. pygpt_net/provider/llms/hugging_face_api.py +4 -0
  178. pygpt_net/provider/llms/hugging_face_embedding.py +0 -0
  179. pygpt_net/provider/llms/hugging_face_router.py +2 -0
  180. pygpt_net/provider/llms/local.py +0 -0
  181. pygpt_net/provider/llms/mistral.py +4 -0
  182. pygpt_net/provider/llms/open_router.py +0 -0
  183. pygpt_net/provider/llms/perplexity.py +2 -0
  184. pygpt_net/provider/llms/utils.py +0 -0
  185. pygpt_net/provider/llms/voyage.py +0 -0
  186. pygpt_net/provider/llms/x_ai.py +2 -0
  187. pygpt_net/tools/agent_builder/__init__.py +12 -0
  188. pygpt_net/tools/agent_builder/tool.py +292 -0
  189. pygpt_net/tools/agent_builder/ui/__init__.py +0 -0
  190. pygpt_net/tools/agent_builder/ui/dialogs.py +152 -0
  191. pygpt_net/tools/agent_builder/ui/list.py +228 -0
  192. pygpt_net/tools/code_interpreter/ui/html.py +0 -0
  193. pygpt_net/tools/code_interpreter/ui/widgets.py +0 -0
  194. pygpt_net/tools/html_canvas/tool.py +23 -6
  195. pygpt_net/tools/html_canvas/ui/widgets.py +224 -2
  196. pygpt_net/ui/layout/chat/chat.py +0 -0
  197. pygpt_net/ui/layout/chat/output.py +5 -5
  198. pygpt_net/ui/main.py +10 -9
  199. pygpt_net/ui/menu/debug.py +39 -1
  200. pygpt_net/ui/widget/builder/__init__.py +12 -0
  201. pygpt_net/ui/widget/builder/editor.py +2001 -0
  202. pygpt_net/ui/widget/dialog/base.py +4 -1
  203. pygpt_net/ui/widget/draw/painter.py +0 -0
  204. pygpt_net/ui/widget/element/labels.py +9 -4
  205. pygpt_net/ui/widget/lists/db.py +0 -0
  206. pygpt_net/ui/widget/lists/debug.py +0 -0
  207. pygpt_net/ui/widget/tabs/body.py +0 -0
  208. pygpt_net/ui/widget/textarea/html.py +1 -0
  209. pygpt_net/ui/widget/textarea/input.py +28 -10
  210. pygpt_net/ui/widget/textarea/output.py +21 -1
  211. pygpt_net/ui/widget/textarea/web.py +31 -3
  212. pygpt_net/utils.py +40 -0
  213. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.57.dist-info}/METADATA +16 -2
  214. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.57.dist-info}/RECORD +116 -77
  215. pygpt_net/data/js/app.js +0 -5869
  216. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.57.dist-info}/LICENSE +0 -0
  217. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.57.dist-info}/WHEEL +0 -0
  218. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.57.dist-info}/entry_points.txt +0 -0
File without changes
File without changes
@@ -75,6 +75,8 @@ class ApiXAI:
75
75
  api_key = cfg.get("api_key_xai") or os.environ.get("XAI_API_KEY") or ""
76
76
  timeout = cfg.get("api_native_xai.timeout") # optional
77
77
  proxy = cfg.get("api_proxy") or ""
78
+ if not cfg.get("api_proxy.enabled"):
79
+ proxy = ""
78
80
 
79
81
  kwargs: Dict[str, Any] = {}
80
82
  if api_key:
File without changes
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # ================================================== #
4
+ # This file is a part of PYGPT package #
5
+ # Website: https://pygpt.net #
6
+ # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
+ # MIT License #
8
+ # Created By : Marcin Szczygliński #
9
+ # Updated Date: 2025.09.19 00:00:00 #
10
+ # ================================================== #
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # ================================================== #
4
+ # This file is a part of PYGPT package #
5
+ # Website: https://pygpt.net #
6
+ # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
+ # MIT License #
8
+ # Created By : Marcin Szczygliński #
9
+ # Updated Date: 2025.09.19 00:00:00 #
10
+ # ================================================== #
11
+
12
+ from typing import Dict, Any
13
+
14
+ from packaging.version import Version
15
+
16
+ from pygpt_net.item.agent import AgentItem
17
+ from pygpt_net.item.builder_layout import BuilderLayoutItem
18
+
19
+
20
+ class BaseProvider:
21
+ def __init__(self, window=None):
22
+ self.window = window
23
+ self.id = ""
24
+ self.type = "agent"
25
+
26
+ def attach(self, window):
27
+ self.window = window
28
+
29
+ def install(self):
30
+ pass
31
+
32
+ def patch(self, version: Version) -> bool:
33
+ pass
34
+
35
+ def create(self, assistant: AgentItem) -> str:
36
+ pass
37
+
38
+ def load(self) -> Dict[str, Any]:
39
+ pass
40
+
41
+ def save(self, layout: BuilderLayoutItem, agents: Dict[str, AgentItem]):
42
+ pass
43
+
44
+ def remove(self, id: str):
45
+ pass
46
+
47
+ def truncate(self):
48
+ pass
49
+
50
+ def dump(self, agent: AgentItem) -> str:
51
+ pass
@@ -0,0 +1,200 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # ================================================== #
4
+ # This file is a part of PYGPT package #
5
+ # Website: https://pygpt.net #
6
+ # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
+ # MIT License #
8
+ # Created By : Marcin Szczygliński #
9
+ # Updated Date: 2025.09.19 00:00:00 #
10
+ # ================================================== #
11
+
12
+ import json
13
+ import os
14
+ import uuid
15
+ from typing import Dict, Any
16
+
17
+ from packaging.version import Version
18
+
19
+ from pygpt_net.item.agent import AgentItem
20
+ from pygpt_net.item.builder_layout import BuilderLayoutItem
21
+
22
+ from .base import BaseProvider
23
+
24
+ class JsonFileProvider(BaseProvider):
25
+ def __init__(self, window=None):
26
+ super(JsonFileProvider, self).__init__(window)
27
+ self.window = window
28
+ self.id = "json_file"
29
+ self.type = "agent"
30
+ self.config_file = 'agents.json'
31
+
32
+ def create_id(self) -> str:
33
+ """
34
+ Create unique uuid
35
+
36
+ :return: uuid
37
+ """
38
+ return str(uuid.uuid4())
39
+
40
+ def create(self, agent: AgentItem) -> str:
41
+ """
42
+ Create new and return its ID
43
+
44
+ :param agent: custom gent
45
+ :return: agent ID
46
+ """
47
+ if agent.id is None or agent.id == "":
48
+ agent.id = self.create_id()
49
+ return agent.id
50
+
51
+ def load(self) -> Dict[str, Any]:
52
+ """
53
+ Load custom agents from file
54
+
55
+ :return: dict with layout and agents
56
+ """
57
+ items = {}
58
+ layout = None
59
+ path = os.path.join(self.window.core.config.path, self.config_file)
60
+ try:
61
+ if os.path.exists(path):
62
+ with open(path, 'r', encoding="utf-8") as file:
63
+ data = json.load(file)
64
+ if data == "" or data is None:
65
+ return {}
66
+ if "layout" in data:
67
+ layout = BuilderLayoutItem()
68
+ self.deserialize_layout(data['layout'], layout)
69
+ if "items" in data:
70
+ for id in data['items']:
71
+ agent = AgentItem()
72
+ item = data['items'][id]
73
+ self.deserialize(item, agent)
74
+ items[id] = agent
75
+ except Exception as e:
76
+ self.window.core.debug.log(e)
77
+ items = {}
78
+
79
+ return {
80
+ "layout": layout,
81
+ "agents": items,
82
+ }
83
+
84
+ def save(self, layout: BuilderLayoutItem, agents: Dict[str, AgentItem]):
85
+ """
86
+ Save custom agents to file
87
+
88
+ :param layout: layout dict
89
+ :param agents: dict of agents
90
+ """
91
+ try:
92
+ # update agents
93
+ path = os.path.join(self.window.core.config.path, self.config_file)
94
+ data = {}
95
+ ary = {}
96
+
97
+ # serialize
98
+ for id in agents:
99
+ agent = agents[id]
100
+ ary[id] = self.serialize(agent)
101
+
102
+ data['__meta__'] = self.window.core.config.append_meta()
103
+ data["layout"] = self.serialize_layout(layout)
104
+ data['items'] = ary
105
+ dump = json.dumps(data, indent=4)
106
+ with open(path, 'w', encoding="utf-8") as f:
107
+ f.write(dump)
108
+
109
+ except Exception as e:
110
+ self.window.core.debug.log(e)
111
+ print("Error while saving agents: {}".format(str(e)))
112
+
113
+ def remove(self, id: str):
114
+ """
115
+ Delete by id
116
+
117
+ :param id: id
118
+ """
119
+ pass
120
+
121
+ def truncate(self):
122
+ """Delete all"""
123
+ pass
124
+
125
+ def patch(self, version: Version) -> bool:
126
+ """
127
+ Migrate presets to current app version
128
+
129
+ :param version: current app version
130
+ :return: True if migrated
131
+ """
132
+ return False
133
+
134
+ @staticmethod
135
+ def serialize(item: AgentItem) -> Dict[str, Any]:
136
+ """
137
+ Serialize item to dict
138
+
139
+ :param item: item to serialize
140
+ :return: serialized item
141
+ """
142
+ return {
143
+ 'id': item.id,
144
+ 'name': item.name,
145
+ 'layout': item.layout,
146
+ }
147
+
148
+ @staticmethod
149
+ def deserialize(data: Dict[str, Any], item: AgentItem):
150
+ """
151
+ Deserialize item from dict
152
+
153
+ :param data: serialized item
154
+ :param item: item to deserialize
155
+ """
156
+ if 'id' in data:
157
+ item.id = data['id']
158
+ if 'name' in data:
159
+ item.name = data['name']
160
+ if "layout" in data:
161
+ item.layout = data['layout']
162
+
163
+ @staticmethod
164
+ def serialize_layout(item: BuilderLayoutItem) -> Dict[str, Any]:
165
+ """
166
+ Serialize item to dict
167
+
168
+ :param item: item to serialize
169
+ :return: serialized item
170
+ """
171
+ return {
172
+ 'id': item.id,
173
+ 'name': item.name,
174
+ 'data': item.data,
175
+ }
176
+
177
+ @staticmethod
178
+ def deserialize_layout(data: Dict[str, Any], item: BuilderLayoutItem):
179
+ """
180
+ Deserialize item from dict
181
+
182
+ :param data: serialized item
183
+ :param item: item to deserialize
184
+ """
185
+ if 'id' in data:
186
+ item.id = data['id']
187
+ if 'name' in data:
188
+ item.name = data['name']
189
+ if "data" in data:
190
+ item.data = data['data']
191
+
192
+ def dump(self, item: AgentItem) -> str:
193
+ """
194
+ Dump to string
195
+
196
+ :param item: item to dump
197
+ :return: dumped item as string (json)
198
+ :rtype: str
199
+ """
200
+ return json.dumps(self.serialize(item))
@@ -31,6 +31,7 @@ class Patch:
31
31
  """
32
32
  data = self.window.core.config.all()
33
33
  cfg_get_base = self.window.core.config.get_base
34
+ remove_plugin_config = self.window.core.config.remove_plugin_config
34
35
  patch_css = self.window.core.updater.patch_css
35
36
  current = "0.0.0"
36
37
  updated = False
@@ -111,6 +112,38 @@ class Patch:
111
112
  data["remote_tools.global.web_search"] = True
112
113
  updated = True
113
114
 
115
+ # < 2.6.56
116
+ if old < parse_version("2.6.56"):
117
+ print("Migrating config from < 2.6.56...")
118
+ # copy btn header
119
+ patch_css('web-chatgpt.css', True)
120
+ patch_css('web-chatgpt_wide.css', True)
121
+ patch_css('web-blocks.css', True)
122
+ patch_css('web-blocks.light.css', True)
123
+ patch_css('web-chatgpt.light.css', True)
124
+ patch_css('web-chatgpt_wide.light.css', True)
125
+ patch_css('web-blocks.dark.css', True)
126
+ patch_css('web-chatgpt.dark.css', True)
127
+ patch_css('web-chatgpt_wide.dark.css', True)
128
+ patch_css('web-blocks.darkest.css', True)
129
+ patch_css('web-chatgpt.darkest.css', True)
130
+ patch_css('web-chatgpt_wide.darkest.css', True)
131
+ updated = True
132
+
133
+ # < 2.6.57
134
+ if old < parse_version("2.6.57"):
135
+ print("Migrating config from < 2.6.57...")
136
+ remove_plugin_config("cmd_web", "max_open_urls")
137
+ remove_plugin_config("cmd_web", "cmd.web_url_open")
138
+ remove_plugin_config("cmd_web", "cmd.web_url_raw")
139
+ remove_plugin_config("cmd_web", "cmd.web_extract_links")
140
+ remove_plugin_config("cmd_web", "cmd.web_extract_images")
141
+ if "api_proxy.enabled" not in data:
142
+ data["api_proxy.enabled"] = False
143
+ if "api_proxy" in data and data["api_proxy"]:
144
+ data["api_proxy.enabled"] = True
145
+ updated = True
146
+
114
147
  # update file
115
148
  migrated = False
116
149
  if updated:
File without changes
@@ -29,6 +29,7 @@ class Patch:
29
29
  """
30
30
  data = self.window.core.config.all()
31
31
  cfg_get_base = self.window.core.config.get_base
32
+ remove_plugin_config = self.window.core.config.remove_plugin_config
32
33
  patch_css = self.window.core.updater.patch_css
33
34
  current = "0.0.0"
34
35
  updated = False
File without changes
File without changes
File without changes
File without changes
@@ -73,6 +73,8 @@ class AnthropicLLM(BaseLLM):
73
73
 
74
74
  args = self.parse_args(model.llama_index, window)
75
75
  proxy = window.core.config.get("api_proxy", None)
76
+ if not window.core.config.get("api_proxy.enabled", False):
77
+ proxy = None
76
78
  if "model" not in args:
77
79
  args["model"] = model.id
78
80
  if "api_key" not in args or args["api_key"] == "":
@@ -136,6 +138,8 @@ class AnthropicLLM(BaseLLM):
136
138
  timeout = window.core.config.get("api_native_voyage.timeout")
137
139
  max_retries = window.core.config.get("api_native_voyage.max_retries")
138
140
  proxy = window.core.config.get("api_proxy")
141
+ if not window.core.config.get("api_proxy.enabled", False):
142
+ proxy = ""
139
143
  return VoyageEmbeddingWithProxy(
140
144
  **args,
141
145
  proxy=proxy,
@@ -231,6 +231,8 @@ class BaseLLM:
231
231
  def inject_llamaindex_http_clients(self, args: dict, cfg) -> dict:
232
232
  import httpx
233
233
  proxy = (cfg.get("api_proxy") or "").strip() # e.g. "http://user:pass@host:3128"
234
+ if not cfg.get("api_proxy.enabled", False):
235
+ proxy = ""
234
236
  common_kwargs = dict(timeout=60.0, follow_redirects=True)
235
237
  if proxy:
236
238
  common_kwargs["proxy"] = proxy # httpx>=0.28
@@ -80,6 +80,8 @@ class DeepseekApiLLM(BaseLLM):
80
80
  timeout = window.core.config.get("api_native_voyage.timeout")
81
81
  max_retries = window.core.config.get("api_native_voyage.max_retries")
82
82
  proxy = window.core.config.get("api_proxy")
83
+ if not window.core.config.get("api_proxy.enabled", False):
84
+ proxy = ""
83
85
  return VoyageEmbeddingWithProxy(
84
86
  **args,
85
87
  proxy=proxy,
@@ -140,6 +140,8 @@ class GoogleLLM(BaseLLM):
140
140
 
141
141
  def inject_llamaindex_http_clients(self, args: dict, cfg) -> dict:
142
142
  proxy = cfg.get("api_proxy")
143
+ if not cfg.get("api_proxy.enabled", False):
144
+ proxy = ""
143
145
  if proxy:
144
146
  http_options = gtypes.HttpOptions(
145
147
  client_args={"proxy": proxy},
@@ -117,6 +117,8 @@ class HuggingFaceApiLLM(BaseLLM):
117
117
 
118
118
  # proxy + trust_env (async)
119
119
  proxy = cfg.get("api_proxy") or cfg.get("api_native_hf.proxy")
120
+ if not cfg.get("api_proxy.enabled", False):
121
+ proxy = ""
120
122
  trust_env = cfg.get("api_native_hf.trust_env", False)
121
123
 
122
124
  return HuggingFaceInferenceAPIWithProxy(proxy=proxy, trust_env=trust_env, **args)
@@ -152,6 +154,8 @@ class HuggingFaceApiLLM(BaseLLM):
152
154
 
153
155
  # proxy + trust_env (async)
154
156
  proxy = window.core.config.get("api_proxy") or window.core.config.get("api_native_hf.proxy")
157
+ if not window.core.config.get("api_proxy.enabled", False):
158
+ proxy = ""
155
159
  trust_env = window.core.config.get("api_native_hf.trust_env", False)
156
160
 
157
161
  return HFEmbed(proxy=proxy, trust_env=trust_env, **args)
File without changes
@@ -132,6 +132,8 @@ class HuggingFaceRouterLLM(BaseLLM):
132
132
 
133
133
  # proxy + trust_env (async)
134
134
  proxy = window.core.config.get("api_proxy") or window.core.config.get("api_native_hf.proxy")
135
+ if not window.core.config.get("api_proxy.enabled", False):
136
+ proxy = ""
135
137
  trust_env = window.core.config.get("api_native_hf.trust_env", False)
136
138
 
137
139
  return HFEmbed(proxy=proxy, trust_env=trust_env, **args)
File without changes
@@ -74,6 +74,8 @@ class MistralAILLM(BaseLLM):
74
74
 
75
75
  args = self.parse_args(model.llama_index, window)
76
76
  proxy = window.core.config.get("api_proxy") or None
77
+ if not window.core.config.get("api_proxy.enabled", False):
78
+ proxy = None
77
79
  if "model" not in args:
78
80
  args["model"] = model.id
79
81
  if "api_key" not in args or args["api_key"] == "":
@@ -130,6 +132,8 @@ class MistralAILLM(BaseLLM):
130
132
  args["model_name"] = args.pop("model")
131
133
 
132
134
  proxy = window.core.config.get("api_proxy") or None
135
+ if not window.core.config.get("api_proxy.enabled", False):
136
+ proxy = None
133
137
  return MistralAIEmbeddingWithProxy(**args, proxy=proxy)
134
138
 
135
139
  def init_embeddings(
File without changes
@@ -101,6 +101,8 @@ class PerplexityLLM(BaseLLM):
101
101
  # -----------------------------------
102
102
  # TODO: fallback
103
103
  proxy = cfg.get("api_proxy") or cfg.get("api_native_perplexity.proxy")
104
+ if not cfg.get("api_proxy.enabled", False):
105
+ proxy = ""
104
106
 
105
107
  class PerplexityWithProxy(LlamaPerplexity):
106
108
  def __init__(self, *a, **kw):
File without changes
File without changes
@@ -158,6 +158,8 @@ class xAILLM(BaseLLM):
158
158
  args["api_base"] = cfg.get("api_endpoint_xai", "https://api.x.ai/v1")
159
159
 
160
160
  proxy = cfg.get("api_proxy") or cfg.get("api_native_xai.proxy")
161
+ if not cfg.get("api_proxy.enabled", False):
162
+ proxy = ""
161
163
  timeout = cfg.get("api_native_xai.timeout")
162
164
 
163
165
  # 1) REST (OpenAI-compatible)
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # ================================================== #
4
+ # This file is a part of PYGPT package #
5
+ # Website: https://pygpt.net #
6
+ # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
+ # MIT License #
8
+ # Created By : Marcin Szczygliński #
9
+ # Updated Date: 2025.09.19 00:00:00 #
10
+ # ================================================== #
11
+
12
+ from .tool import *