pygpt-net 2.6.30__py3-none-any.whl → 2.6.32__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 (122) hide show
  1. pygpt_net/CHANGELOG.txt +15 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +7 -1
  4. pygpt_net/app_core.py +3 -1
  5. pygpt_net/config.py +3 -1
  6. pygpt_net/controller/__init__.py +9 -2
  7. pygpt_net/controller/audio/audio.py +38 -1
  8. pygpt_net/controller/audio/ui.py +2 -2
  9. pygpt_net/controller/chat/audio.py +1 -8
  10. pygpt_net/controller/chat/common.py +23 -62
  11. pygpt_net/controller/chat/handler/__init__.py +0 -0
  12. pygpt_net/controller/chat/handler/stream_worker.py +1124 -0
  13. pygpt_net/controller/chat/output.py +8 -3
  14. pygpt_net/controller/chat/stream.py +3 -1071
  15. pygpt_net/controller/chat/text.py +3 -2
  16. pygpt_net/controller/kernel/kernel.py +11 -3
  17. pygpt_net/controller/kernel/reply.py +5 -1
  18. pygpt_net/controller/lang/custom.py +2 -2
  19. pygpt_net/controller/media/__init__.py +12 -0
  20. pygpt_net/controller/media/media.py +115 -0
  21. pygpt_net/controller/realtime/__init__.py +12 -0
  22. pygpt_net/controller/realtime/manager.py +53 -0
  23. pygpt_net/controller/realtime/realtime.py +293 -0
  24. pygpt_net/controller/ui/mode.py +23 -2
  25. pygpt_net/controller/ui/ui.py +19 -1
  26. pygpt_net/core/audio/audio.py +6 -1
  27. pygpt_net/core/audio/backend/native/__init__.py +12 -0
  28. pygpt_net/core/audio/backend/{native.py → native/native.py} +426 -127
  29. pygpt_net/core/audio/backend/native/player.py +139 -0
  30. pygpt_net/core/audio/backend/native/realtime.py +250 -0
  31. pygpt_net/core/audio/backend/pyaudio/__init__.py +12 -0
  32. pygpt_net/core/audio/backend/pyaudio/playback.py +194 -0
  33. pygpt_net/core/audio/backend/pyaudio/pyaudio.py +923 -0
  34. pygpt_net/core/audio/backend/pyaudio/realtime.py +312 -0
  35. pygpt_net/core/audio/backend/pygame/__init__.py +12 -0
  36. pygpt_net/core/audio/backend/{pygame.py → pygame/pygame.py} +130 -19
  37. pygpt_net/core/audio/backend/shared/__init__.py +38 -0
  38. pygpt_net/core/audio/backend/shared/conversions.py +211 -0
  39. pygpt_net/core/audio/backend/shared/envelope.py +38 -0
  40. pygpt_net/core/audio/backend/shared/player.py +137 -0
  41. pygpt_net/core/audio/backend/shared/rt.py +52 -0
  42. pygpt_net/core/audio/capture.py +5 -0
  43. pygpt_net/core/audio/output.py +14 -2
  44. pygpt_net/core/audio/whisper.py +6 -2
  45. pygpt_net/core/bridge/bridge.py +2 -1
  46. pygpt_net/core/bridge/worker.py +4 -1
  47. pygpt_net/core/dispatcher/dispatcher.py +37 -1
  48. pygpt_net/core/events/__init__.py +2 -1
  49. pygpt_net/core/events/realtime.py +55 -0
  50. pygpt_net/core/image/image.py +56 -5
  51. pygpt_net/core/realtime/__init__.py +0 -0
  52. pygpt_net/core/realtime/options.py +87 -0
  53. pygpt_net/core/realtime/shared/__init__.py +0 -0
  54. pygpt_net/core/realtime/shared/audio.py +213 -0
  55. pygpt_net/core/realtime/shared/loop.py +64 -0
  56. pygpt_net/core/realtime/shared/session.py +59 -0
  57. pygpt_net/core/realtime/shared/text.py +37 -0
  58. pygpt_net/core/realtime/shared/tools.py +276 -0
  59. pygpt_net/core/realtime/shared/turn.py +38 -0
  60. pygpt_net/core/realtime/shared/types.py +16 -0
  61. pygpt_net/core/realtime/worker.py +160 -0
  62. pygpt_net/core/render/web/body.py +24 -3
  63. pygpt_net/core/text/utils.py +54 -2
  64. pygpt_net/core/types/__init__.py +1 -0
  65. pygpt_net/core/types/image.py +54 -0
  66. pygpt_net/core/video/__init__.py +12 -0
  67. pygpt_net/core/video/video.py +290 -0
  68. pygpt_net/data/config/config.json +26 -5
  69. pygpt_net/data/config/models.json +221 -103
  70. pygpt_net/data/config/settings.json +244 -6
  71. pygpt_net/data/css/web-blocks.css +6 -0
  72. pygpt_net/data/css/web-chatgpt.css +6 -0
  73. pygpt_net/data/css/web-chatgpt_wide.css +6 -0
  74. pygpt_net/data/locale/locale.de.ini +35 -7
  75. pygpt_net/data/locale/locale.en.ini +56 -17
  76. pygpt_net/data/locale/locale.es.ini +35 -7
  77. pygpt_net/data/locale/locale.fr.ini +35 -7
  78. pygpt_net/data/locale/locale.it.ini +35 -7
  79. pygpt_net/data/locale/locale.pl.ini +38 -7
  80. pygpt_net/data/locale/locale.uk.ini +35 -7
  81. pygpt_net/data/locale/locale.zh.ini +31 -3
  82. pygpt_net/data/locale/plugin.audio_input.en.ini +4 -0
  83. pygpt_net/data/locale/plugin.audio_output.en.ini +4 -0
  84. pygpt_net/data/locale/plugin.cmd_web.en.ini +8 -0
  85. pygpt_net/item/model.py +22 -1
  86. pygpt_net/plugin/audio_input/plugin.py +37 -4
  87. pygpt_net/plugin/audio_input/simple.py +57 -8
  88. pygpt_net/plugin/cmd_files/worker.py +3 -0
  89. pygpt_net/provider/api/google/__init__.py +76 -7
  90. pygpt_net/provider/api/google/audio.py +8 -1
  91. pygpt_net/provider/api/google/chat.py +45 -6
  92. pygpt_net/provider/api/google/image.py +226 -86
  93. pygpt_net/provider/api/google/realtime/__init__.py +12 -0
  94. pygpt_net/provider/api/google/realtime/client.py +1945 -0
  95. pygpt_net/provider/api/google/realtime/realtime.py +186 -0
  96. pygpt_net/provider/api/google/video.py +364 -0
  97. pygpt_net/provider/api/openai/__init__.py +22 -2
  98. pygpt_net/provider/api/openai/realtime/__init__.py +12 -0
  99. pygpt_net/provider/api/openai/realtime/client.py +1828 -0
  100. pygpt_net/provider/api/openai/realtime/realtime.py +193 -0
  101. pygpt_net/provider/audio_input/google_genai.py +103 -0
  102. pygpt_net/provider/audio_output/google_genai_tts.py +229 -0
  103. pygpt_net/provider/audio_output/google_tts.py +0 -12
  104. pygpt_net/provider/audio_output/openai_tts.py +8 -5
  105. pygpt_net/provider/core/config/patch.py +241 -178
  106. pygpt_net/provider/core/model/patch.py +28 -2
  107. pygpt_net/provider/llms/google.py +8 -9
  108. pygpt_net/provider/web/duckduck_search.py +212 -0
  109. pygpt_net/ui/layout/toolbox/audio.py +55 -0
  110. pygpt_net/ui/layout/toolbox/footer.py +14 -42
  111. pygpt_net/ui/layout/toolbox/image.py +7 -13
  112. pygpt_net/ui/layout/toolbox/raw.py +52 -0
  113. pygpt_net/ui/layout/toolbox/split.py +48 -0
  114. pygpt_net/ui/layout/toolbox/toolbox.py +8 -8
  115. pygpt_net/ui/layout/toolbox/video.py +49 -0
  116. pygpt_net/ui/widget/option/combo.py +15 -1
  117. {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/METADATA +46 -22
  118. {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/RECORD +121 -73
  119. pygpt_net/core/audio/backend/pyaudio.py +0 -554
  120. {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/LICENSE +0 -0
  121. {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/WHEEL +0 -0
  122. {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/entry_points.txt +0 -0
pygpt_net/CHANGELOG.txt CHANGED
@@ -1,3 +1,18 @@
1
+ 2.6.32 (2025-09-02)
2
+
3
+ - Added video generation and support for Google Veo 3 models.
4
+ - Introduced new predefined models: veo-3.0-generate-preview and veo-3.0-fast-generate-preview.
5
+ - Integrated DuckDuckGo as a search provider in the WebSearch plugin.
6
+ - Added "Loop" mode to Realtime + audio mode for automatic turn handling and continuous conversation without manually enabling the microphone.
7
+
8
+ 2.6.31 (2025-09-01)
9
+
10
+ - Chat with Audio mode renamed to Realtime + audio.
11
+ - Added support for real-time audio models from OpenAI (Realtime API) and Google (Live API), featuring real-time audio integration (beta).
12
+ - Introduced new predefined models: gpt-realtime, gpt-4o-realtime-preview, and gemini-2.5-flash-preview-native-audio-dialog.
13
+ - Included Google Gen AI audio input and output providers in the Audio Input/Output plugins.
14
+ - Added URL Context remote tool support in Google Gen AI.
15
+
1
16
  2.6.30 (2025-08-29)
2
17
 
3
18
  - Added native Google GenAI API support (beta); live audio is not supported yet (#132).
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.08.29 00:00:00 #
9
+ # Updated Date: 2025.09.02 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.30"
17
- __build__ = "2025-08-29"
16
+ __version__ = "2.6.32"
17
+ __build__ = "2025-09-02"
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
@@ -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.08.27 20:00:00 #
9
+ # Updated Date: 2025.09.02 01:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -171,15 +171,18 @@ from pygpt_net.provider.audio_input.openai_whisper import OpenAIWhisper
171
171
  from pygpt_net.provider.audio_input.openai_whisper_local import OpenAIWhisperLocal
172
172
  from pygpt_net.provider.audio_input.google_speech_recognition import GoogleSpeechRecognition
173
173
  from pygpt_net.provider.audio_input.google_cloud_speech_recognition import GoogleCloudSpeechRecognition
174
+ from pygpt_net.provider.audio_input.google_genai import GoogleGenAIAudioInput
174
175
  from pygpt_net.provider.audio_input.bing_speech_recognition import BingSpeechRecognition
175
176
  from pygpt_net.provider.audio_output.openai_tts import OpenAITextToSpeech
176
177
  from pygpt_net.provider.audio_output.ms_azure_tts import MSAzureTextToSpeech
177
178
  from pygpt_net.provider.audio_output.google_tts import GoogleTextToSpeech
179
+ from pygpt_net.provider.audio_output.google_genai_tts import GoogleGenAITextToSpeech
178
180
  from pygpt_net.provider.audio_output.eleven_labs import ElevenLabsTextToSpeech
179
181
 
180
182
  # web search engine providers
181
183
  from pygpt_net.provider.web.google_custom_search import GoogleCustomSearch
182
184
  from pygpt_net.provider.web.microsoft_bing import MicrosoftBingSearch
185
+ from pygpt_net.provider.web.duckduck_search import DuckDuckGoSearch
183
186
 
184
187
  # tools
185
188
  from pygpt_net.tools.indexer import IndexerTool
@@ -318,10 +321,12 @@ def run(**kwargs):
318
321
  launcher.add_audio_input(OpenAIWhisperLocal())
319
322
  launcher.add_audio_input(GoogleSpeechRecognition())
320
323
  launcher.add_audio_input(GoogleCloudSpeechRecognition())
324
+ launcher.add_audio_input(GoogleGenAIAudioInput())
321
325
  launcher.add_audio_input(BingSpeechRecognition())
322
326
  launcher.add_audio_output(OpenAITextToSpeech())
323
327
  launcher.add_audio_output(MSAzureTextToSpeech())
324
328
  launcher.add_audio_output(GoogleTextToSpeech())
329
+ launcher.add_audio_output(GoogleGenAITextToSpeech())
325
330
  launcher.add_audio_output(ElevenLabsTextToSpeech())
326
331
 
327
332
  # register custom audio providers
@@ -338,6 +343,7 @@ def run(**kwargs):
338
343
  # register web providers
339
344
  launcher.add_web(GoogleCustomSearch())
340
345
  launcher.add_web(MicrosoftBingSearch())
346
+ launcher.add_web(DuckDuckGoSearch())
341
347
 
342
348
  # register custom web providers
343
349
  providers = kwargs.get('web', None)
pygpt_net/app_core.py CHANGED
@@ -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.08.28 09:00:00 #
9
+ # Updated Date: 2025.09.01 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.config import Config
@@ -43,6 +43,7 @@ from pygpt_net.core.tabs import Tabs
43
43
  from pygpt_net.core.text import Text
44
44
  from pygpt_net.core.tokens import Tokens
45
45
  from pygpt_net.core.updater import Updater
46
+ from pygpt_net.core.video import Video
46
47
  from pygpt_net.core.vision import Vision
47
48
  from pygpt_net.core.web import Web
48
49
 
@@ -92,6 +93,7 @@ class Core:
92
93
  self.text = Text(window)
93
94
  self.tokens = Tokens(window)
94
95
  self.updater = Updater(window)
96
+ self.video = Video(window)
95
97
  self.vision = Vision(window)
96
98
  self.web = Web(window)
97
99
 
pygpt_net/config.py CHANGED
@@ -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.08.18 01:00:00 #
9
+ # Updated Date: 2025.09.01 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import copy
@@ -66,6 +66,8 @@ class Config:
66
66
  "presets": "presets",
67
67
  "upload": "upload",
68
68
  "tmp": "tmp",
69
+ "video": "video",
70
+ "music": "music",
69
71
  }
70
72
  self._app_path = None
71
73
  self._version_cache = version if version else None
@@ -1,4 +1,4 @@
1
- # !/usr/bin/env python3
1
+ #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
3
  # ================================================== #
4
4
  # This file is a part of PYGPT package #
@@ -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.08.24 23:00:00 #
9
+ # Updated Date: 2025.09.01 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  from pygpt_net.controller.access import Access
@@ -29,11 +29,13 @@ from pygpt_net.controller.kernel import Kernel
29
29
  from pygpt_net.controller.lang import Lang
30
30
  from pygpt_net.controller.launcher import Launcher
31
31
  from pygpt_net.controller.layout import Layout
32
+ from pygpt_net.controller.media import Media
32
33
  from pygpt_net.controller.mode import Mode
33
34
  from pygpt_net.controller.model import Model
34
35
  from pygpt_net.controller.notepad import Notepad
35
36
  from pygpt_net.controller.painter import Painter
36
37
  from pygpt_net.controller.plugins import Plugins
38
+ from pygpt_net.controller.realtime import Realtime
37
39
  from pygpt_net.controller.presets import Presets
38
40
  from pygpt_net.controller.settings import Settings
39
41
  from pygpt_net.controller.theme import Theme
@@ -70,12 +72,14 @@ class Controller:
70
72
  self.lang = Lang(window)
71
73
  self.launcher = Launcher(window)
72
74
  self.layout = Layout(window)
75
+ self.media = Media(window)
73
76
  self.mode = Mode(window)
74
77
  self.model = Model(window)
75
78
  self.notepad = Notepad(window)
76
79
  self.painter = Painter(window)
77
80
  self.plugins = Plugins(window)
78
81
  self.presets = Presets(window)
82
+ self.realtime = Realtime(window)
79
83
  self.settings = Settings(window)
80
84
  self.theme = Theme(window)
81
85
  self.tools = Tools(window)
@@ -108,6 +112,8 @@ class Controller:
108
112
  self.attachment.setup()
109
113
  self.camera.setup_ui()
110
114
  self.access.setup()
115
+ self.realtime.setup()
116
+ self.media.setup()
111
117
 
112
118
  def post_setup(self):
113
119
  """Post-setup, after plugins are loaded"""
@@ -166,6 +172,7 @@ class Controller:
166
172
  self.lang.reload()
167
173
  self.debug.reload()
168
174
  self.chat.reload()
175
+ self.media.reload()
169
176
  self.window.tools.on_reload()
170
177
  self.access.reload()
171
178
  self.tools.reload()
@@ -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.08.27 07:00:00 #
9
+ # Updated Date: 2025.08.31 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
@@ -40,9 +40,46 @@ class Audio:
40
40
  def setup(self):
41
41
  """Setup controller"""
42
42
  self.update()
43
+
44
+ # continuous input (notepad)
43
45
  if self.window.core.config.get("audio.input.continuous", False):
44
46
  self.window.ui.plugin_addon['audio.input.btn'].continuous.setChecked(True)
45
47
 
48
+ # auto turn (VAD)
49
+ if self.window.core.config.get("audio.input.auto_turn", False):
50
+ self.window.ui.nodes['audio.auto_turn'].box.setChecked(True)
51
+
52
+ # loop recording
53
+ if self.window.core.config.get("audio.input.loop", False):
54
+ self.window.ui.nodes['audio.loop'].box.setChecked(True)
55
+
56
+ def execute_input_stop(self):
57
+ """Execute input stop (from UI)"""
58
+ self.window.dispatch(Event(Event.AUDIO_INPUT_RECORD_TOGGLE, {
59
+ "state": False,
60
+ "auto": True, # do not emit manual event
61
+ }))
62
+
63
+ def is_recording(self) -> bool:
64
+ """
65
+ Check if audio input is recording
66
+
67
+ :return: True if recording
68
+ """
69
+ return self.window.core.plugins.get("audio_input").is_recording()
70
+
71
+ def toggle_auto_turn(self):
72
+ """Toggle auto turn setting"""
73
+ value = self.window.ui.nodes['audio.auto_turn'].box.isChecked()
74
+ self.window.core.config.set("audio.input.auto_turn", value)
75
+ self.window.core.config.save()
76
+
77
+ def toggle_loop(self):
78
+ """Toggle loop recording setting"""
79
+ value = self.window.ui.nodes['audio.loop'].box.isChecked()
80
+ self.window.core.config.set("audio.input.loop", value)
81
+ self.window.core.config.save()
82
+
46
83
  def toggle_input(
47
84
  self,
48
85
  state: bool,
@@ -183,7 +183,7 @@ class UI:
183
183
  """
184
184
  self.recording = True
185
185
  self.window.ui.nodes['input'].set_icon_state("mic", True)
186
- if mode == "input":
186
+ if mode in ["input", "realtime"]:
187
187
  self.window.controller.chat.common.lock_input()
188
188
  return
189
189
  btn = self.get_input_btn() if mode == 'input' else self.get_input_control_btn()
@@ -198,7 +198,7 @@ class UI:
198
198
  """
199
199
  self.recording = False
200
200
  self.window.ui.nodes['input'].set_icon_state("mic", False)
201
- if mode == "input":
201
+ if mode in ["input", "realtime"]:
202
202
  self.window.controller.chat.common.unlock_input()
203
203
  return
204
204
  btn = self.get_input_btn() if mode == 'input' else self.get_input_control_btn()
@@ -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: 2024.12.14 18:00:00 #
9
+ # Updated Date: 2025.08.30 06:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import base64
@@ -40,19 +40,12 @@ class Audio:
40
40
  """Update input/output audio"""
41
41
  mode = self.window.core.config.get("mode")
42
42
  if mode == MODE_AUDIO:
43
- if not self.window.controller.audio.is_output_enabled():
44
- self.window.controller.audio.enable_output()
45
- self.tmp_output = True
46
- else:
47
- self.tmp_output = False
48
43
  if not self.window.controller.audio.is_input_enabled():
49
44
  self.window.controller.audio.enable_input()
50
45
  self.tmp_input = True
51
46
  else:
52
47
  self.tmp_input = False
53
48
  else:
54
- if self.tmp_output:
55
- self.window.controller.audio.disable_output()
56
49
  if self.tmp_input:
57
50
  self.window.controller.audio.disable_input()
58
51
 
@@ -6,16 +6,17 @@
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.27 07:00:00 #
9
+ # Updated Date: 2025.09.01 23:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import os
13
+ from typing import Any
13
14
 
14
15
  from PySide6.QtGui import QTextCursor
15
16
  from PySide6.QtWidgets import QFileDialog, QApplication
16
17
 
17
18
  from pygpt_net.core.events import Event, AppEvent, RenderEvent, KernelEvent
18
- from pygpt_net.core.types import MODE_ASSISTANT
19
+ from pygpt_net.core.types import MODE_ASSISTANT, MODE_AUDIO
19
20
  from pygpt_net.item.ctx import CtxItem
20
21
  from pygpt_net.item.model import ModelItem
21
22
  from pygpt_net.utils import trans
@@ -99,26 +100,6 @@ class Common:
99
100
  event = RenderEvent(RenderEvent.ON_SWITCH)
100
101
  self.window.dispatch(event) # switch renderer if needed
101
102
 
102
- # edit icons
103
- """
104
- if self.window.core.config.has('ctx.edit_icons'):
105
- self.window.ui.nodes['output.edit'].setChecked(self.window.core.config.get('ctx.edit_icons'))
106
- data = {
107
- "initialized": self.initialized,
108
- }
109
- if self.window.core.config.get('ctx.edit_icons'):
110
- event = RenderEvent(RenderEvent.ON_EDIT_ENABLE, data)
111
- else:
112
- event = RenderEvent(RenderEvent.ON_EDIT_DISABLE, data)
113
- self.window.dispatch(event)
114
- """
115
-
116
- # images generation
117
- if self.window.core.config.get('img_raw'):
118
- self.window.ui.config['global']['img_raw'].setChecked(True)
119
- else:
120
- self.window.ui.config['global']['img_raw'].setChecked(False)
121
-
122
103
  # set focus to input
123
104
  self.window.ui.nodes['input'].setFocus()
124
105
  self.initialized = True
@@ -257,7 +238,7 @@ class Common:
257
238
  self.window.controller.access.voice.stop_recording(timeout=True)
258
239
 
259
240
  if self.window.core.plugins.get("audio_input").handler_simple.is_recording:
260
- self.window.core.plugins.get("audio_input").handler_simple.stop_recording(timeout=False)
241
+ self.window.dispatch(Event(Event.AUDIO_INPUT_RECORD_TOGGLE))
261
242
  return
262
243
 
263
244
  # stop audio output if playing
@@ -275,7 +256,8 @@ class Common:
275
256
  """
276
257
  # don't unlock input and leave stop btn if assistant mode or if agent/autonomous is enabled
277
258
  # send btn will be unlocked in agent mode on stop
278
- if self.can_unlock(ctx):
259
+ mode = self.window.core.config.get('mode')
260
+ if self.can_unlock(ctx) and mode != MODE_AUDIO:
279
261
  if not self.window.controller.kernel.stopped():
280
262
  self.unlock_input() # unlock input
281
263
  return True
@@ -391,6 +373,23 @@ class Common:
391
373
  event = RenderEvent(RenderEvent.ON_TS_DISABLE, data)
392
374
  self.window.dispatch(event)
393
375
 
376
+ def toggle_edit_icons(self, value: bool):
377
+ """
378
+ Toggle edit icons
379
+
380
+ :param value: value of the checkbox
381
+ """
382
+ self.window.core.config.set('ctx.edit_icons', value)
383
+ self.window.core.config.save()
384
+ data = {
385
+ "initialized": True,
386
+ }
387
+ if value:
388
+ event = RenderEvent(RenderEvent.ON_EDIT_ENABLE, data)
389
+ else:
390
+ event = RenderEvent(RenderEvent.ON_EDIT_DISABLE, data)
391
+ self.window.dispatch(event)
392
+
394
393
  def toggle_raw(self, value: bool):
395
394
  """
396
395
  Toggle raw (plain) output
@@ -414,44 +413,6 @@ class Common:
414
413
  # restore previous font size
415
414
  self.window.controller.ui.update_font_size()
416
415
 
417
- def toggle_edit_icons(self, value: bool):
418
- """
419
- Toggle edit icons
420
-
421
- :param value: value of the checkbox
422
- """
423
- self.window.core.config.set('ctx.edit_icons', value)
424
- self.window.core.config.save()
425
- data = {
426
- "initialized": True,
427
- }
428
- if value:
429
- event = RenderEvent(RenderEvent.ON_EDIT_ENABLE, data)
430
- else:
431
- event = RenderEvent(RenderEvent.ON_EDIT_DISABLE, data)
432
- self.window.dispatch(event)
433
-
434
- def img_enable_raw(self):
435
- """Enable help for images"""
436
- self.window.core.config.set('img_raw', True)
437
- self.window.core.config.save()
438
-
439
- def img_disable_raw(self):
440
- """Disable help for images"""
441
- self.window.core.config.set('img_raw', False)
442
- self.window.core.config.save()
443
-
444
- def img_toggle_raw(self, state: bool):
445
- """
446
- Toggle help for images
447
-
448
- :param state: state of checkbox
449
- """
450
- if not state:
451
- self.img_disable_raw()
452
- else:
453
- self.img_enable_raw()
454
-
455
416
  def save_text(
456
417
  self,
457
418
  text: str,
File without changes