2323# For the sake of following the PEP8 standard, we will declare module-level dunder names.
2424# PEP8 standard about dunder names: https://peps.python.org/pep-0008/#module-level-dunder-names
2525
26- __version__ = "1.5 .0"
26+ __version__ = "1.6 .0"
2727__author__ = "Jung Gyu Yoon"
2828
2929# Constants
3737# For Windows
3838AUTOSTART_REGISTRY_KEY = r"Software\Microsoft\Windows\CurrentVersion\Run"
3939
40+
4041# Check if the application is frozen (compiled with PyInstaller)
4142# If this is main.py, it will return False, that means it is not frozen.
4243def is_frozen ():
@@ -81,6 +82,7 @@ def get_config_directory():
8182# The default updater path (relative to the application's root directory) - For Windows
8283UPDATER_PATH = os .path .join (UPDATE_DIR , "Updater.exe" )
8384
85+
8486# Move the Updater.exe to the config folder
8587def move_updater ():
8688 original_updater_path = os .path .join (ROOT_DIR , "Updater.exe" )
@@ -199,6 +201,8 @@ def move_updater():
199201ICON_PAYPAL = os .path .join (ICON_PATH , "paypal.png" )
200202ICON_KOFI = os .path .join (ICON_PATH , "kofi.png" )
201203ICON_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" )
202206
203207## CUSTOMIZE
204208DEFAULT_ICON_SIZE = (24 , 24 )
@@ -243,7 +247,6 @@ def move_updater():
243247DEFAULT_SHORTCUT_PROMPT_ENDING = "Ctrl+E"
244248DEFAULT_SHORTCUT_SUPPORT_PROMPT_COMMAND = "Ctrl+Shift+P"
245249DEFAULT_SHORTCUT_STACK_ON_TOP = "Ctrl+Shift+S"
246- DEFAULT_SHORTCUT_SHOW_TOOLBAR = "Ctrl+T"
247250DEFAULT_SHORTCUT_SHOW_SECONDARY_TOOLBAR = "Ctrl+Shift+T"
248251DEFAULT_SHORTCUT_FOCUS_MODE = "F10"
249252DEFAULT_SHORTCUT_FULL_SCREEN = "F11"
@@ -288,7 +291,6 @@ def move_updater():
288291PROMPT_JSON_KEY_NAME = "prompt_json"
289292PROMPT_MAIN_KEY_NAME = "prompt_main"
290293PROMPT_END_KEY_NAME = "prompt_ending"
291- PROMPT_NAME_REGEX = "^[a-zA-Z_0-9]+$"
292294INDENT_SIZE = 4
293295NOTIFIER_MAX_CHAR = 100
294296
@@ -355,8 +357,21 @@ def move_updater():
355357WHISPER_TTS_VOICE_TYPE = ["alloy" , "echo" , "fable" , "onyx" , "nova" , "shimmer" ]
356358WHISPER_TTS_VOICE_SPEED_RANGE = 0.25 , 4.0
357359WHISPER_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
360375
361376STT_MODEL = "whisper-1"
362377
@@ -413,6 +428,8 @@ def move_updater():
413428
414429G4F_USE_CHAT_HISTORY = True
415430
431+ G4F_DEFAULT_IMAGE_MODEL = "flux"
432+
416433# Dictionary that stores the platform and model pairs
417434PROVIDER_MODEL_DICT = {
418435 "OpenAI" : ["gpt-4o" , "gpt-4o-mini" ] + O1_MODELS ,
@@ -628,7 +645,6 @@ def move_updater():
628645 "notify_finish" : True ,
629646 "temperature" : 1 ,
630647 "max_tokens" : - 1 ,
631- "show_toolbar" : True ,
632648 "show_secondary_toolbar" : True ,
633649 "top_p" : 1 ,
634650 "chat_column_to_show" : ["id" , "name" , "insert_dt" , "update_dt" ],
@@ -662,16 +678,21 @@ def move_updater():
662678 "llama_index_directory" : "" ,
663679 "apply_user_defined_styles" : False ,
664680 "focus_mode" : False ,
665- "voice" : WHISPER_TTS_DEFAULT_VOICE ,
666- "voice_speed" : WHISPER_TTS_DEFAULT_SPEED ,
667681 "OPENAI_API_KEY" : "" ,
668682 "GEMINI_API_KEY" : "" ,
669683 "CLAUDE_API_KEY" : "" ,
670684 "LLAMA_API_KEY" : "" ,
685+ "show_realtime_api" : False ,
671686 # G4F
672687 "g4f_model" : DEFAULT_LLM ,
673688 "provider" : G4F_PROVIDER_DEFAULT ,
674689 "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 ,
675696 },
676697 "DALLE" : {
677698 "quality" : "standard" ,
@@ -682,7 +703,6 @@ def move_updater():
682703 "width" : 1024 ,
683704 "height" : 1024 ,
684705 "prompt_type" : 1 ,
685-
686706 "show_history" : True ,
687707 "show_setting" : True ,
688708 "prompt" : "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" ,
@@ -698,7 +718,6 @@ def move_updater():
698718 "model" : "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b" ,
699719 "width" : 768 ,
700720 "height" : 768 ,
701-
702721 "show_history" : True ,
703722 "show_setting" : True ,
704723 "prompt" : "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" ,
@@ -708,12 +727,11 @@ def move_updater():
708727 "number_of_images_to_create" : 2 ,
709728 "save_prompt_as_text" : True ,
710729 "show_prompt_on_image" : False ,
711-
712730 "negative_prompt" : "ugly, deformed, noisy, blurry, distorted" ,
713731 },
714732 "G4F_IMAGE" : {
715- "model" : "flux" ,
716-
733+ "model" : G4F_DEFAULT_IMAGE_MODEL ,
734+ "provider" : G4F_PROVIDER_DEFAULT ,
717735 "show_history" : True ,
718736 "show_setting" : True ,
719737 "prompt" : "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" ,
@@ -723,11 +741,11 @@ def move_updater():
723741 "number_of_images_to_create" : 2 ,
724742 "save_prompt_as_text" : True ,
725743 "show_prompt_on_image" : False ,
726-
727744 "negative_prompt" : "ugly, deformed, noisy, blurry, distorted" ,
728- }
745+ },
729746}
730747
748+
731749# Dynamically add the API keys to the configuration data
732750def update_general_config_with_api_keys (config_data , api_configs ):
733751 for config in api_configs :
@@ -737,7 +755,7 @@ def update_general_config_with_api_keys(config_data, api_configs):
737755update_general_config_with_api_keys (CONFIG_DATA , DEFAULT_API_CONFIGS )
738756
739757# 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" )
741759
742760# Update the __all__ list with the PEP8 standard dunder names
743761__all__ = ["__version__" , "__author__" ]
0 commit comments