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.
- pygpt_net/CHANGELOG.txt +15 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +7 -1
- pygpt_net/app_core.py +3 -1
- pygpt_net/config.py +3 -1
- pygpt_net/controller/__init__.py +9 -2
- pygpt_net/controller/audio/audio.py +38 -1
- pygpt_net/controller/audio/ui.py +2 -2
- pygpt_net/controller/chat/audio.py +1 -8
- pygpt_net/controller/chat/common.py +23 -62
- pygpt_net/controller/chat/handler/__init__.py +0 -0
- pygpt_net/controller/chat/handler/stream_worker.py +1124 -0
- pygpt_net/controller/chat/output.py +8 -3
- pygpt_net/controller/chat/stream.py +3 -1071
- pygpt_net/controller/chat/text.py +3 -2
- pygpt_net/controller/kernel/kernel.py +11 -3
- pygpt_net/controller/kernel/reply.py +5 -1
- pygpt_net/controller/lang/custom.py +2 -2
- pygpt_net/controller/media/__init__.py +12 -0
- pygpt_net/controller/media/media.py +115 -0
- pygpt_net/controller/realtime/__init__.py +12 -0
- pygpt_net/controller/realtime/manager.py +53 -0
- pygpt_net/controller/realtime/realtime.py +293 -0
- pygpt_net/controller/ui/mode.py +23 -2
- pygpt_net/controller/ui/ui.py +19 -1
- pygpt_net/core/audio/audio.py +6 -1
- pygpt_net/core/audio/backend/native/__init__.py +12 -0
- pygpt_net/core/audio/backend/{native.py → native/native.py} +426 -127
- pygpt_net/core/audio/backend/native/player.py +139 -0
- pygpt_net/core/audio/backend/native/realtime.py +250 -0
- pygpt_net/core/audio/backend/pyaudio/__init__.py +12 -0
- pygpt_net/core/audio/backend/pyaudio/playback.py +194 -0
- pygpt_net/core/audio/backend/pyaudio/pyaudio.py +923 -0
- pygpt_net/core/audio/backend/pyaudio/realtime.py +312 -0
- pygpt_net/core/audio/backend/pygame/__init__.py +12 -0
- pygpt_net/core/audio/backend/{pygame.py → pygame/pygame.py} +130 -19
- pygpt_net/core/audio/backend/shared/__init__.py +38 -0
- pygpt_net/core/audio/backend/shared/conversions.py +211 -0
- pygpt_net/core/audio/backend/shared/envelope.py +38 -0
- pygpt_net/core/audio/backend/shared/player.py +137 -0
- pygpt_net/core/audio/backend/shared/rt.py +52 -0
- pygpt_net/core/audio/capture.py +5 -0
- pygpt_net/core/audio/output.py +14 -2
- pygpt_net/core/audio/whisper.py +6 -2
- pygpt_net/core/bridge/bridge.py +2 -1
- pygpt_net/core/bridge/worker.py +4 -1
- pygpt_net/core/dispatcher/dispatcher.py +37 -1
- pygpt_net/core/events/__init__.py +2 -1
- pygpt_net/core/events/realtime.py +55 -0
- pygpt_net/core/image/image.py +56 -5
- pygpt_net/core/realtime/__init__.py +0 -0
- pygpt_net/core/realtime/options.py +87 -0
- pygpt_net/core/realtime/shared/__init__.py +0 -0
- pygpt_net/core/realtime/shared/audio.py +213 -0
- pygpt_net/core/realtime/shared/loop.py +64 -0
- pygpt_net/core/realtime/shared/session.py +59 -0
- pygpt_net/core/realtime/shared/text.py +37 -0
- pygpt_net/core/realtime/shared/tools.py +276 -0
- pygpt_net/core/realtime/shared/turn.py +38 -0
- pygpt_net/core/realtime/shared/types.py +16 -0
- pygpt_net/core/realtime/worker.py +160 -0
- pygpt_net/core/render/web/body.py +24 -3
- pygpt_net/core/text/utils.py +54 -2
- pygpt_net/core/types/__init__.py +1 -0
- pygpt_net/core/types/image.py +54 -0
- pygpt_net/core/video/__init__.py +12 -0
- pygpt_net/core/video/video.py +290 -0
- pygpt_net/data/config/config.json +26 -5
- pygpt_net/data/config/models.json +221 -103
- pygpt_net/data/config/settings.json +244 -6
- pygpt_net/data/css/web-blocks.css +6 -0
- pygpt_net/data/css/web-chatgpt.css +6 -0
- pygpt_net/data/css/web-chatgpt_wide.css +6 -0
- pygpt_net/data/locale/locale.de.ini +35 -7
- pygpt_net/data/locale/locale.en.ini +56 -17
- pygpt_net/data/locale/locale.es.ini +35 -7
- pygpt_net/data/locale/locale.fr.ini +35 -7
- pygpt_net/data/locale/locale.it.ini +35 -7
- pygpt_net/data/locale/locale.pl.ini +38 -7
- pygpt_net/data/locale/locale.uk.ini +35 -7
- pygpt_net/data/locale/locale.zh.ini +31 -3
- pygpt_net/data/locale/plugin.audio_input.en.ini +4 -0
- pygpt_net/data/locale/plugin.audio_output.en.ini +4 -0
- pygpt_net/data/locale/plugin.cmd_web.en.ini +8 -0
- pygpt_net/item/model.py +22 -1
- pygpt_net/plugin/audio_input/plugin.py +37 -4
- pygpt_net/plugin/audio_input/simple.py +57 -8
- pygpt_net/plugin/cmd_files/worker.py +3 -0
- pygpt_net/provider/api/google/__init__.py +76 -7
- pygpt_net/provider/api/google/audio.py +8 -1
- pygpt_net/provider/api/google/chat.py +45 -6
- pygpt_net/provider/api/google/image.py +226 -86
- pygpt_net/provider/api/google/realtime/__init__.py +12 -0
- pygpt_net/provider/api/google/realtime/client.py +1945 -0
- pygpt_net/provider/api/google/realtime/realtime.py +186 -0
- pygpt_net/provider/api/google/video.py +364 -0
- pygpt_net/provider/api/openai/__init__.py +22 -2
- pygpt_net/provider/api/openai/realtime/__init__.py +12 -0
- pygpt_net/provider/api/openai/realtime/client.py +1828 -0
- pygpt_net/provider/api/openai/realtime/realtime.py +193 -0
- pygpt_net/provider/audio_input/google_genai.py +103 -0
- pygpt_net/provider/audio_output/google_genai_tts.py +229 -0
- pygpt_net/provider/audio_output/google_tts.py +0 -12
- pygpt_net/provider/audio_output/openai_tts.py +8 -5
- pygpt_net/provider/core/config/patch.py +241 -178
- pygpt_net/provider/core/model/patch.py +28 -2
- pygpt_net/provider/llms/google.py +8 -9
- pygpt_net/provider/web/duckduck_search.py +212 -0
- pygpt_net/ui/layout/toolbox/audio.py +55 -0
- pygpt_net/ui/layout/toolbox/footer.py +14 -42
- pygpt_net/ui/layout/toolbox/image.py +7 -13
- pygpt_net/ui/layout/toolbox/raw.py +52 -0
- pygpt_net/ui/layout/toolbox/split.py +48 -0
- pygpt_net/ui/layout/toolbox/toolbox.py +8 -8
- pygpt_net/ui/layout/toolbox/video.py +49 -0
- pygpt_net/ui/widget/option/combo.py +15 -1
- {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/METADATA +46 -22
- {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/RECORD +121 -73
- pygpt_net/core/audio/backend/pyaudio.py +0 -554
- {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.30.dist-info → pygpt_net-2.6.32.dist-info}/entry_points.txt +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
[LOCALE]
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
2
5
|
about.btn.github = GitHub
|
|
3
6
|
about.btn.support = Wsparcie
|
|
4
7
|
about.btn.website = WWW
|
|
@@ -191,6 +194,7 @@ attachments_uploaded.tab = Wgrane pliki
|
|
|
191
194
|
audio.cache.clear.confirm = Czy na pewno chcesz usunąć wszystkie pliki w pamięci podręcznej audio?
|
|
192
195
|
audio.cache.clear.success = OK. Wszystkie pliki pamięci podręcznej audio zostały wyczyszczone.
|
|
193
196
|
audio.control.btn = Kontrola głosowa
|
|
197
|
+
audio.loop = Pętla
|
|
194
198
|
audio.magic_word.detected = Wykryto magiczne słowo!
|
|
195
199
|
audio.magic_word.invalid = To nie magiczne słowo :(
|
|
196
200
|
audio.magic_word.please = Podaj magiczne słowo...
|
|
@@ -846,7 +850,7 @@ mode.agent_openai.tooltip = Zaawansowani agenci (OpenAI)
|
|
|
846
850
|
mode.agent.tooltip = Prości agenci (legacy)
|
|
847
851
|
mode.assistant = Asystent
|
|
848
852
|
mode.assistant.tooltip = Czat przy użyciu API Asystentów
|
|
849
|
-
mode.audio =
|
|
853
|
+
mode.audio = Realtime + audio
|
|
850
854
|
mode.chat = Czat
|
|
851
855
|
mode.chat.tooltip = Tryb czatu (domyślny)
|
|
852
856
|
mode.completion = Uzupełnianie
|
|
@@ -855,7 +859,7 @@ mode.computer = Kontrola komputera
|
|
|
855
859
|
mode.computer.tooltip = Kontrola komputera (mysz, klawiatura)
|
|
856
860
|
mode.expert = Eksperci (współpraca)
|
|
857
861
|
mode.expert.tooltip = Eksperci do wezwania w tle
|
|
858
|
-
mode.img = Obraz
|
|
862
|
+
mode.img = Obraz i wideo
|
|
859
863
|
mode.img.tooltip = Generowanie obrazów przy użyciu DALL-E
|
|
860
864
|
mode.langchain = Langchain
|
|
861
865
|
mode.langchain.tooltip = Czat z modelami dostarczonymi przez Langchain
|
|
@@ -1128,6 +1132,8 @@ settings.audio.input.stop_interval.desc = Interwał w sekundach dla automatyczne
|
|
|
1128
1132
|
settings.audio.input.timeout = Limit czasu nagrywania
|
|
1129
1133
|
settings.audio.input.timeout.continuous = Włącz limit czasu w trybie ciągłym
|
|
1130
1134
|
settings.audio.input.timeout.desc = Limit czasu (w sekundach) dla automatycznego zatrzymania nagrywania, 0 aby wyłączyć, domyślnie: 120
|
|
1135
|
+
settings.audio.input.vad.prefix = VAD prefix padding (in ms)
|
|
1136
|
+
settings.audio.input.vad.silence = VAD end silence (in ms)
|
|
1131
1137
|
settings.audio.output.backend = Backend dla wyjścia audio
|
|
1132
1138
|
settings.audio.output.backend.desc = Wybierz backend dla wyjścia audio.
|
|
1133
1139
|
settings.audio.output.device = Urządzenie do wyjścia audio
|
|
@@ -1198,9 +1204,10 @@ settings.frequency_penalty = Frequency Penalty
|
|
|
1198
1204
|
settings.func_call.native = Używaj natywnych wywołań funkcji API
|
|
1199
1205
|
settings.func_call.native.desc = Jeśli włączone, aplikacja będzie używać natywnych wywołań funkcji API zamiast wewnętrznego formatu pygpt i poniższych promptów poleceń. Tylko tryby czatu i asystentów.
|
|
1200
1206
|
settings.img_dialog_open = Otwórz okno dialogowe obrazu po wygenerowaniu (Tryb obrazu)
|
|
1201
|
-
settings.img_prompt_model =
|
|
1202
|
-
settings.
|
|
1203
|
-
settings.
|
|
1207
|
+
settings.img_prompt_model = Model do generowania promptów
|
|
1208
|
+
settings.img_prompt_model.desc = LLM used to refine your prompt before image generation (not the image model)
|
|
1209
|
+
settings.img_quality = Jakość obrazu
|
|
1210
|
+
settings.img_resolution = Rozmiar obrazu
|
|
1204
1211
|
settings.layout.animation.disable = Wyłącz animacje
|
|
1205
1212
|
settings.layout.animation.disable.desc = Wyłącza animacje układu, jak animowane ładowarki, itp.
|
|
1206
1213
|
settings.layout.density = Rozmiar layoutu
|
|
@@ -1295,8 +1302,10 @@ settings.prompt.ctx.auto_summary.user = Kontekst: auto-podsumowanie (wiadomość
|
|
|
1295
1302
|
settings.prompt.ctx.auto_summary.user.desc = Placeholdery: {input}, {output}
|
|
1296
1303
|
settings.prompt.expert = Ekspert: Główna wskazówka
|
|
1297
1304
|
settings.prompt.expert.desc = Instrukcja (systemowa wskazówka) dla głównego eksperta, jak obsługiwać ekspertów pomocniczych. Instrukcje dla ekspertów pomocniczych są podawane z ich ustawień.
|
|
1298
|
-
settings.prompt.img =
|
|
1305
|
+
settings.prompt.img = Generowanie obrazu
|
|
1299
1306
|
settings.prompt.img.desc = Prompt do generowania poleceń dla DALL-E (jeśli surowy tryb jest wyłączony). Tylko tryb obrazu.
|
|
1307
|
+
settings.prompt.video = Video generation
|
|
1308
|
+
settings.prompt.video.desc = Prompt for generating prompts for video model (if raw-mode is disabled). Image / Videos mode only.
|
|
1300
1309
|
settings.remote_tools.code_interpreter = Interpreter kodu
|
|
1301
1310
|
settings.remote_tools.code_interpreter.desc = Włącz narzędzie `code_interpreter` w trybie Czat / za pośrednictwem OpenAI Responses API.
|
|
1302
1311
|
settings.remote_tools.file_search = File search
|
|
@@ -1340,7 +1349,9 @@ settings.section.ctx = Kontekst
|
|
|
1340
1349
|
settings.section.debug = Debugowanie
|
|
1341
1350
|
settings.section.files = Pliki i załączniki
|
|
1342
1351
|
settings.section.general = Ogólne
|
|
1343
|
-
settings.section.images = Obrazy
|
|
1352
|
+
settings.section.images = Obrazy i wideo
|
|
1353
|
+
settings.section.images.image = Image
|
|
1354
|
+
settings.section.images.video = Video
|
|
1344
1355
|
settings.section.layout = Wygląd
|
|
1345
1356
|
settings.section.llama_index = Indeksy / LlamaIndex
|
|
1346
1357
|
settings.section.llama-index.chat = Czat
|
|
@@ -1368,6 +1379,22 @@ settings.upload.data_dir.desc = Włącz, aby przechowywać wszystko w jednym kat
|
|
|
1368
1379
|
settings.upload.store = Przechowuj załączniki w katalogu upload w katalogu roboczym
|
|
1369
1380
|
settings.upload.store.desc = Włącz przechowywanie lokalnej kopii przesłanych załączników do przyszłego użytku
|
|
1370
1381
|
settings.use_context = Włącz kontekst (pamięć)
|
|
1382
|
+
settings.video.aspect_ratio = Aspect ratio
|
|
1383
|
+
settings.video.aspect_ratio.desc = Frame aspect ratio (e.g., 16:9, 9:16, 1:1); availability depends on the selected model
|
|
1384
|
+
settings.video.duration = Video duration
|
|
1385
|
+
settings.video.duration.desc = Clip length in seconds; limits may vary by model
|
|
1386
|
+
settings.video.fps = FPS
|
|
1387
|
+
settings.video.fps.desc = Frames per second (e.g., 24, 25, 30); may be rounded or ignored by the model
|
|
1388
|
+
settings.video.generate_audio = Generate audio
|
|
1389
|
+
settings.video.generate_audio.desc = Include synthesized background audio if supported by the model
|
|
1390
|
+
settings.video.negative_prompt = Negative prompt
|
|
1391
|
+
settings.video.negative_prompt.desc = Words or phrases to avoid in the output (comma-separated)
|
|
1392
|
+
settings.video.prompt_model = Prompt enhancement model
|
|
1393
|
+
settings.video.prompt_model.desc = LLM used to refine your prompt before video generation (not the video model)
|
|
1394
|
+
settings.video.resolution = Video resolution
|
|
1395
|
+
settings.video.resolution.desc = Target output resolution (e.g., 720p, 1080p); availability depends on the model
|
|
1396
|
+
settings.video.seed = Seed
|
|
1397
|
+
settings.video.seed.desc = Optional random seed for reproducible results; leave empty for random
|
|
1371
1398
|
settings.vision.capture.auto = Auto przechwyt.
|
|
1372
1399
|
settings.vision.capture.enabled = Kamera
|
|
1373
1400
|
settings.vision.capture.height = Kamera - obraz szerokość (px)
|
|
@@ -1527,6 +1554,10 @@ updater.check.launch = Sprawdzaj przy uruchamianiu
|
|
|
1527
1554
|
update.released = wydanie
|
|
1528
1555
|
update.snap = Pobierz ze Snap Store
|
|
1529
1556
|
update.title = Sprawdzanie dostępności aktualizacji
|
|
1557
|
+
vid.status.downloading = Downloading video... please wait...
|
|
1558
|
+
vid.status.generating = Generating video from
|
|
1559
|
+
vid.status.prompt.error = Enhancement prompt error occured
|
|
1560
|
+
vid.status.prompt.wait = Preparing prompt... please wait...
|
|
1530
1561
|
vision.capture.auto = Auto przechwyt.
|
|
1531
1562
|
vision.capture.auto.click = Auto przechwyt. jest włączone!
|
|
1532
1563
|
vision.capture.auto.label = Auto przechwytywanie wł.
|
|
@@ -191,6 +191,7 @@ attachments_uploaded.tab = Завантажені файли
|
|
|
191
191
|
audio.cache.clear.confirm = Ви впевнені, що хочете видалити всі кешовані аудіофайли?
|
|
192
192
|
audio.cache.clear.success = OK. Усі файли аудіокешу очищено.
|
|
193
193
|
audio.control.btn = Керування голосом
|
|
194
|
+
audio.loop = Петля
|
|
194
195
|
audio.magic_word.detected = Магічне слово виявлено!
|
|
195
196
|
audio.magic_word.invalid = Не магічне слово :(
|
|
196
197
|
audio.magic_word.please = Магічне слово, будь ласка...
|
|
@@ -845,7 +846,7 @@ mode.agent_openai.tooltip = Просунуті агенти (OpenAI)
|
|
|
845
846
|
mode.agent.tooltip = Прості агенти (legacy)
|
|
846
847
|
mode.assistant = Помічник
|
|
847
848
|
mode.assistant.tooltip = Чат за допомогою API Асистентів
|
|
848
|
-
mode.audio =
|
|
849
|
+
mode.audio = Realtime + audio
|
|
849
850
|
mode.chat = Чат
|
|
850
851
|
mode.chat.tooltip = Режим чату (за замовчуванням)
|
|
851
852
|
mode.completion = Завершення
|
|
@@ -854,7 +855,7 @@ mode.computer = Використання комп'ютера
|
|
|
854
855
|
mode.computer.tooltip = Використання комп'ютера (миша, клавіатура, навігація)
|
|
855
856
|
mode.expert = Експерти (співпраця)
|
|
856
857
|
mode.expert.tooltip = Виклик експертів на задній план
|
|
857
|
-
mode.img = Зображення
|
|
858
|
+
mode.img = Зображення та відео
|
|
858
859
|
mode.img.tooltip = Генерація зображень за допомогою DALL-E
|
|
859
860
|
mode.langchain = Langchain
|
|
860
861
|
mode.langchain.tooltip = Чат з моделями, наданими Langchain
|
|
@@ -1127,6 +1128,8 @@ settings.audio.input.stop_interval.desc = Інтервал у секундах
|
|
|
1127
1128
|
settings.audio.input.timeout = Тайм-аут запису
|
|
1128
1129
|
settings.audio.input.timeout.continuous = Увімкнути тайм-аут у безперервному режимі
|
|
1129
1130
|
settings.audio.input.timeout.desc = Тайм-аут (в секундах) для автоматичної зупинки запису, 0 для відключення, за замовчуванням: 120
|
|
1131
|
+
settings.audio.input.vad.prefix = Заповнення префікса VAD (в мс)
|
|
1132
|
+
settings.audio.input.vad.silence = Кінцева тиша VAD (в мс)
|
|
1130
1133
|
settings.audio.output.backend = Бекенд для аудіовиходу
|
|
1131
1134
|
settings.audio.output.backend.desc = Виберіть бекенд для аудіовиходу.
|
|
1132
1135
|
settings.audio.output.device = Пристрій для аудіовиходу
|
|
@@ -1197,9 +1200,10 @@ settings.frequency_penalty = Частотний штраф
|
|
|
1197
1200
|
settings.func_call.native = Використовувати рідні виклики функцій API
|
|
1198
1201
|
settings.func_call.native.desc = Якщо увімкнено, програма буде використовувати рідні виклики функцій API замість внутрішнього формату pygpt і нижченаведених запитів команд не використовуватимуться. Лише режими чату та асистентів.
|
|
1199
1202
|
settings.img_dialog_open = Відкрити діалогове вікно зображення після генерації (Режим зображення)
|
|
1200
|
-
settings.img_prompt_model =
|
|
1201
|
-
settings.
|
|
1202
|
-
settings.
|
|
1203
|
+
settings.img_prompt_model = Модель Генерації Запиту
|
|
1204
|
+
settings.img_prompt_model.desc = LLM, що використовується для уточнення вашого запиту перед генерацією зображень (не модель зображень)
|
|
1205
|
+
settings.img_quality = Якість Зображення
|
|
1206
|
+
settings.img_resolution = Розмір Зображення
|
|
1203
1207
|
settings.layout.animation.disable = Вимкнути анімації
|
|
1204
1208
|
settings.layout.animation.disable.desc = Вимикає анімації макета, як анімовані завантажувачі тощо.
|
|
1205
1209
|
settings.layout.density = Щільність компонування
|
|
@@ -1294,8 +1298,10 @@ settings.prompt.ctx.auto_summary.user = Контекст: авто-резюме
|
|
|
1294
1298
|
settings.prompt.ctx.auto_summary.user.desc = Заповнювачі: {input}, {output}
|
|
1295
1299
|
settings.prompt.expert = Експерт: Основний запит
|
|
1296
1300
|
settings.prompt.expert.desc = Інструкція (системний запит) для ведучого експерта, як керувати підеекспертами. Інструкції для підеекспертів даються з їхніх налаштувань.
|
|
1297
|
-
settings.prompt.img =
|
|
1301
|
+
settings.prompt.img = Генерація зображення
|
|
1298
1302
|
settings.prompt.img.desc = Підказка для генерації команддля DALL-E (якщо вимкнено сирівний режим). Тільки режим зображення.
|
|
1303
|
+
settings.prompt.video = Генерація відео
|
|
1304
|
+
settings.prompt.video.desc = Запит для генерації запитів для відеомоделі (якщо режим без обробки вимкнено). Тільки режим Зображення/Відео.
|
|
1299
1305
|
settings.remote_tools.code_interpreter = Інтерпретатор коду
|
|
1300
1306
|
settings.remote_tools.code_interpreter.desc = Увімкніть віддалений інструмент `code_interpreter` у режимі Чат / через Responses API OpenAI.
|
|
1301
1307
|
settings.remote_tools.file_search = File search
|
|
@@ -1339,7 +1345,9 @@ settings.section.ctx = Контекст
|
|
|
1339
1345
|
settings.section.debug = Налагодження
|
|
1340
1346
|
settings.section.files = Файли та вкладення
|
|
1341
1347
|
settings.section.general = Загальні
|
|
1342
|
-
settings.section.images = Зображення
|
|
1348
|
+
settings.section.images = Зображення і відео
|
|
1349
|
+
settings.section.images.image = Зображення
|
|
1350
|
+
settings.section.images.video = Відео
|
|
1343
1351
|
settings.section.layout = Макет
|
|
1344
1352
|
settings.section.llama_index = Індекси / LlamaIndex
|
|
1345
1353
|
settings.section.llama-index.chat = Чат
|
|
@@ -1367,6 +1375,22 @@ settings.upload.data_dir.desc = Увімкніть, щоб зберігати в
|
|
|
1367
1375
|
settings.upload.store = Зберігати вкладення у директорії завантаження робочого каталогу
|
|
1368
1376
|
settings.upload.store.desc = Увімкнути зберігання локальної копії завантажених вкладень для майбутнього використання
|
|
1369
1377
|
settings.use_context = Використовувати контекст (пам'ять)
|
|
1378
|
+
settings.video.aspect_ratio = Співвідношення сторін
|
|
1379
|
+
settings.video.aspect_ratio.desc = Співвідношення сторін кадру (наприклад, 16:9, 9:16, 1:1); доступність залежить від вибраної моделі
|
|
1380
|
+
settings.video.duration = Тривалість відео
|
|
1381
|
+
settings.video.duration.desc = Довжина кліпу в секундах; межі можуть відрізнятися залежно від моделі
|
|
1382
|
+
settings.video.fps = FPS
|
|
1383
|
+
settings.video.fps.desc = Кількість кадрів на секунду (наприклад, 24, 25, 30); може бути округлена або проігнорована моделлю
|
|
1384
|
+
settings.video.generate_audio = Генерувати аудіо
|
|
1385
|
+
settings.video.generate_audio.desc = Включити синтезоване фонове аудіо, якщо модель його підтримує
|
|
1386
|
+
settings.video.negative_prompt = Негативний запит
|
|
1387
|
+
settings.video.negative_prompt.desc = Слова чи фрази для уникнення в результаті (через кому)
|
|
1388
|
+
settings.video.prompt_model = Модель покращення запиту
|
|
1389
|
+
settings.video.prompt_model.desc = LLM, що використовується для уточнення вашого запиту перед генерацією відео (не відеомодель)
|
|
1390
|
+
settings.video.resolution = Роздільна здатність відео
|
|
1391
|
+
settings.video.resolution.desc = Цільова вихідна роздільна здатність (наприклад, 720p, 1080p); доступність залежить від моделі
|
|
1392
|
+
settings.video.seed = Seed
|
|
1393
|
+
settings.video.seed.desc = Опціональний випадковий seed для відтворюваних результатів; залиште порожнім для випадкового
|
|
1370
1394
|
settings.vision.capture.auto = Автоматичне захоплення
|
|
1371
1395
|
settings.vision.capture.enabled = Камера
|
|
1372
1396
|
settings.vision.capture.height = Висота захоплення з камери (пікселі)
|
|
@@ -1526,6 +1550,10 @@ updater.check.launch = Перевіряти при запуску
|
|
|
1526
1550
|
update.released = збірка
|
|
1527
1551
|
update.snap = Перейти до Snap Store
|
|
1528
1552
|
update.title = Перевірка оновлень
|
|
1553
|
+
vid.status.downloading = Завантаження відео... будь ласка, зачекайте...
|
|
1554
|
+
vid.status.generating = Генерація відео з
|
|
1555
|
+
vid.status.prompt.error = Виникла помилка під час покращення запиту
|
|
1556
|
+
vid.status.prompt.wait = Підготовка запиту... будь ласка, зачекайте...
|
|
1529
1557
|
vision.capture.auto = Автоматичне захоплення
|
|
1530
1558
|
vision.capture.auto.click = Увімкнуто автоматичне захоплення!
|
|
1531
1559
|
vision.capture.auto.label = Автоматичне захоплення увімкнуто
|
|
@@ -191,6 +191,7 @@ attachments_uploaded.tab = 已上傳的文件
|
|
|
191
191
|
audio.cache.clear.confirm = 您确定要删除所有缓存的音频文件吗?
|
|
192
192
|
audio.cache.clear.success = OK. 所有音频缓存文件已清除。
|
|
193
193
|
audio.control.btn = 语音控制
|
|
194
|
+
audio.loop = 循环
|
|
194
195
|
audio.magic_word.detected = 檢測到魔法詞!
|
|
195
196
|
audio.magic_word.invalid = 不是魔法词 :(
|
|
196
197
|
audio.magic_word.please = 请说魔法词...
|
|
@@ -845,7 +846,7 @@ mode.agent_openai.tooltip = 高级代理 (OpenAI)
|
|
|
845
846
|
mode.agent.tooltip = 简单代理(自主)
|
|
846
847
|
mode.assistant = 助手
|
|
847
848
|
mode.assistant.tooltip = 使用助手API進行聊天
|
|
848
|
-
mode.audio =
|
|
849
|
+
mode.audio = Realtime + audio
|
|
849
850
|
mode.chat = 聊天模式
|
|
850
851
|
mode.chat.tooltip = 聊天模式(預設)
|
|
851
852
|
mode.completion = 完成模式
|
|
@@ -854,7 +855,7 @@ mode.computer = 使用计算机
|
|
|
854
855
|
mode.computer.tooltip = 使用计算机(鼠标、键盘、导航)
|
|
855
856
|
mode.expert = 专家 (合作)
|
|
856
857
|
mode.expert.tooltip = 背景中呼叫专家
|
|
857
|
-
mode.img =
|
|
858
|
+
mode.img = 图像和视频
|
|
858
859
|
mode.img.tooltip = 使用DALL-E生成圖像
|
|
859
860
|
mode.langchain = Langchain模式
|
|
860
861
|
mode.langchain.tooltip = 使用Langchain提供的模型進行聊天
|
|
@@ -1127,6 +1128,8 @@ settings.audio.input.stop_interval.desc = 自动转录音频片段的间隔(
|
|
|
1127
1128
|
settings.audio.input.timeout = 录音超时
|
|
1128
1129
|
settings.audio.input.timeout.continuous = 在连续模式下启用超时
|
|
1129
1130
|
settings.audio.input.timeout.desc = 自动停止录音的超时时间(秒),0为禁用,默认:120
|
|
1131
|
+
settings.audio.input.vad.prefix = VAD 前缀填充(以毫秒为单位)
|
|
1132
|
+
settings.audio.input.vad.silence = VAD 结束静音(以毫秒为单位)
|
|
1130
1133
|
settings.audio.output.backend = 音频输出的后端
|
|
1131
1134
|
settings.audio.output.backend.desc = 选择音频输出的后端。
|
|
1132
1135
|
settings.audio.output.device = 音频输出的设备
|
|
@@ -1198,6 +1201,7 @@ settings.func_call.native = 使用本机 API 函数调用
|
|
|
1198
1201
|
settings.func_call.native.desc = 如果启用,应用程序将使用本机 API 函数调用,而不是内部 pygpt 格式,并且下面的命令提示将不被使用。仅聊天和助手模式。
|
|
1199
1202
|
settings.img_dialog_open = 生成后打开图像对话框(图像模式)
|
|
1200
1203
|
settings.img_prompt_model = DALL-E:提示生成模型
|
|
1204
|
+
settings.img_prompt_model.desc = 用于在图像生成前优化您的提示的LLM(不是图像模型)
|
|
1201
1205
|
settings.img_quality = DALL-E:图像质量
|
|
1202
1206
|
settings.img_resolution = DALL-E:图像尺寸
|
|
1203
1207
|
settings.layout.animation.disable = 禁用动画
|
|
@@ -1296,6 +1300,8 @@ settings.prompt.expert = 专家:主提示
|
|
|
1296
1300
|
settings.prompt.expert.desc = 对主专家如何处理奴隶专家的指令(系统提示)。奴隶专家的指令根据他们的预设给出。
|
|
1297
1301
|
settings.prompt.img = DALL-E:生成图像
|
|
1298
1302
|
settings.prompt.img.desc = 提示用于生成DALL-E的命令(如果原始模式被禁用)。仅图像模式。
|
|
1303
|
+
settings.prompt.video = 视频生成
|
|
1304
|
+
settings.prompt.video.desc = 为视频模型生成提示(如果未禁用原始模式)。仅限图像/视频模式。
|
|
1299
1305
|
settings.remote_tools.code_interpreter = 代码解释器
|
|
1300
1306
|
settings.remote_tools.code_interpreter.desc = 在聊天模式/通过 OpenAI Responses API 启用“code_interpreter”远程工具。
|
|
1301
1307
|
settings.remote_tools.file_search = File search
|
|
@@ -1339,7 +1345,9 @@ settings.section.ctx = 上下文
|
|
|
1339
1345
|
settings.section.debug = 调试
|
|
1340
1346
|
settings.section.files = 文件和附件
|
|
1341
1347
|
settings.section.general = 一般
|
|
1342
|
-
settings.section.images =
|
|
1348
|
+
settings.section.images = 图像和视频
|
|
1349
|
+
settings.section.images.image = 图像
|
|
1350
|
+
settings.section.images.video = 视频
|
|
1343
1351
|
settings.section.layout = 布局
|
|
1344
1352
|
settings.section.llama_index = 索引 / LlamaIndex
|
|
1345
1353
|
settings.section.llama-index.chat = 聊天
|
|
@@ -1367,6 +1375,22 @@ settings.upload.data_dir.desc = 启用以将所有内容存储在一个数据目
|
|
|
1367
1375
|
settings.upload.store = 在工作目录上传目录中存储附件
|
|
1368
1376
|
settings.upload.store.desc = 启用以存储上传附件的本地副本以供将来使用
|
|
1369
1377
|
settings.use_context = 使用上下文(记忆)
|
|
1378
|
+
settings.video.aspect_ratio = 纵横比
|
|
1379
|
+
settings.video.aspect_ratio.desc = 帧的纵横比(例如,16:9、9:16、1:1);可用性取决于所选模型
|
|
1380
|
+
settings.video.duration = 视频时长
|
|
1381
|
+
settings.video.duration.desc = 剪辑长度(以秒为单位);限制可能因模型而异
|
|
1382
|
+
settings.video.fps = FPS
|
|
1383
|
+
settings.video.fps.desc = 每秒帧数(例如,24、25、30);可能会被模型四舍五入或忽略
|
|
1384
|
+
settings.video.generate_audio = 生成音频
|
|
1385
|
+
settings.video.generate_audio.desc = 如果模型支持,包含合成背景音频
|
|
1386
|
+
settings.video.negative_prompt = 负面提示
|
|
1387
|
+
settings.video.negative_prompt.desc = 在输出中要避免的词语或短语(用逗号分隔)
|
|
1388
|
+
settings.video.prompt_model = 提示增强模型
|
|
1389
|
+
settings.video.prompt_model.desc = 用于在视频生成前优化您的提示的LLM(不是视频模型)
|
|
1390
|
+
settings.video.resolution = 视频分辨率
|
|
1391
|
+
settings.video.resolution.desc = 目标输出分辨率(例如,720p,1080p);可用性取决于模型
|
|
1392
|
+
settings.video.seed = 随机种子
|
|
1393
|
+
settings.video.seed.desc = 可选的随机种子以获得可重复的结果;留空为随机
|
|
1370
1394
|
settings.vision.capture.auto = 自动捕获
|
|
1371
1395
|
settings.vision.capture.enabled = 相机
|
|
1372
1396
|
settings.vision.capture.height = 相机高度(px)
|
|
@@ -1526,6 +1550,10 @@ updater.check.launch = 啟動時檢查
|
|
|
1526
1550
|
update.released = 發布時間
|
|
1527
1551
|
update.snap = 前往Snap商店
|
|
1528
1552
|
update.title = 檢查更新中
|
|
1553
|
+
vid.status.downloading = 正在下载视频...请稍候...
|
|
1554
|
+
vid.status.generating = 正在从中生成视频
|
|
1555
|
+
vid.status.prompt.error = 提示增强出错
|
|
1556
|
+
vid.status.prompt.wait = 正在准备提示...请稍候...
|
|
1529
1557
|
vision.capture.auto = 自動捕獲
|
|
1530
1558
|
vision.capture.auto.click = 已啟用自動捕獲!
|
|
1531
1559
|
vision.capture.auto.label = 啟用自動捕獲
|
|
@@ -17,6 +17,10 @@ google_args.tooltip = Provide additional keyword arguments for recognize_google(
|
|
|
17
17
|
google_cloud_args.description = Additional keyword arguments for r.recognize_google_cloud(audio, **kwargs).
|
|
18
18
|
google_cloud_args.label = Additional keyword arguments
|
|
19
19
|
google_cloud_args.tooltip = Provide additional keyword arguments for recognize_google_cloud()
|
|
20
|
+
google_genai_audio_model.description = Specify Gemini model supporting audio, e.g., gemini-2.5-flash
|
|
21
|
+
google_genai_audio_model.label = Model
|
|
22
|
+
google_genai_audio_prompt.description = System prompt for transcription
|
|
23
|
+
google_genai_audio_prompt.label = System Prompt
|
|
20
24
|
magic_word.description = Activate listening only after the magic word is provided, like 'Hey GPT' or 'OK GPT'. Default: False.
|
|
21
25
|
magic_word.label = Magic word
|
|
22
26
|
magic_word_phrase_length.description = Magic word phrase length. Default: 2.
|
|
@@ -15,6 +15,10 @@ eleven_labs_voice.description = Specify the Voice ID.
|
|
|
15
15
|
eleven_labs_voice.label = Voice ID
|
|
16
16
|
google_api_key.description = You can obtain your own API key here: https://console.cloud.google.com/apis/library/texttospeech.googleapis.com
|
|
17
17
|
google_api_key.label = Google Cloud Text-to-speech API Key
|
|
18
|
+
google_genai_tts_model.description = Specify Gemini TTS model, e.g.: gemini-2.5-flash-preview-tts or gemini-2.5-pro-preview-tts
|
|
19
|
+
google_genai_tts_model.label = Model
|
|
20
|
+
google_genai_tts_voice.description = Specify voice, e.g.: Puck, Kore, Charon, Leda, Zephyr... (case-sensitive)
|
|
21
|
+
google_genai_tts_voice.label = Voice
|
|
18
22
|
google_lang.description = Specify the language code.
|
|
19
23
|
google_lang.label = Language code
|
|
20
24
|
google_voice.description = Specify the voice.
|
|
@@ -31,6 +31,14 @@ cmd.web_url_raw.tooltip = Example prompt: Give me the raw content of http://exam
|
|
|
31
31
|
cmd.web_urls.description = Enable `web_urls` command execution.\nIf enabled, the model will be able to search the Web and get a list of found URLs.
|
|
32
32
|
cmd.web_urls.label = Enable: getting a list of URLs from search results
|
|
33
33
|
cmd.web_urls.tooltip = Example prompt: Give me the list of URLs for query (question).
|
|
34
|
+
ddg_backend.description = Engine backend: auto, html, lite.
|
|
35
|
+
ddg_backend.label = Backend
|
|
36
|
+
ddg_region.description = DuckDuckGo region, e.g. us-en, pl-pl, wt-wt
|
|
37
|
+
ddg_region.label = Region (kl)
|
|
38
|
+
ddg_safesearch.description = Allowed values: on, moderate, off
|
|
39
|
+
ddg_safesearch.label = SafeSearch
|
|
40
|
+
ddg_timelimit.description = Use: d, w, m, y or leave empty for any time.
|
|
41
|
+
ddg_timelimit.label = Time limit (df)
|
|
34
42
|
disable_ssl.description = Disables SSL verification when crawling web pages.
|
|
35
43
|
disable_ssl.label = Disable SSL verification
|
|
36
44
|
google_api_cx.description = You can find your CX ID at https://programmablesearchengine.google.com/controlpanel/all\nRemember to enable the "Search on ALL internet pages" option in project settings.
|
pygpt_net/item/model.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.
|
|
9
|
+
# Updated Date: 2025.09.01 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import json
|
|
@@ -19,6 +19,7 @@ from pygpt_net.core.types import (
|
|
|
19
19
|
MODE_AUDIO,
|
|
20
20
|
MULTIMODAL_AUDIO,
|
|
21
21
|
OPENAI_COMPATIBLE_PROVIDERS,
|
|
22
|
+
MULTIMODAL_VIDEO,
|
|
22
23
|
)
|
|
23
24
|
|
|
24
25
|
class ModelItem:
|
|
@@ -287,6 +288,26 @@ class ModelItem:
|
|
|
287
288
|
return True
|
|
288
289
|
return False
|
|
289
290
|
|
|
291
|
+
def is_video_input(self) -> bool:
|
|
292
|
+
"""
|
|
293
|
+
Check if model supports video input
|
|
294
|
+
|
|
295
|
+
:return: True if supports video input
|
|
296
|
+
"""
|
|
297
|
+
if MULTIMODAL_VIDEO in self.input:
|
|
298
|
+
return True
|
|
299
|
+
return False
|
|
300
|
+
|
|
301
|
+
def is_video_output(self) -> bool:
|
|
302
|
+
"""
|
|
303
|
+
Check if model supports video output
|
|
304
|
+
|
|
305
|
+
:return: True if supports video output
|
|
306
|
+
"""
|
|
307
|
+
if MULTIMODAL_VIDEO in self.output:
|
|
308
|
+
return True
|
|
309
|
+
return False
|
|
310
|
+
|
|
290
311
|
def dump(self) -> str:
|
|
291
312
|
"""
|
|
292
313
|
Dump event to json string
|
|
@@ -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.08.31 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import os
|
|
@@ -23,6 +23,7 @@ from pygpt_net.utils import trans
|
|
|
23
23
|
from .config import Config
|
|
24
24
|
from .worker import Worker
|
|
25
25
|
from .simple import Simple
|
|
26
|
+
from ...core.types import MODE_AUDIO
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
class Plugin(BasePlugin):
|
|
@@ -124,13 +125,31 @@ class Plugin(BasePlugin):
|
|
|
124
125
|
words = [x.strip() for x in words] # remove white-spaces
|
|
125
126
|
return words
|
|
126
127
|
|
|
127
|
-
def toggle_recording_simple(
|
|
128
|
+
def toggle_recording_simple(
|
|
129
|
+
self,
|
|
130
|
+
state: bool = None,
|
|
131
|
+
auto: bool = False
|
|
132
|
+
):
|
|
128
133
|
"""
|
|
129
134
|
Event: AUDIO_INPUT_RECORD_TOGGLE
|
|
130
135
|
|
|
131
136
|
Toggle recording
|
|
137
|
+
|
|
138
|
+
:param state: state to set
|
|
139
|
+
:param auto: True if called automatically (not by user)
|
|
140
|
+
"""
|
|
141
|
+
if self.window.controller.realtime.is_enabled():
|
|
142
|
+
self.handler_simple.toggle_realtime(state=state, auto=auto)
|
|
143
|
+
return
|
|
144
|
+
self.handler_simple.toggle_recording(state=state)
|
|
145
|
+
|
|
146
|
+
def is_recording(self) -> bool:
|
|
132
147
|
"""
|
|
133
|
-
|
|
148
|
+
Check if is recording (simple mode)
|
|
149
|
+
|
|
150
|
+
:return: True if is recording
|
|
151
|
+
"""
|
|
152
|
+
return self.handler_simple.is_recording
|
|
134
153
|
|
|
135
154
|
def toggle_speech(self, state: bool):
|
|
136
155
|
"""
|
|
@@ -214,7 +233,9 @@ class Plugin(BasePlugin):
|
|
|
214
233
|
self.toggle_speech(data['value'])
|
|
215
234
|
|
|
216
235
|
elif name == Event.AUDIO_INPUT_RECORD_TOGGLE:
|
|
217
|
-
|
|
236
|
+
state = data['state'] if 'value' in data else None
|
|
237
|
+
auto = data['auto'] if 'auto' in data else False
|
|
238
|
+
self.toggle_recording_simple(state=state, auto=auto)
|
|
218
239
|
|
|
219
240
|
elif name == Event.AUDIO_INPUT_STOP:
|
|
220
241
|
self.on_stop()
|
|
@@ -492,6 +513,18 @@ class Plugin(BasePlugin):
|
|
|
492
513
|
self.window.dispatch(event) # send text, input clear in send method
|
|
493
514
|
self.set_status('')
|
|
494
515
|
|
|
516
|
+
def handle_realtime_stopped(self):
|
|
517
|
+
"""Handle realtime stopped"""
|
|
518
|
+
context = BridgeContext()
|
|
519
|
+
context.prompt = "..."
|
|
520
|
+
extra = {}
|
|
521
|
+
event = KernelEvent(KernelEvent.INPUT_SYSTEM, {
|
|
522
|
+
'context': context,
|
|
523
|
+
'extra': extra,
|
|
524
|
+
})
|
|
525
|
+
self.window.dispatch(event) # send text, input clear in send method
|
|
526
|
+
self.set_status('')
|
|
527
|
+
|
|
495
528
|
@Slot(object)
|
|
496
529
|
def handle_status(self, data: str):
|
|
497
530
|
"""
|
|
@@ -6,14 +6,14 @@
|
|
|
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.
|
|
9
|
+
# Updated Date: 2025.08.31 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
import os
|
|
13
13
|
|
|
14
14
|
from PySide6.QtCore import QTimer
|
|
15
15
|
|
|
16
|
-
from pygpt_net.core.events import AppEvent
|
|
16
|
+
from pygpt_net.core.events import AppEvent, RealtimeEvent
|
|
17
17
|
from pygpt_net.core.tabs.tab import Tab
|
|
18
18
|
from pygpt_net.utils import trans
|
|
19
19
|
|
|
@@ -32,8 +32,46 @@ class Simple:
|
|
|
32
32
|
self.is_recording = False
|
|
33
33
|
self.timer = None
|
|
34
34
|
|
|
35
|
-
def
|
|
36
|
-
|
|
35
|
+
def toggle_realtime(
|
|
36
|
+
self,
|
|
37
|
+
state: bool = None,
|
|
38
|
+
auto: bool = False
|
|
39
|
+
):
|
|
40
|
+
"""
|
|
41
|
+
Toggle recording
|
|
42
|
+
|
|
43
|
+
:param state: True to start recording, False to stop recording, None to toggle
|
|
44
|
+
:param auto: True if called automatically (not by user)
|
|
45
|
+
"""
|
|
46
|
+
if state is not None:
|
|
47
|
+
if state and not self.is_recording:
|
|
48
|
+
self.start_recording(realtime=True)
|
|
49
|
+
elif not state:
|
|
50
|
+
self.force_stop()
|
|
51
|
+
else:
|
|
52
|
+
self.force_stop()
|
|
53
|
+
return
|
|
54
|
+
if self.is_recording:
|
|
55
|
+
self.stop_recording(realtime=True)
|
|
56
|
+
if not auto:
|
|
57
|
+
self.plugin.window.dispatch(RealtimeEvent(RealtimeEvent.RT_INPUT_AUDIO_MANUAL_STOP))
|
|
58
|
+
else:
|
|
59
|
+
self.start_recording(realtime=True)
|
|
60
|
+
if not auto:
|
|
61
|
+
self.plugin.window.dispatch(RealtimeEvent(RealtimeEvent.RT_INPUT_AUDIO_MANUAL_START))
|
|
62
|
+
|
|
63
|
+
def toggle_recording(self, state: bool = None):
|
|
64
|
+
"""
|
|
65
|
+
Toggle recording
|
|
66
|
+
|
|
67
|
+
:param state: True to start recording, False to stop recording, None to toggle
|
|
68
|
+
"""
|
|
69
|
+
if state is not None:
|
|
70
|
+
if state and not self.is_recording:
|
|
71
|
+
self.start_recording()
|
|
72
|
+
elif not state:
|
|
73
|
+
self.force_stop()
|
|
74
|
+
return
|
|
37
75
|
if self.is_recording:
|
|
38
76
|
self.stop_recording()
|
|
39
77
|
else:
|
|
@@ -51,11 +89,12 @@ class Simple:
|
|
|
51
89
|
"""Stop timeout"""
|
|
52
90
|
self.stop_recording(timeout=True)
|
|
53
91
|
|
|
54
|
-
def start_recording(self, force: bool = False):
|
|
92
|
+
def start_recording(self, force: bool = False, realtime: bool = False):
|
|
55
93
|
"""
|
|
56
94
|
Start recording
|
|
57
95
|
|
|
58
96
|
:param force: True to force recording
|
|
97
|
+
:param realtime: True if called from realtime callback
|
|
59
98
|
"""
|
|
60
99
|
# display snap warning if not displayed yet
|
|
61
100
|
if (not self.plugin.window.core.config.get("audio.input.snap", False)
|
|
@@ -89,7 +128,7 @@ class Simple:
|
|
|
89
128
|
# disable in continuous mode
|
|
90
129
|
timeout = int(self.plugin.window.core.config.get('audio.input.timeout', 120) or 0) # get timeout
|
|
91
130
|
timeout_continuous = self.plugin.window.core.config.get('audio.input.timeout.continuous', False) # enable continuous timeout
|
|
92
|
-
if timeout > 0:
|
|
131
|
+
if timeout > 0 and not realtime:
|
|
93
132
|
if self.timer is None and (not continuous_enabled or timeout_continuous):
|
|
94
133
|
self.timer = QTimer()
|
|
95
134
|
self.timer.timeout.connect(self.stop_timeout)
|
|
@@ -119,11 +158,12 @@ class Simple:
|
|
|
119
158
|
)
|
|
120
159
|
self.switch_btn_start() # switch button to start
|
|
121
160
|
|
|
122
|
-
def stop_recording(self, timeout: bool = False):
|
|
161
|
+
def stop_recording(self, timeout: bool = False, realtime: bool = False):
|
|
123
162
|
"""
|
|
124
163
|
Stop recording
|
|
125
164
|
|
|
126
165
|
:param timeout: True if stopped due to timeout
|
|
166
|
+
:param realtime: True if called from realtime callback
|
|
127
167
|
"""
|
|
128
168
|
self.plugin.window.core.audio.capture.reset_audio_level()
|
|
129
169
|
self.is_recording = False
|
|
@@ -143,7 +183,7 @@ class Simple:
|
|
|
143
183
|
return
|
|
144
184
|
|
|
145
185
|
if self.plugin.window.core.audio.capture.has_frames():
|
|
146
|
-
if not self.plugin.window.core.audio.capture.has_min_frames():
|
|
186
|
+
if not self.plugin.window.core.audio.capture.has_min_frames() and not realtime:
|
|
147
187
|
self.plugin.window.update_status(trans("status.audio.too_short"))
|
|
148
188
|
self.plugin.window.dispatch(AppEvent(AppEvent.VOICE_CONTROL_STOPPED)) # app event
|
|
149
189
|
return
|
|
@@ -152,6 +192,15 @@ class Simple:
|
|
|
152
192
|
else:
|
|
153
193
|
self.plugin.window.update_status("")
|
|
154
194
|
|
|
195
|
+
def force_stop(self):
|
|
196
|
+
"""Stop recording"""
|
|
197
|
+
self.is_recording = False
|
|
198
|
+
self.plugin.window.dispatch(AppEvent(AppEvent.INPUT_VOICE_LISTEN_STOPPED)) # app event
|
|
199
|
+
self.switch_btn_start() # switch button to start
|
|
200
|
+
if self.plugin.window.core.audio.capture.has_source():
|
|
201
|
+
self.plugin.window.core.audio.capture.stop() # stop recording
|
|
202
|
+
return
|
|
203
|
+
|
|
155
204
|
def on_stop(self):
|
|
156
205
|
"""Handle auto-transcribe"""
|
|
157
206
|
path = os.path.join(self.plugin.window.core.config.path, self.plugin.input_file)
|