23
23
# For the sake of following the PEP8 standard, we will declare module-level dunder names.
24
24
# PEP8 standard about dunder names: https://peps.python.org/pep-0008/#module-level-dunder-names
25
25
26
- __version__ = "1.5 .0"
26
+ __version__ = "1.6 .0"
27
27
__author__ = "Jung Gyu Yoon"
28
28
29
29
# Constants
37
37
# For Windows
38
38
AUTOSTART_REGISTRY_KEY = r"Software\Microsoft\Windows\CurrentVersion\Run"
39
39
40
+
40
41
# Check if the application is frozen (compiled with PyInstaller)
41
42
# If this is main.py, it will return False, that means it is not frozen.
42
43
def is_frozen ():
@@ -81,6 +82,7 @@ def get_config_directory():
81
82
# The default updater path (relative to the application's root directory) - For Windows
82
83
UPDATER_PATH = os .path .join (UPDATE_DIR , "Updater.exe" )
83
84
85
+
84
86
# Move the Updater.exe to the config folder
85
87
def move_updater ():
86
88
original_updater_path = os .path .join (ROOT_DIR , "Updater.exe" )
@@ -199,6 +201,8 @@ def move_updater():
199
201
ICON_PAYPAL = os .path .join (ICON_PATH , "paypal.png" )
200
202
ICON_KOFI = os .path .join (ICON_PATH , "kofi.png" )
201
203
ICON_PATREON = os .path .join (ICON_PATH , "patreon.svg" )
204
+ ICON_SHORTCUT = os .path .join (ICON_PATH , "shortcut.svg" )
205
+ ICON_REALTIME_API = os .path .join (ICON_PATH , "realtime_api.svg" )
202
206
203
207
## CUSTOMIZE
204
208
DEFAULT_ICON_SIZE = (24 , 24 )
@@ -243,7 +247,6 @@ def move_updater():
243
247
DEFAULT_SHORTCUT_PROMPT_ENDING = "Ctrl+E"
244
248
DEFAULT_SHORTCUT_SUPPORT_PROMPT_COMMAND = "Ctrl+Shift+P"
245
249
DEFAULT_SHORTCUT_STACK_ON_TOP = "Ctrl+Shift+S"
246
- DEFAULT_SHORTCUT_SHOW_TOOLBAR = "Ctrl+T"
247
250
DEFAULT_SHORTCUT_SHOW_SECONDARY_TOOLBAR = "Ctrl+Shift+T"
248
251
DEFAULT_SHORTCUT_FOCUS_MODE = "F10"
249
252
DEFAULT_SHORTCUT_FULL_SCREEN = "F11"
@@ -288,7 +291,6 @@ def move_updater():
288
291
PROMPT_JSON_KEY_NAME = "prompt_json"
289
292
PROMPT_MAIN_KEY_NAME = "prompt_main"
290
293
PROMPT_END_KEY_NAME = "prompt_ending"
291
- PROMPT_NAME_REGEX = "^[a-zA-Z_0-9]+$"
292
294
INDENT_SIZE = 4
293
295
NOTIFIER_MAX_CHAR = 100
294
296
@@ -355,8 +357,21 @@ def move_updater():
355
357
WHISPER_TTS_VOICE_TYPE = ["alloy" , "echo" , "fable" , "onyx" , "nova" , "shimmer" ]
356
358
WHISPER_TTS_VOICE_SPEED_RANGE = 0.25 , 4.0
357
359
WHISPER_TTS_MODEL = "tts-1"
358
- WHISPER_TTS_DEFAULT_VOICE = "alloy"
359
- WHISPER_TTS_DEFAULT_SPEED = 1.0
360
+
361
+ ## EDGE-TTS (TTS)
362
+ EDGE_TTS_VOICE_TYPE = [
363
+ "en-GB-SoniaNeural" ,
364
+ "en-US-GuyNeural" ,
365
+ "en-US-JennyNeural" ,
366
+ "en-US-AvaMultilingualNeural" ,
367
+ ]
368
+
369
+ # TTS in general
370
+ TTS_DEFAULT_PROVIDER = "OpenAI"
371
+ TTS_DEFAULT_VOICE = "alloy"
372
+ TTS_DEFAULT_SPEED = 1.0
373
+ TTS_DEFAULT_AUTO_PLAY = False
374
+ TTS_DEFAULT_AUTO_STOP_SILENCE_DURATION = 3
360
375
361
376
STT_MODEL = "whisper-1"
362
377
@@ -413,6 +428,8 @@ def move_updater():
413
428
414
429
G4F_USE_CHAT_HISTORY = True
415
430
431
+ G4F_DEFAULT_IMAGE_MODEL = "flux"
432
+
416
433
# Dictionary that stores the platform and model pairs
417
434
PROVIDER_MODEL_DICT = {
418
435
"OpenAI" : ["gpt-4o" , "gpt-4o-mini" ] + O1_MODELS ,
@@ -628,7 +645,6 @@ def move_updater():
628
645
"notify_finish" : True ,
629
646
"temperature" : 1 ,
630
647
"max_tokens" : - 1 ,
631
- "show_toolbar" : True ,
632
648
"show_secondary_toolbar" : True ,
633
649
"top_p" : 1 ,
634
650
"chat_column_to_show" : ["id" , "name" , "insert_dt" , "update_dt" ],
@@ -662,16 +678,21 @@ def move_updater():
662
678
"llama_index_directory" : "" ,
663
679
"apply_user_defined_styles" : False ,
664
680
"focus_mode" : False ,
665
- "voice" : WHISPER_TTS_DEFAULT_VOICE ,
666
- "voice_speed" : WHISPER_TTS_DEFAULT_SPEED ,
667
681
"OPENAI_API_KEY" : "" ,
668
682
"GEMINI_API_KEY" : "" ,
669
683
"CLAUDE_API_KEY" : "" ,
670
684
"LLAMA_API_KEY" : "" ,
685
+ "show_realtime_api" : False ,
671
686
# G4F
672
687
"g4f_model" : DEFAULT_LLM ,
673
688
"provider" : G4F_PROVIDER_DEFAULT ,
674
689
"g4f_use_chat_history" : G4F_USE_CHAT_HISTORY ,
690
+ # STT and TTS settings
691
+ "voice_provider" : TTS_DEFAULT_PROVIDER ,
692
+ "voice" : TTS_DEFAULT_VOICE ,
693
+ "voice_speed" : TTS_DEFAULT_SPEED ,
694
+ "auto_play_voice" : TTS_DEFAULT_AUTO_PLAY ,
695
+ "auto_stop_silence_duration" : TTS_DEFAULT_AUTO_STOP_SILENCE_DURATION ,
675
696
},
676
697
"DALLE" : {
677
698
"quality" : "standard" ,
@@ -682,7 +703,6 @@ def move_updater():
682
703
"width" : 1024 ,
683
704
"height" : 1024 ,
684
705
"prompt_type" : 1 ,
685
-
686
706
"show_history" : True ,
687
707
"show_setting" : True ,
688
708
"prompt" : "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" ,
@@ -698,7 +718,6 @@ def move_updater():
698
718
"model" : "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b" ,
699
719
"width" : 768 ,
700
720
"height" : 768 ,
701
-
702
721
"show_history" : True ,
703
722
"show_setting" : True ,
704
723
"prompt" : "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" ,
@@ -708,12 +727,11 @@ def move_updater():
708
727
"number_of_images_to_create" : 2 ,
709
728
"save_prompt_as_text" : True ,
710
729
"show_prompt_on_image" : False ,
711
-
712
730
"negative_prompt" : "ugly, deformed, noisy, blurry, distorted" ,
713
731
},
714
732
"G4F_IMAGE" : {
715
- "model" : "flux" ,
716
-
733
+ "model" : G4F_DEFAULT_IMAGE_MODEL ,
734
+ "provider" : G4F_PROVIDER_DEFAULT ,
717
735
"show_history" : True ,
718
736
"show_setting" : True ,
719
737
"prompt" : "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" ,
@@ -723,11 +741,11 @@ def move_updater():
723
741
"number_of_images_to_create" : 2 ,
724
742
"save_prompt_as_text" : True ,
725
743
"show_prompt_on_image" : False ,
726
-
727
744
"negative_prompt" : "ugly, deformed, noisy, blurry, distorted" ,
728
- }
745
+ },
729
746
}
730
747
748
+
731
749
# Dynamically add the API keys to the configuration data
732
750
def update_general_config_with_api_keys (config_data , api_configs ):
733
751
for config in api_configs :
@@ -737,7 +755,7 @@ def update_general_config_with_api_keys(config_data, api_configs):
737
755
update_general_config_with_api_keys (CONFIG_DATA , DEFAULT_API_CONFIGS )
738
756
739
757
# Set the default llama index cache directory for preventing any issues such as PermissionError
740
- os .environ [' NLTK_DATA' ] = os .path .join (get_config_directory (), "llama_index_cache" )
758
+ os .environ [" NLTK_DATA" ] = os .path .join (get_config_directory (), "llama_index_cache" )
741
759
742
760
# Update the __all__ list with the PEP8 standard dunder names
743
761
__all__ = ["__version__" , "__author__" ]
0 commit comments