pygpt-net 2.4.50__py3-none-any.whl → 2.4.52__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.
- CHANGELOG.md +11 -0
- README.md +12 -62
- pygpt_net/CHANGELOG.txt +11 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/controller/audio/__init__.py +86 -1
- pygpt_net/controller/lang/custom.py +2 -1
- pygpt_net/controller/plugins/__init__.py +5 -30
- pygpt_net/controller/ui/tabs.py +14 -3
- pygpt_net/core/audio/capture.py +19 -1
- pygpt_net/data/config/config.json +5 -3
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/config/modes.json +3 -3
- pygpt_net/data/config/settings.json +13 -0
- 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/plugin/audio_input/simple.py +31 -8
- pygpt_net/plugin/cmd_files/worker.py +37 -1
- pygpt_net/provider/core/config/patch.py +9 -1
- pygpt_net/ui/__init__.py +4 -2
- pygpt_net/ui/layout/chat/input.py +0 -12
- pygpt_net/ui/menu/__init__.py +4 -3
- pygpt_net/ui/widget/audio/input_button.py +31 -23
- {pygpt_net-2.4.50.dist-info → pygpt_net-2.4.52.dist-info}/LICENSE +1 -1
- {pygpt_net-2.4.50.dist-info → pygpt_net-2.4.52.dist-info}/METADATA +13 -63
- {pygpt_net-2.4.50.dist-info → pygpt_net-2.4.52.dist-info}/RECORD +33 -33
- {pygpt_net-2.4.50.dist-info → pygpt_net-2.4.52.dist-info}/WHEEL +0 -0
- {pygpt_net-2.4.50.dist-info → pygpt_net-2.4.52.dist-info}/entry_points.txt +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2.4.52 (2025-01-17)
|
4
|
+
|
5
|
+
- Improved audio input button visibility toggle.
|
6
|
+
- Fix: check for required arguments - issue #88.
|
7
|
+
- UI Fixes.
|
8
|
+
|
9
|
+
## 2.4.51 (2025-01-17)
|
10
|
+
|
11
|
+
- Added a "Continuous recording" mode under Audio Input in the Notepad tab, allowing for recording long voice notes and real-time auto-transcription. (beta)
|
12
|
+
- A new option has been added in Settings -> Audio -> Continuous recording auto-transcribe interval.
|
13
|
+
|
3
14
|
## 2.4.50 (2025-01-16)
|
4
15
|
|
5
16
|
- Refactored audio input core.
|
README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://snapcraft.io/pygpt)
|
4
4
|
|
5
|
-
Release: **2.4.
|
5
|
+
Release: **2.4.52** | build: **2025.01.17** | Python: **>=3.10, <3.13**
|
6
6
|
|
7
7
|
> Official website: https://pygpt.net | Documentation: https://pygpt.readthedocs.io
|
8
8
|
>
|
@@ -3953,6 +3953,17 @@ may consume additional tokens that are not displayed in the main window.
|
|
3953
3953
|
|
3954
3954
|
## Recent changes:
|
3955
3955
|
|
3956
|
+
**2.4.52 (2025-01-17)**
|
3957
|
+
|
3958
|
+
- Improved audio input button visibility toggle.
|
3959
|
+
- Fix: check for required arguments - issue #88.
|
3960
|
+
- UI Fixes.
|
3961
|
+
|
3962
|
+
**2.4.51 (2025-01-17)**
|
3963
|
+
|
3964
|
+
- Added a "Continuous recording" mode under Audio Input in the Notepad tab, allowing for recording long voice notes and real-time auto-transcription. (beta)
|
3965
|
+
- A new option has been added in Settings -> Audio -> Continuous recording auto-transcribe interval.
|
3966
|
+
|
3956
3967
|
**2.4.50 (2025-01-16)**
|
3957
3968
|
|
3958
3969
|
- Refactored audio input core.
|
@@ -3983,67 +3994,6 @@ may consume additional tokens that are not displayed in the main window.
|
|
3983
3994
|
- Introduced a new mode in "Chat with Files": "Retrieve Only", which allows for retrieving raw documents from the index.
|
3984
3995
|
- Fixed a bug related to tool calls in the Gemini provider when using Chat with Files mode.
|
3985
3996
|
|
3986
|
-
**2.4.45 (2024-12-16)**
|
3987
|
-
|
3988
|
-
- Enhanced web data loaders UI.
|
3989
|
-
|
3990
|
-
**2.4.44 (2024-12-16)**
|
3991
|
-
|
3992
|
-
- Enhanced web data loaders.
|
3993
|
-
- Web loaders have been added to attachments, allowing external web content to be attached to context via the "+Web" button in the Attachments tab.
|
3994
|
-
- Improved handling of attachments in groups and added an attachment icon when a group contains attachments.
|
3995
|
-
|
3996
|
-
**2.4.43 (2024-12-15)**
|
3997
|
-
|
3998
|
-
- Fix: Bug on attachment upload.
|
3999
|
-
- Added: Attachments uploaded in groups are now available for all contexts in the group (beta).
|
4000
|
-
|
4001
|
-
**2.4.42 (2024-12-15)**
|
4002
|
-
|
4003
|
-
- Added Mailer plugin, which allows sending and retrieving emails from the server, and reading them. It currently supports only SMTP.
|
4004
|
-
- Added 'web_request' command to the Web Search plugin, enabling GET/POST/PUT and other connections to any address and API endpoint. It also supports sending POST data, files, headers, cookies, and more.
|
4005
|
-
- Improved audio output.
|
4006
|
-
- Enhanced visibility of the Video menu.
|
4007
|
-
- Other fixes.
|
4008
|
-
|
4009
|
-
**2.4.41 (2024-12-14)**
|
4010
|
-
|
4011
|
-
- Improved switching between columns on a split screen.
|
4012
|
-
- Added visual identification of the active column.
|
4013
|
-
|
4014
|
-
**2.4.40 (2024-12-13)**
|
4015
|
-
|
4016
|
-
- Enhanced Split Screen mode, now promoted from beta to stable.
|
4017
|
-
- Python Code Interpreter tool added to the Tabs.
|
4018
|
-
- HTML/JS Canvas tool added to the Tabs.
|
4019
|
-
- Added attachment icon to the context list if context has attachments.
|
4020
|
-
- Improved audio playback.
|
4021
|
-
- Improved web search.
|
4022
|
-
- Added a thumbnail image to web search results.
|
4023
|
-
- Added a new commands to web search: "extract_images" and "extract_links".
|
4024
|
-
- Added the option "Use raw content (without summarization)" to the web search plugin, which provides a more detailed result to the main model.
|
4025
|
-
- Extended the default maximum result characters to 50,000 in the web search plugin.
|
4026
|
-
|
4027
|
-
**2.4.39 (2024-12-09)**
|
4028
|
-
|
4029
|
-
- Added "Split Screen" mode (accessible via the switch in the bottom-right corner of the screen), which allows you to work in two windows simultaneously. It is currently experimental (beta). Future updates will include Code Interpreter and Canvas running in tabs.
|
4030
|
-
|
4031
|
-
- Fixed: Language switch.
|
4032
|
-
|
4033
|
-
**2.4.38 (2024-12-08)**
|
4034
|
-
|
4035
|
-
- Added the ability to select a style for chat display between: Blocks, ChatGPT-like, and ChatGPT-like Wide. New option in the menu: Config -> Theme -> Style...
|
4036
|
-
- Added configuration options for audio input in Settings -> Audio -> Audio Input Device, Channels, and Sampling rate.
|
4037
|
-
|
4038
|
-
**2.4.37 (2024-11-30)**
|
4039
|
-
|
4040
|
-
- The `Query only` mode in `Uploaded` tab has been renamed to `RAG`.
|
4041
|
-
- New options have been added under `Settings -> Files and Attachments`:
|
4042
|
-
- `Use history in RAG query`: When enabled, the content of the entire conversation will be used when preparing a query if the mode is set to RAG or Summary.
|
4043
|
-
- `RAG limit`: This option is applicable only if 'Use history in RAG query' is enabled. It specifies the limit on how many recent entries in the conversation will be used when generating a query for RAG. A value of 0 indicates no limit.
|
4044
|
-
- Cache: dynamic parts of the system prompt (from plugins) have been moved to the very end of the prompt stack to enable the use of prompt cache mechanisms in OpenAI.
|
4045
|
-
|
4046
|
-
|
4047
3997
|
# Credits and links
|
4048
3998
|
|
4049
3999
|
**Official website:** <https://pygpt.net>
|
pygpt_net/CHANGELOG.txt
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
2.4.52 (2025-01-17)
|
2
|
+
|
3
|
+
- Improved audio input button visibility toggle.
|
4
|
+
- Fix: check for required arguments - issue #88.
|
5
|
+
- UI Fixes.
|
6
|
+
|
7
|
+
2.4.51 (2025-01-17)
|
8
|
+
|
9
|
+
- Added a "Continuous recording" mode under Audio Input in the Notepad tab, allowing for recording long voice notes and real-time auto-transcription. (beta)
|
10
|
+
- A new option has been added in Settings -> Audio -> Continuous recording auto-transcribe interval.
|
11
|
+
|
1
12
|
2.4.50 (2025-01-16)
|
2
13
|
|
3
14
|
- Refactored audio input core.
|
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.01.
|
9
|
+
# Updated Date: 2025.01.17 13: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.4.
|
17
|
-
__build__ = "2025.01.
|
16
|
+
__version__ = "2.4.52"
|
17
|
+
__build__ = "2025.01.17"
|
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,12 +6,13 @@
|
|
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: 2025.01.17 13:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
import os
|
13
13
|
from typing import Optional
|
14
14
|
|
15
|
+
from pygpt_net.core.tabs.tab import Tab
|
15
16
|
from pygpt_net.core.events import Event, BaseEvent
|
16
17
|
from pygpt_net.item.ctx import CtxItem
|
17
18
|
from pygpt_net.utils import trans
|
@@ -25,10 +26,17 @@ class Audio:
|
|
25
26
|
:param window: Window instance
|
26
27
|
"""
|
27
28
|
self.window = window
|
29
|
+
self.input_allowed_tabs = [
|
30
|
+
Tab.TAB_NOTEPAD,
|
31
|
+
Tab.TAB_CHAT,
|
32
|
+
Tab.TAB_TOOL_CALENDAR,
|
33
|
+
]
|
28
34
|
|
29
35
|
def setup(self):
|
30
36
|
"""Setup controller"""
|
31
37
|
self.update()
|
38
|
+
if self.window.core.config.get("audio.input.continuous", False):
|
39
|
+
self.window.ui.plugin_addon['audio.input.btn'].continuous.setChecked(True)
|
32
40
|
|
33
41
|
def toggle_input(
|
34
42
|
self,
|
@@ -54,6 +62,31 @@ class Audio:
|
|
54
62
|
else:
|
55
63
|
self.enable_output()
|
56
64
|
|
65
|
+
def toggle_continuous(self, state: bool):
|
66
|
+
"""
|
67
|
+
Toggle continuous audio input
|
68
|
+
|
69
|
+
:param state: True to enable, False to disable
|
70
|
+
"""
|
71
|
+
if state:
|
72
|
+
self.window.core.config.set("audio.input.continuous", True)
|
73
|
+
else:
|
74
|
+
self.window.core.config.set("audio.input.continuous", False)
|
75
|
+
self.window.core.config.save()
|
76
|
+
|
77
|
+
def on_tab_changed(self, tab: Tab):
|
78
|
+
"""
|
79
|
+
On tab changed event
|
80
|
+
|
81
|
+
:param tab: Tab instance (current tab)
|
82
|
+
"""
|
83
|
+
# input button visibility
|
84
|
+
if self.is_input_enabled():
|
85
|
+
if tab.type in self.input_allowed_tabs:
|
86
|
+
self.handle_audio_input(True) # show btn
|
87
|
+
else:
|
88
|
+
self.handle_audio_input(False) # hide btn
|
89
|
+
|
57
90
|
def enable_output(self):
|
58
91
|
"""Enable audio output"""
|
59
92
|
self.toggle_output_icon(True)
|
@@ -347,3 +380,55 @@ class Audio:
|
|
347
380
|
except Exception as e:
|
348
381
|
pass
|
349
382
|
return False
|
383
|
+
|
384
|
+
def handle_audio_input(
|
385
|
+
self,
|
386
|
+
is_enabled: bool
|
387
|
+
):
|
388
|
+
"""
|
389
|
+
Handle audio input UI
|
390
|
+
|
391
|
+
:param is_enabled: enable/disable audio input
|
392
|
+
"""
|
393
|
+
# get advanced audio input option
|
394
|
+
is_advanced = False
|
395
|
+
data = {
|
396
|
+
'name': 'audio.input.advanced',
|
397
|
+
'value': is_advanced,
|
398
|
+
}
|
399
|
+
event = Event(Event.PLUGIN_OPTION_GET, data)
|
400
|
+
self.window.dispatch(event)
|
401
|
+
if 'value' in event.data:
|
402
|
+
is_advanced = event.data['value']
|
403
|
+
if is_enabled:
|
404
|
+
# show/hide extra options
|
405
|
+
tab = self.window.controller.ui.tabs.get_current_tab()
|
406
|
+
if tab.type == Tab.TAB_NOTEPAD:
|
407
|
+
self.window.ui.plugin_addon['audio.input.btn'].notepad_footer.setVisible(True)
|
408
|
+
else:
|
409
|
+
self.window.ui.plugin_addon['audio.input.btn'].notepad_footer.setVisible(False)
|
410
|
+
if is_advanced:
|
411
|
+
self.window.ui.plugin_addon['audio.input.btn'].setVisible(False)
|
412
|
+
self.window.ui.plugin_addon['audio.input'].setVisible(True)
|
413
|
+
else:
|
414
|
+
self.window.ui.plugin_addon['audio.input.btn'].setVisible(True) # simple recording
|
415
|
+
self.window.ui.plugin_addon['audio.input'].setVisible(False) # advanced recording
|
416
|
+
self.toggle_input_icon(True)
|
417
|
+
else:
|
418
|
+
self.window.ui.plugin_addon['audio.input.btn'].setVisible(False) # simple recording
|
419
|
+
self.window.ui.plugin_addon['audio.input'].setVisible(False) # advanced recording
|
420
|
+
self.toggle_input_icon(False)
|
421
|
+
|
422
|
+
def handle_audio_output(self, is_enabled: bool):
|
423
|
+
"""
|
424
|
+
Handle audio output UI
|
425
|
+
|
426
|
+
:param is_enabled: enable/disable audio output
|
427
|
+
"""
|
428
|
+
if is_enabled:
|
429
|
+
self.toggle_output_icon(True)
|
430
|
+
# self.window.ui.plugin_addon['audio.output'].setVisible(True)
|
431
|
+
else:
|
432
|
+
self.window.ui.plugin_addon['audio.output'].setVisible(False)
|
433
|
+
self.toggle_output_icon(False)
|
434
|
+
|
@@ -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:
|
9
|
+
# Updated Date: 2025.01.17 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from PySide6.QtCore import Qt
|
@@ -46,6 +46,7 @@ class Custom:
|
|
46
46
|
|
47
47
|
# checkboxes
|
48
48
|
self.window.ui.plugin_addon['audio.input'].btn_toggle.setText(trans('audio.speak.btn'))
|
49
|
+
self.window.ui.plugin_addon['audio.input.btn'].continuous.setText(trans('audio.speak.btn.continuous'))
|
49
50
|
self.window.ui.config['assistant']['tool.file_search'].box.setText(trans('assistant.tool.file_search'))
|
50
51
|
self.window.ui.config['assistant']['tool.code_interpreter'].box.setText(
|
51
52
|
trans('assistant.tool.code_interpreter')
|
@@ -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:
|
9
|
+
# Updated Date: 2025.01.17 13:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from typing import List, Dict, Any
|
@@ -280,41 +280,16 @@ class Plugins:
|
|
280
280
|
"""Handle plugin type"""
|
281
281
|
for type in self.window.core.plugins.allowed_types:
|
282
282
|
|
283
|
-
|
284
|
-
is_advanced = False
|
285
|
-
data = {
|
286
|
-
'name': 'audio.input.advanced',
|
287
|
-
'value': is_advanced,
|
288
|
-
}
|
289
|
-
event = Event(Event.PLUGIN_OPTION_GET, data)
|
290
|
-
self.window.dispatch(event)
|
291
|
-
if 'value' in event.data:
|
292
|
-
is_advanced = event.data['value']
|
283
|
+
enabled = self.is_type_enabled(type)
|
293
284
|
|
294
285
|
if type == 'audio.input':
|
295
|
-
|
296
|
-
if is_advanced:
|
297
|
-
self.window.ui.plugin_addon['audio.input.btn'].setVisible(False)
|
298
|
-
self.window.ui.plugin_addon['audio.input'].setVisible(True)
|
299
|
-
else:
|
300
|
-
self.window.ui.plugin_addon['audio.input.btn'].setVisible(True) # simple recording
|
301
|
-
self.window.ui.plugin_addon['audio.input'].setVisible(False) # advanced recording
|
302
|
-
self.window.controller.audio.toggle_input_icon(True)
|
303
|
-
else:
|
304
|
-
self.window.ui.plugin_addon['audio.input.btn'].setVisible(False) # simple recording
|
305
|
-
self.window.ui.plugin_addon['audio.input'].setVisible(False) # advanced recording
|
306
|
-
self.window.controller.audio.toggle_input_icon(False)
|
286
|
+
self.window.controller.audio.handle_audio_input(enabled)
|
307
287
|
|
308
288
|
elif type == 'audio.output':
|
309
|
-
|
310
|
-
self.window.controller.audio.toggle_output_icon(True)
|
311
|
-
# self.window.ui.plugin_addon['audio.output'].setVisible(True)
|
312
|
-
else:
|
313
|
-
self.window.ui.plugin_addon['audio.output'].setVisible(False)
|
314
|
-
self.window.controller.audio.toggle_output_icon(False)
|
289
|
+
self.window.controller.audio.handle_audio_output(enabled)
|
315
290
|
|
316
291
|
elif type == 'schedule':
|
317
|
-
if
|
292
|
+
if enabled:
|
318
293
|
self.window.ui.plugin_addon['schedule'].setVisible(True)
|
319
294
|
# get tasks count by throwing "get option" event
|
320
295
|
num = 0
|
pygpt_net/controller/ui/tabs.py
CHANGED
@@ -6,13 +6,11 @@
|
|
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: 2025.01.17 13:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
12
|
from typing import Any, Optional
|
13
13
|
|
14
|
-
from PySide6.QtCore import QTimer
|
15
|
-
|
16
14
|
from pygpt_net.core.events import AppEvent, RenderEvent
|
17
15
|
from pygpt_net.core.tabs.tab import Tab
|
18
16
|
from pygpt_net.item.ctx import CtxMeta
|
@@ -182,9 +180,18 @@ class Tabs:
|
|
182
180
|
if prev_tab != idx or prev_column != column_idx:
|
183
181
|
self.window.dispatch(AppEvent(AppEvent.TAB_SELECTED)) # app event
|
184
182
|
|
183
|
+
self.on_changed()
|
184
|
+
|
185
185
|
self.window.controller.ui.update()
|
186
186
|
self.update_current()
|
187
187
|
|
188
|
+
def on_changed(self):
|
189
|
+
"""On Tab or column changed event (any)"""
|
190
|
+
tab = self.get_current_tab()
|
191
|
+
if tab is None:
|
192
|
+
return
|
193
|
+
self.window.controller.audio.on_tab_changed(tab)
|
194
|
+
|
188
195
|
def get_current_idx(self, column_idx: int = 0) -> int:
|
189
196
|
"""
|
190
197
|
Get current tab index
|
@@ -291,6 +298,7 @@ class Tabs:
|
|
291
298
|
self.current = idx
|
292
299
|
self.column_idx = column_idx
|
293
300
|
self.on_column_changed()
|
301
|
+
self.on_changed()
|
294
302
|
self.update_current()
|
295
303
|
|
296
304
|
def on_column_focus(self, idx: int):
|
@@ -301,6 +309,7 @@ class Tabs:
|
|
301
309
|
"""
|
302
310
|
self.column_idx = idx
|
303
311
|
self.on_column_changed()
|
312
|
+
self.on_changed()
|
304
313
|
self.update_current()
|
305
314
|
|
306
315
|
def on_tab_dbl_clicked(
|
@@ -332,6 +341,7 @@ class Tabs:
|
|
332
341
|
if self.locked:
|
333
342
|
return
|
334
343
|
self.window.core.tabs.remove_tab_by_idx(idx, column_idx)
|
344
|
+
self.on_changed()
|
335
345
|
self.update_current()
|
336
346
|
|
337
347
|
def on_tab_moved(
|
@@ -387,6 +397,7 @@ class Tabs:
|
|
387
397
|
return
|
388
398
|
column_idx = self.tmp_column_idx
|
389
399
|
self.window.core.tabs.remove_all_by_type(type, column_idx)
|
400
|
+
self.on_changed()
|
390
401
|
self.update_current()
|
391
402
|
|
392
403
|
def next_tab(self):
|
pygpt_net/core/audio/capture.py
CHANGED
@@ -6,13 +6,16 @@
|
|
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.01.
|
9
|
+
# Updated Date: 2025.01.17 02:00:00 #
|
10
10
|
# ================================================== #
|
11
11
|
|
12
|
+
import time
|
13
|
+
|
12
14
|
import numpy as np
|
13
15
|
import wave
|
14
16
|
|
15
17
|
from PySide6.QtMultimedia import QAudioFormat, QMediaDevices, QAudioSource
|
18
|
+
from PySide6.QtCore import QTimer
|
16
19
|
|
17
20
|
class Capture:
|
18
21
|
def __init__(self, window=None):
|
@@ -28,6 +31,9 @@ class Capture:
|
|
28
31
|
self.actual_audio_format = None
|
29
32
|
self.path = None
|
30
33
|
self.disconnected = False
|
34
|
+
self.loop = False
|
35
|
+
self.stop_callback = None
|
36
|
+
self.start_time = 0
|
31
37
|
self.devices = []
|
32
38
|
self.selected_device = None
|
33
39
|
self.bar = None
|
@@ -100,6 +106,7 @@ class Capture:
|
|
100
106
|
|
101
107
|
# Set up audio input and start recording
|
102
108
|
self.setup_audio_input()
|
109
|
+
self.start_time = time.time()
|
103
110
|
return True
|
104
111
|
|
105
112
|
def stop(self):
|
@@ -199,6 +206,7 @@ class Capture:
|
|
199
206
|
|
200
207
|
def process_audio_input(self):
|
201
208
|
"""Process incoming audio data"""
|
209
|
+
# add seconds to stop timer
|
202
210
|
data = self.audio_io_device.readAll()
|
203
211
|
if data.isEmpty():
|
204
212
|
return
|
@@ -239,6 +247,16 @@ class Capture:
|
|
239
247
|
# Update the level bar widget
|
240
248
|
self.update_audio_level(level_percent)
|
241
249
|
|
250
|
+
# Handle loop recording
|
251
|
+
if self.loop and self.stop_callback is not None:
|
252
|
+
stop_interval = int(self.window.core.config.get('audio.input.stop_interval', 10))
|
253
|
+
current_time = time.time()
|
254
|
+
time_elapsed = current_time - self.start_time
|
255
|
+
if time_elapsed >= stop_interval:
|
256
|
+
# stop recording here, save audio chunk to WAV file, run transcription, and start recording again
|
257
|
+
self.start_time = current_time
|
258
|
+
QTimer.singleShot(0, self.stop_callback) # required QTimer to prevent crash!!!
|
259
|
+
|
242
260
|
def update_audio_level(self, level: int):
|
243
261
|
"""
|
244
262
|
Update the audio level bar
|
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"__meta__": {
|
3
|
-
"version": "2.4.
|
4
|
-
"app.version": "2.4.
|
5
|
-
"updated_at": "2025-01-
|
3
|
+
"version": "2.4.52",
|
4
|
+
"app.version": "2.4.52",
|
5
|
+
"updated_at": "2025-01-17T00:00:00"
|
6
6
|
},
|
7
7
|
"access.audio.event.speech": false,
|
8
8
|
"access.audio.event.speech.disabled": [],
|
@@ -74,8 +74,10 @@
|
|
74
74
|
"attachments_send_clear": true,
|
75
75
|
"attachments_capture_clear": true,
|
76
76
|
"audio.input.channels": 1,
|
77
|
+
"audio.input.continuous": false,
|
77
78
|
"audio.input.device": "0",
|
78
79
|
"audio.input.rate": 44100,
|
80
|
+
"audio.input.stop_interval": 10,
|
79
81
|
"audio.transcribe.convert_video": true,
|
80
82
|
"context_threshold": 200,
|
81
83
|
"cmd": false,
|
pygpt_net/data/config/modes.json
CHANGED
@@ -1123,6 +1123,19 @@
|
|
1123
1123
|
"step": 1,
|
1124
1124
|
"advanced": false
|
1125
1125
|
},
|
1126
|
+
"audio.input.stop_interval": {
|
1127
|
+
"section": "audio",
|
1128
|
+
"type": "int",
|
1129
|
+
"slider": true,
|
1130
|
+
"label": "settings.audio.input.stop_interval",
|
1131
|
+
"description": "settings.audio.input.stop_interval.desc",
|
1132
|
+
"value": 10,
|
1133
|
+
"min": 5,
|
1134
|
+
"max": 120,
|
1135
|
+
"multiplier": 1,
|
1136
|
+
"step": 1,
|
1137
|
+
"advanced": false
|
1138
|
+
},
|
1126
1139
|
"llama.idx.list": {
|
1127
1140
|
"section": "llama-index",
|
1128
1141
|
"type": "dict",
|
@@ -135,6 +135,7 @@ audio.magic_word.detected = Zauberwort erkannt!
|
|
135
135
|
audio.magic_word.invalid = Kein Zauberwort :(
|
136
136
|
audio.magic_word.please = Bitte das Zauberwort...
|
137
137
|
audio.speak.btn = Mikrofon
|
138
|
+
audio.speak.btn.continuous = Kontinuierliche Aufzeichnung
|
138
139
|
audio.speak.btn.stop = Stopp
|
139
140
|
audio.speak.btn.stop.tooltip = Klicken, um das Mikrofonhören zu beenden
|
140
141
|
audio.speak.btn.tooltip = Klicken, um das Mikrofonhören zu starten
|
@@ -774,6 +775,8 @@ settings.audio.input.device = Audioeingabegerät
|
|
774
775
|
settings.audio.input.device.desc = Wählen Sie das Audiogerät für die Mikrofoneingabe.
|
775
776
|
settings.audio.input.rate = Abtastrate
|
776
777
|
settings.audio.input.rate.desc = Abtastrate, Standard: 44100
|
778
|
+
settings.audio.input.stop_interval = Intervall für kontinuierliche automatische Transkription
|
779
|
+
settings.audio.input.stop_interval.desc = Intervall in Sekunden für automatisches Transkribieren eines Audioabschnitts, Standard: 10
|
777
780
|
settings.check_updates = Beim Start nach Updates suchen
|
778
781
|
settings.check_updates.bg = Im Hintergrund nach Updates suchen
|
779
782
|
settings.cmd.field.desc = Aktivieren Sie das `{cmd}`-Werkzeug.
|
@@ -147,6 +147,7 @@ audio.magic_word.detected = Magic word detected!
|
|
147
147
|
audio.magic_word.invalid = Not a magic word :(
|
148
148
|
audio.magic_word.please = Magic word please...
|
149
149
|
audio.speak.btn = Microphone
|
150
|
+
audio.speak.btn.continuous = Continuous recording
|
150
151
|
audio.speak.btn.stop = Stop
|
151
152
|
audio.speak.btn.stop.tooltip = Click to stop microphone listening
|
152
153
|
audio.speak.btn.tooltip = Click to start microphone listening
|
@@ -945,6 +946,8 @@ settings.audio.input.device = Audio Input Device
|
|
945
946
|
settings.audio.input.device.desc = Select the audio device for Microphone input.
|
946
947
|
settings.audio.input.rate = Sampling Rate
|
947
948
|
settings.audio.input.rate.desc = Sampling rate, default: 44100
|
949
|
+
settings.audio.input.stop_interval = Continuous recording auto-transcribe interval
|
950
|
+
settings.audio.input.stop_interval.desc = Interval in seconds for auto-transcribe audio chunk, default: 10
|
948
951
|
settings.check_updates = Check for Updates on start
|
949
952
|
settings.check_updates.bg = Check for Updates in the background
|
950
953
|
settings.cmd.config.collapse = JSON params
|
@@ -135,6 +135,7 @@ audio.magic_word.detected = ¡Palabra mágica detectada!
|
|
135
135
|
audio.magic_word.invalid = No es una palabra mágica :(
|
136
136
|
audio.magic_word.please = Por favor, una palabra mágica...
|
137
137
|
audio.speak.btn = Micrófono
|
138
|
+
audio.speak.btn.continuous = Grabación continua
|
138
139
|
audio.speak.btn.stop = Detener
|
139
140
|
audio.speak.btn.stop.tooltip = Haz clic para dejar de escuchar a través del micrófono
|
140
141
|
audio.speak.btn.tooltip = Haz clic para empezar a escuchar a través del micrófono
|
@@ -773,6 +774,8 @@ settings.audio.input.device = Dispositivo de Entrada de Audio
|
|
773
774
|
settings.audio.input.device.desc = Selecciona el dispositivo de audio para la entrada del micrófono.
|
774
775
|
settings.audio.input.rate = Taux d'échantillonnage
|
775
776
|
settings.audio.input.rate.desc = Taux d'échantillonnage, par défaut : 44100
|
777
|
+
settings.audio.input.stop_interval = Intervalo de transcripción automática continua
|
778
|
+
settings.audio.input.stop_interval.desc = Intervalo en segundos para transcribir automáticamente el fragmento de audio, predeterminado: 10
|
776
779
|
settings.check_updates = Buscar actualizaciones al iniciar
|
777
780
|
settings.check_updates.bg = Buscar actualizaciones en segundo plano
|
778
781
|
settings.cmd.field.desc = Habilitar la herramienta `{cmd}`.
|
@@ -135,6 +135,7 @@ audio.magic_word.detected = Mot magique détecté !
|
|
135
135
|
audio.magic_word.invalid = Pas un mot magique :(
|
136
136
|
audio.magic_word.please = S'il vous plaît, le mot magique...
|
137
137
|
audio.speak.btn = Microphone
|
138
|
+
audio.speak.btn.continuous = Enregistrement continu
|
138
139
|
audio.speak.btn.stop = Arrêt
|
139
140
|
audio.speak.btn.stop.tooltip = Cliquez pour arrêter l'écoute par le microphone
|
140
141
|
audio.speak.btn.tooltip = Cliquez pour commencer l'écoute par le microphone
|
@@ -773,6 +774,8 @@ settings.audio.input.device = Périphérique d'Entrée Audio
|
|
773
774
|
settings.audio.input.device.desc = Sélectionnez le périphérique audio pour l'entrée du microphone.
|
774
775
|
settings.audio.input.rate = Taux d'échantillonnage
|
775
776
|
settings.audio.input.rate.desc = Taux d'échantillonnage, par défaut : 44100
|
777
|
+
settings.audio.input.stop_interval = Intervalle d'auto-transcription enregistrement continu
|
778
|
+
settings.audio.input.stop_interval.desc = Intervalle en secondes pour la transcription automatique d'un morceau audio, par défaut : 10
|
776
779
|
settings.check_updates = Vérifier les mises à jour au démarrage
|
777
780
|
settings.check_updates.bg = Vérifier les mises à jour en arrière-plan
|
778
781
|
settings.cmd.field.desc = Activer l'outil `{cmd}`.
|
@@ -135,6 +135,7 @@ audio.magic_word.detected = Parola magica rilevata!
|
|
135
135
|
audio.magic_word.invalid = Non è una parola magica :(
|
136
136
|
audio.magic_word.please = Per favore, parola magica...
|
137
137
|
audio.speak.btn = Microfono
|
138
|
+
audio.speak.btn.continuous = Registrazione continua
|
138
139
|
audio.speak.btn.stop = Stop
|
139
140
|
audio.speak.btn.stop.tooltip = Clicca per terminare l'ascolto tramite microfono
|
140
141
|
audio.speak.btn.tooltip = Clicca per iniziare l'ascolto tramite microfono
|
@@ -774,6 +775,8 @@ settings.audio.input.device = Dispositivo di Ingresso Audio
|
|
774
775
|
settings.audio.input.device.desc = Seleziona il dispositivo audio per l'ingresso del microfono.
|
775
776
|
settings.audio.input.rate = Frequenza di campionamento
|
776
777
|
settings.audio.input.rate.desc = Frequenza di campionamento, predefinito: 44100
|
778
|
+
settings.audio.input.stop_interval = Intervallo di trascrizione automatica continua
|
779
|
+
settings.audio.input.stop_interval.desc = Intervallo in secondi per la trascrizione automatica del segmento audio, predefinito: 10
|
777
780
|
settings.check_updates = Controlla aggiornamenti all'avvio
|
778
781
|
settings.check_updates.bg = Controlla gli aggiornamenti in background
|
779
782
|
settings.cmd.field.desc = Abilita lo strumento `{cmd}`.
|
@@ -135,6 +135,7 @@ audio.magic_word.detected = Wykryto magiczne słowo!
|
|
135
135
|
audio.magic_word.invalid = To nie magiczne słowo :(
|
136
136
|
audio.magic_word.please = Podaj magiczne słowo...
|
137
137
|
audio.speak.btn = Mikrofon
|
138
|
+
audio.speak.btn.continuous = Ciągłe nagrywanie
|
138
139
|
audio.speak.btn.stop = Stop
|
139
140
|
audio.speak.btn.stop.tooltip = Kliknij, aby zakończyć nasłuchiwanie przez mikrofon
|
140
141
|
audio.speak.btn.tooltip = Kliknij, aby rozpocząć nasłuchiwanie przez mikrofon
|
@@ -774,6 +775,8 @@ settings.audio.input.device = Urządzenie Wejściowe Audio
|
|
774
775
|
settings.audio.input.device.desc = Wybierz urządzenie audio dla wejścia mikrofonu.
|
775
776
|
settings.audio.input.rate = Częstotliwość próbkowania
|
776
777
|
settings.audio.input.rate.desc = Częstotliwość próbkowania, domyślnie: 44100
|
778
|
+
settings.audio.input.stop_interval = Interwał automatycznego transkrybowania nagrania ciągłego
|
779
|
+
settings.audio.input.stop_interval.desc = Interwał w sekundach dla automatycznego transkrybowania fragmentu audio, domyślnie: 10
|
777
780
|
settings.check_updates = Sprawdź aktualizacje przy starcie
|
778
781
|
settings.check_updates.bg = Sprawdź aktualizacje w tle
|
779
782
|
settings.cmd.field.desc = Włącz narzędzie `{cmd}`.
|
@@ -135,6 +135,7 @@ audio.magic_word.detected = Магічне слово виявлено!
|
|
135
135
|
audio.magic_word.invalid = Не магічне слово :(
|
136
136
|
audio.magic_word.please = Магічне слово, будь ласка...
|
137
137
|
audio.speak.btn = Мікрофон
|
138
|
+
audio.speak.btn.continuous = Безперервний запис
|
138
139
|
audio.speak.btn.stop = Стоп
|
139
140
|
audio.speak.btn.stop.tooltip = Натисніть, щоб закінчити слухання через мікрофон
|
140
141
|
audio.speak.btn.tooltip = Натисніть, щоб почати слухання через мікрофон
|
@@ -773,6 +774,8 @@ settings.audio.input.device = Аудіо Вхідний Пристрій
|
|
773
774
|
settings.audio.input.device.desc = Виберіть аудіо пристрій для введення мікрофона.
|
774
775
|
settings.audio.input.rate = Частота дискретизації
|
775
776
|
settings.audio.input.rate.desc = Частота дискретизації, за замовчуванням: 44100
|
777
|
+
settings.audio.input.stop_interval = Інтервал автоматичного транскрибування безперервного запису
|
778
|
+
settings.audio.input.stop_interval.desc = Інтервал у секундах для автоматичного транскрибування фрагмента аудіо, за замовчуванням: 10
|
776
779
|
settings.check_updates = Перевіряти оновлення при запуску
|
777
780
|
settings.check_updates.bg = Перевіряти оновлення у фоновому режимі
|
778
781
|
settings.cmd.field.desc = Увімкнути інструмент `{cmd}`.
|