pygpt-net 2.7.5__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.
- pygpt_net/CHANGELOG.txt +8 -0
- pygpt_net/__init__.py +2 -2
- pygpt_net/controller/chat/handler/worker.py +9 -31
- pygpt_net/controller/chat/handler/xai_stream.py +621 -52
- pygpt_net/controller/debug/fixtures.py +3 -2
- pygpt_net/controller/files/files.py +65 -4
- pygpt_net/core/filesystem/url.py +4 -1
- pygpt_net/core/render/web/body.py +3 -2
- pygpt_net/core/types/chunk.py +27 -0
- pygpt_net/data/config/config.json +2 -2
- pygpt_net/data/config/models.json +2 -2
- pygpt_net/data/config/settings.json +1 -1
- pygpt_net/data/js/app/template.js +1 -1
- pygpt_net/data/js/app.min.js +2 -2
- pygpt_net/data/locale/locale.de.ini +3 -0
- pygpt_net/data/locale/locale.en.ini +3 -0
- pygpt_net/data/locale/locale.es.ini +3 -0
- pygpt_net/data/locale/locale.fr.ini +3 -0
- pygpt_net/data/locale/locale.it.ini +3 -0
- pygpt_net/data/locale/locale.pl.ini +3 -0
- pygpt_net/data/locale/locale.uk.ini +3 -0
- pygpt_net/data/locale/locale.zh.ini +3 -0
- pygpt_net/data/locale/plugin.cmd_mouse_control.en.ini +2 -2
- pygpt_net/item/ctx.py +3 -5
- pygpt_net/js_rc.py +2449 -2447
- pygpt_net/plugin/cmd_mouse_control/config.py +8 -7
- pygpt_net/plugin/cmd_mouse_control/plugin.py +3 -4
- pygpt_net/provider/api/anthropic/__init__.py +10 -8
- pygpt_net/provider/api/google/__init__.py +6 -5
- pygpt_net/provider/api/google/chat.py +1 -2
- pygpt_net/provider/api/openai/__init__.py +7 -3
- pygpt_net/provider/api/openai/responses.py +0 -0
- pygpt_net/provider/api/x_ai/__init__.py +10 -9
- pygpt_net/provider/api/x_ai/chat.py +272 -102
- pygpt_net/tools/image_viewer/ui/dialogs.py +298 -12
- pygpt_net/tools/text_editor/ui/widgets.py +5 -1
- pygpt_net/ui/base/context_menu.py +44 -1
- pygpt_net/ui/layout/toolbox/indexes.py +22 -19
- pygpt_net/ui/layout/toolbox/model.py +28 -5
- pygpt_net/ui/widget/image/display.py +25 -8
- pygpt_net/ui/widget/tabs/output.py +9 -1
- pygpt_net/ui/widget/textarea/editor.py +14 -1
- pygpt_net/ui/widget/textarea/input.py +20 -7
- pygpt_net/ui/widget/textarea/notepad.py +24 -1
- pygpt_net/ui/widget/textarea/output.py +23 -1
- pygpt_net/ui/widget/textarea/web.py +16 -1
- {pygpt_net-2.7.5.dist-info → pygpt_net-2.7.6.dist-info}/METADATA +10 -2
- {pygpt_net-2.7.5.dist-info → pygpt_net-2.7.6.dist-info}/RECORD +50 -49
- {pygpt_net-2.7.5.dist-info → pygpt_net-2.7.6.dist-info}/LICENSE +0 -0
- {pygpt_net-2.7.5.dist-info → pygpt_net-2.7.6.dist-info}/WHEEL +0 -0
- {pygpt_net-2.7.5.dist-info → pygpt_net-2.7.6.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
2.7.6 (2026-01-03)
|
|
2
|
+
|
|
3
|
+
- Fixed compatibility with xAI SDK and resolved empty responses from Grok models.
|
|
4
|
+
- Fixed missing libraries in the Snap package.
|
|
5
|
+
- Added zoom and grab functionality in the Image Viewer.
|
|
6
|
+
- Added a zoom menu to textarea and web widgets.
|
|
7
|
+
- Added the ability to close tabs with a middle mouse button click.
|
|
8
|
+
|
|
1
9
|
2.7.5 (2026-01-03)
|
|
2
10
|
|
|
3
11
|
- Added Sandbox/Playwright option to Computer Use mode.
|
pygpt_net/__init__.py
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
__author__ = "Marcin Szczygliński"
|
|
13
|
-
__copyright__ = "Copyright
|
|
13
|
+
__copyright__ = "Copyright 2026, Marcin Szczygliński"
|
|
14
14
|
__credits__ = ["Marcin Szczygliński"]
|
|
15
15
|
__license__ = "MIT"
|
|
16
|
-
__version__ = "2.7.
|
|
16
|
+
__version__ = "2.7.6"
|
|
17
17
|
__build__ = "2026-01-03"
|
|
18
18
|
__maintainer__ = "Marcin Szczygliński"
|
|
19
19
|
__github__ = "https://github.com/szczyglis-dev/py-gpt"
|
|
@@ -6,20 +6,19 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2026.01.03 17:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import io
|
|
13
13
|
import json
|
|
14
14
|
from dataclasses import dataclass, field
|
|
15
15
|
from typing import Optional, Literal, Any
|
|
16
|
-
from enum import Enum
|
|
17
16
|
|
|
18
17
|
from PySide6.QtCore import QObject, Signal, Slot, QRunnable
|
|
19
18
|
from openai.types.chat import ChatCompletionChunk
|
|
20
19
|
|
|
21
20
|
from pygpt_net.core.events import RenderEvent
|
|
22
|
-
from pygpt_net.core.
|
|
21
|
+
from pygpt_net.core.types.chunk import ChunkType
|
|
23
22
|
from pygpt_net.item.ctx import CtxItem
|
|
24
23
|
|
|
25
24
|
from . import (
|
|
@@ -52,22 +51,6 @@ EventType = Literal[
|
|
|
52
51
|
]
|
|
53
52
|
|
|
54
53
|
|
|
55
|
-
class ChunkType(str, Enum):
|
|
56
|
-
"""
|
|
57
|
-
Enum for chunk type classification.
|
|
58
|
-
"""
|
|
59
|
-
API_CHAT = "api_chat" # OpenAI Chat Completions / or compatible
|
|
60
|
-
API_CHAT_RESPONSES = "api_chat_responses" # OpenAI Responses
|
|
61
|
-
API_COMPLETION = "api_completion" # OpenAI Completions
|
|
62
|
-
LANGCHAIN_CHAT = "langchain_chat" # LangChain chat (deprecated)
|
|
63
|
-
LLAMA_CHAT = "llama_chat" # LlamaIndex chat
|
|
64
|
-
GOOGLE = "google" # Google SDK
|
|
65
|
-
GOOGLE_INTERACTIONS_API = "api_google_interactions" # Google SDK, deep research - interactions
|
|
66
|
-
ANTHROPIC = "anthropic" # Anthropic SDK
|
|
67
|
-
XAI_SDK = "xai_sdk" # xAI SDK
|
|
68
|
-
RAW = "raw" # Raw string fallback
|
|
69
|
-
|
|
70
|
-
|
|
71
54
|
class WorkerSignals(QObject):
|
|
72
55
|
"""
|
|
73
56
|
Defines the signals available from a running worker thread.
|
|
@@ -155,19 +138,13 @@ class StreamWorker(QRunnable):
|
|
|
155
138
|
|
|
156
139
|
etype: Optional[EventType] = None
|
|
157
140
|
|
|
158
|
-
# detect chunk type
|
|
159
|
-
if ctx.
|
|
141
|
+
# detect chunk type if not defined
|
|
142
|
+
if ctx.chunk_type:
|
|
143
|
+
state.chunk_type = ctx.chunk_type
|
|
160
144
|
if hasattr(chunk, 'type'):
|
|
161
|
-
etype = chunk.type
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
continue
|
|
165
|
-
elif ctx.use_google_interactions_api:
|
|
166
|
-
if hasattr(chunk, 'event_type'):
|
|
167
|
-
etype = chunk.event_type # type: ignore[assignment]
|
|
168
|
-
state.chunk_type = ChunkType.GOOGLE_INTERACTIONS_API
|
|
169
|
-
else:
|
|
170
|
-
continue
|
|
145
|
+
etype = chunk.type
|
|
146
|
+
elif hasattr(chunk, 'event_type'):
|
|
147
|
+
etype = chunk.event_type
|
|
171
148
|
else:
|
|
172
149
|
state.chunk_type = self._detect_chunk_type(chunk)
|
|
173
150
|
|
|
@@ -549,6 +526,7 @@ class StreamWorker(QRunnable):
|
|
|
549
526
|
return anthropic_stream.process_anthropic_chunk(ctx, core, state, chunk)
|
|
550
527
|
|
|
551
528
|
def _process_xai_sdk_chunk(self, ctx, core, state, item):
|
|
529
|
+
print(item)
|
|
552
530
|
return xai_stream.process_xai_sdk_chunk(ctx, core, state, item)
|
|
553
531
|
|
|
554
532
|
def _process_raw(self, chunk) -> Optional[str]:
|