pygpt-net 2.6.53__py3-none-any.whl → 2.6.54__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 (35) hide show
  1. pygpt_net/CHANGELOG.txt +6 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +4 -0
  4. pygpt_net/controller/chat/remote_tools.py +2 -2
  5. pygpt_net/controller/ui/mode.py +7 -1
  6. pygpt_net/core/agents/provider.py +16 -9
  7. pygpt_net/core/models/models.py +25 -1
  8. pygpt_net/data/config/config.json +4 -4
  9. pygpt_net/data/config/models.json +3 -3
  10. pygpt_net/data/js/app.js +19 -0
  11. pygpt_net/data/locale/plugin.osm.en.ini +35 -0
  12. pygpt_net/data/locale/plugin.wolfram.en.ini +24 -0
  13. pygpt_net/js_rc.py +10490 -10432
  14. pygpt_net/plugin/base/worker.py +7 -1
  15. pygpt_net/plugin/osm/__init__.py +12 -0
  16. pygpt_net/plugin/osm/config.py +267 -0
  17. pygpt_net/plugin/osm/plugin.py +87 -0
  18. pygpt_net/plugin/osm/worker.py +719 -0
  19. pygpt_net/plugin/wolfram/__init__.py +12 -0
  20. pygpt_net/plugin/wolfram/config.py +214 -0
  21. pygpt_net/plugin/wolfram/plugin.py +115 -0
  22. pygpt_net/plugin/wolfram/worker.py +551 -0
  23. pygpt_net/provider/api/google/video.py +0 -0
  24. pygpt_net/provider/api/openai/agents/experts.py +1 -1
  25. pygpt_net/provider/api/openai/chat.py +2 -9
  26. pygpt_net/provider/api/x_ai/remote.py +2 -2
  27. pygpt_net/provider/llms/anthropic.py +29 -1
  28. pygpt_net/provider/llms/google.py +30 -1
  29. pygpt_net/provider/llms/open_router.py +3 -1
  30. pygpt_net/provider/llms/x_ai.py +21 -1
  31. {pygpt_net-2.6.53.dist-info → pygpt_net-2.6.54.dist-info}/METADATA +32 -2
  32. {pygpt_net-2.6.53.dist-info → pygpt_net-2.6.54.dist-info}/RECORD +34 -24
  33. {pygpt_net-2.6.53.dist-info → pygpt_net-2.6.54.dist-info}/LICENSE +0 -0
  34. {pygpt_net-2.6.53.dist-info → pygpt_net-2.6.54.dist-info}/WHEEL +0 -0
  35. {pygpt_net-2.6.53.dist-info → pygpt_net-2.6.54.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt CHANGED
@@ -1,3 +1,9 @@
1
+ 2.6.54 (2025-09-18)
2
+
3
+ - Added: Remote tools (like web search) are now also available in the Chat with Files and Agents (LlamaIndex) modes.
4
+ - Added: Two new plugins: Wolfram Alpha and OpenStreetMap.
5
+ - Fixed: Enabled local file-like schemes in links/images in the markdown-it parser.
6
+
1
7
  2.6.53 (2025-09-17)
2
8
 
3
9
  - Added: An icon to enable/disable the web search remote tool in the icon bar, along with remote web search functionality in OpenRouter (#135).
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.17 00:00:00 #
9
+ # Updated Date: 2025.09.18 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.53"
17
- __build__ = "2025-09-17"
16
+ __version__ = "2.6.54"
17
+ __build__ = "2025-09-18"
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"
pygpt_net/app.py CHANGED
@@ -97,6 +97,8 @@ from pygpt_net.plugin.server import Plugin as ServerPlugin
97
97
  from pygpt_net.plugin.tuya import Plugin as TuyaPlugin
98
98
  from pygpt_net.plugin.wikipedia import Plugin as WikipediaPlugin
99
99
  from pygpt_net.plugin.mcp import Plugin as MCPPlugin
100
+ from pygpt_net.plugin.wolfram import Plugin as WolframPlugin
101
+ from pygpt_net.plugin.osm import Plugin as OSMPlugin
100
102
 
101
103
  # agents (Llama-index)
102
104
  # from pygpt_net.provider.agents.llama_index.legacy.openai import OpenAIAgent
@@ -427,6 +429,8 @@ def run(**kwargs):
427
429
  launcher.add_plugin(TuyaPlugin())
428
430
  launcher.add_plugin(WikipediaPlugin())
429
431
  launcher.add_plugin(MCPPlugin())
432
+ launcher.add_plugin(WolframPlugin())
433
+ launcher.add_plugin(OSMPlugin())
430
434
 
431
435
  # register custom plugins
432
436
  plugins = kwargs.get('plugins', None)
@@ -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.17 05:00:00 #
9
+ # Updated Date: 2025.09.17 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from typing import Union
@@ -109,7 +109,7 @@ class RemoteTools:
109
109
  cfg_set("remote_tools.anthropic.web_search", state)
110
110
 
111
111
  # xAI has 3 modes: auto, on, off
112
- cfg_set("remote_tools.xai.mode", "auto" if state else "off")
112
+ cfg_set("remote_tools.xai.mode", "on" if state else "off")
113
113
 
114
114
  # save config
115
115
  self.window.core.config.save()
@@ -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.17 07:00:00 #
9
+ # Updated Date: 2025.09.17 20:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.core.types import (
@@ -195,6 +195,12 @@ class Mode:
195
195
  show = self.are_attachments(mode)
196
196
  ui_tabs['input'].setTabVisible(1, show)
197
197
 
198
+ # remote tools icon visibility
199
+ if not is_image and not is_completion:
200
+ ui_nodes['icon.remote_tool.web'].setVisible(True)
201
+ else:
202
+ ui_nodes['icon.remote_tool.web'].setVisible(False)
203
+
198
204
  ui_tabs['input'].setTabVisible(2, is_assistant)
199
205
  ui_tabs['input'].setTabVisible(3, (not is_assistant) and (not is_image))
200
206
 
@@ -6,9 +6,9 @@
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.24 03:00:00 #
9
+ # Updated Date: 2025.09.17 19:00:00 #
10
10
  # ================================================== #
11
- import os
11
+
12
12
  from typing import List, Dict, Any
13
13
 
14
14
  from pygpt_net.core.types import MODE_CHAT
@@ -108,11 +108,18 @@ class Provider:
108
108
  from agents import (
109
109
  OpenAIChatCompletionsModel,
110
110
  )
111
- if model.provider == "openai":
111
+ models = self.window.core.models
112
+ if isinstance(model, str):
113
+ model = models.get(model)
114
+
115
+ model_id = model.id
116
+ if model.provider in ("openai", "azure_openai"):
112
117
  return model.id
113
- else:
114
- args = self.window.core.models.prepare_client_args(MODE_CHAT, model)
115
- return OpenAIChatCompletionsModel(
116
- model=model.id,
117
- openai_client=AsyncOpenAI(**args),
118
- )
118
+ elif model.provider == "open_router":
119
+ model_id = models.get_openrouter_model(model)
120
+
121
+ args = models.prepare_client_args(MODE_CHAT, model)
122
+ return OpenAIChatCompletionsModel(
123
+ model=model_id,
124
+ openai_client=AsyncOpenAI(**args),
125
+ )
@@ -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.12 00:00:00 #
9
+ # Updated Date: 2025.09.17 19:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import copy
@@ -526,6 +526,30 @@ class Models:
526
526
  self.window.core.debug.info("[api] No model provided, using default OpenAI client")
527
527
  return args
528
528
 
529
+ def get_openrouter_model(self, model: ModelItem) -> str:
530
+ """
531
+ Get OpenRouter model by model id
532
+
533
+ :param model: ModelItem
534
+ :return: OpenRouter model id
535
+ """
536
+ if isinstance(model, str):
537
+ model = self.get(model)
538
+ if not model or model.provider != "open_router":
539
+ return model.id if model else None
540
+
541
+ # OpenRouter: add web search remote tool (if enabled)
542
+ # https://openrouter.ai/docs/features/web-search
543
+ model_id = model.id
544
+ is_web = self.window.controller.chat.remote_tools.enabled(model, "web_search") # web search config
545
+ if is_web:
546
+ if not model_id.endswith(":online"):
547
+ model_id += ":online"
548
+ else:
549
+ if model_id.endswith(":online"):
550
+ model_id = model_id.replace(":online", "")
551
+ return model_id
552
+
529
553
  def is_tool_call_allowed(self, mode: str, model: ModelItem) -> bool:
530
554
  """
531
555
  Check if native tool call is allowed for model and mode
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "__meta__": {
3
- "version": "2.6.53",
4
- "app.version": "2.6.53",
5
- "updated_at": "2025-09-17T00:00:00"
3
+ "version": "2.6.54",
4
+ "app.version": "2.6.54",
5
+ "updated_at": "2025-09-18T00:00:00"
6
6
  },
7
7
  "access.audio.event.speech": false,
8
8
  "access.audio.event.speech.disabled": [],
@@ -97,7 +97,7 @@
97
97
  "api_native_xai": true,
98
98
  "api_proxy": "",
99
99
  "api_use_responses": true,
100
- "api_use_responses_llama": false,
100
+ "api_use_responses_llama": true,
101
101
  "app.env": [
102
102
  {
103
103
  "name": "OLLAMA_API_BASE",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "__meta__": {
3
- "version": "2.6.53",
4
- "app.version": "2.6.53",
5
- "updated_at": "2025-09-17T08:03:34"
3
+ "version": "2.6.54",
4
+ "app.version": "2.6.54",
5
+ "updated_at": "2025-09-18T00:00:00"
6
6
  },
7
7
  "items": {
8
8
  "SpeakLeash/bielik-11b-v2.3-instruct:Q4_K_M": {
pygpt_net/data/js/app.js CHANGED
@@ -2082,6 +2082,25 @@
2082
2082
  // Streaming renderer (no linkify) – hot path
2083
2083
  this.MD_STREAM = window.markdownit({ html: false, linkify: false, breaks: true, highlight: () => '' });
2084
2084
 
2085
+ //allow local file-like schemes in links/images (markdown-it blocks file:// by default).
2086
+ const installLinkValidator = (md) => {
2087
+ const orig = (md && typeof md.validateLink === 'function') ? md.validateLink.bind(md) : null;
2088
+ md.validateLink = (url) => {
2089
+ try {
2090
+ const s = String(url || '').trim().toLowerCase();
2091
+ if (s.startsWith('file:')) return true; // local files
2092
+ if (s.startsWith('qrc:')) return true; // Qt resources
2093
+ if (s.startsWith('bridge:')) return true; // app bridge scheme
2094
+ if (s.startsWith('blob:')) return true; // blobs
2095
+ if (s.startsWith('data:image/')) return true; // inline images
2096
+ } catch (_) {}
2097
+ return orig ? orig(url) : true;
2098
+ };
2099
+ };
2100
+
2101
+ installLinkValidator(this.MD);
2102
+ installLinkValidator(this.MD_STREAM);
2103
+
2085
2104
  // SAFETY: disable CommonMark "indented code blocks" unless explicitly enabled.
2086
2105
  if (!this.cfg.MD || this.cfg.MD.ALLOW_INDENTED_CODE !== true) {
2087
2106
  try { this.MD.block.ruler.disable('code'); } catch (_) {}
@@ -0,0 +1,35 @@
1
+ [LOCALE]
2
+ plugin.description = Search, geocode, plan routes, and generate static maps using OpenStreetMap services (Nominatim, OSRM, staticmap). Images are saved under data/openstreetmap/.
3
+ plugin.name = OpenStreetMap
4
+ http_timeout.description = Requests timeout in seconds.
5
+ http_timeout.label = HTTP timeout (s)
6
+ user_agent.description = Custom User-Agent for outgoing requests.
7
+ user_agent.label = User-Agent
8
+ contact_email.description = Contact email sent to Nominatim as recommended by its usage policy.
9
+ contact_email.label = Contact email (Nominatim)
10
+ accept_language.description = Preferred language for results, e.g. 'pl,en-US;q=0.8'.
11
+ accept_language.label = Accept-Language
12
+ nominatim_base.description = Base URL for Nominatim (geocoding).
13
+ nominatim_base.label = Nominatim base
14
+ osrm_base.description = Base URL for OSRM routing service.
15
+ osrm_base.label = OSRM base
16
+ staticmap_base.description = Base URL for static map service.
17
+ staticmap_base.label = Static map base
18
+ tile_base.description = Base URL for XYZ tiles (z/x/y.png).
19
+ tile_base.label = Tile base
20
+ map_type.description = Default static map layer type.
21
+ map_type.label = Default map type
22
+ map_zoom.description = Default zoom level for center-based maps.
23
+ map_zoom.label = Default zoom
24
+ map_width.description = Default static map width in pixels.
25
+ map_width.label = Default width
26
+ map_height.description = Default static map height in pixels.
27
+ map_height.label = Default height
28
+ route.mode.description = url | summary | full (default summary)
29
+ route.include_geometry.label = Include geometry (polyline6)
30
+ route.include_steps.label = Include steps (full mode only)
31
+ route.max_polyline_chars.label = Max polyline characters
32
+ route.debug_url.label = Include OSRM request URL
33
+ route.save_map.label = Build preview URL (openstreetmap.org)
34
+ param.layers.label = Layers
35
+ param.layers.description = Optional 'layers=' for openstreetmap.org URLs
@@ -0,0 +1,24 @@
1
+ [LOCALE]
2
+ plugin.description = Compute and solve with Wolfram Alpha: short answers, full JSON pods, math (solve, derivatives, integrals), unit conversions, matrix operations, and plots. Images are saved under data/wolframalpha/.
3
+ plugin.name = Wolfram Alpha
4
+ api_base.description = Base API URL (default https://api.wolframalpha.com).
5
+ api_base.label = API base
6
+ api_base.tooltip = Change only if using a proxy or enterprise gateway.
7
+ http_timeout.description = Requests timeout in seconds.
8
+ http_timeout.label = HTTP timeout (s)
9
+ http_timeout.tooltip = Increase if you experience timeouts on large queries.
10
+ wa_appid.description = Your Wolfram Alpha AppID.
11
+ wa_appid.label = Wolfram Alpha AppID
12
+ wa_appid.tooltip = Create one at developer.wolframalpha.com. Required.
13
+ units.description = Preferred unit system for supported endpoints.
14
+ units.label = Units
15
+ units.tooltip = Use 'metric' or 'nonmetric'.
16
+ simple_background.description = Background for Simple API images.
17
+ simple_background.label = Simple background
18
+ simple_background.tooltip = 'white' or 'transparent'.
19
+ simple_layout.description = Layout style for Simple API images.
20
+ simple_layout.label = Simple layout
21
+ simple_layout.tooltip = e.g., 'labelbar', 'inputonly'.
22
+ simple_width.description = Target width for Simple API images.
23
+ simple_width.label = Simple width
24
+ simple_width.tooltip = In pixels. Leave empty to use service default.