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.6.0 "
26
+ __version__ = "1.6.1 "
27
27
__author__ = "Jung Gyu Yoon"
28
28
29
29
# Constants
@@ -79,11 +79,9 @@ def get_config_directory():
79
79
BIN_DIR = get_config_directory ()
80
80
81
81
UPDATER_NAME = "Updater.exe" if sys .platform == "win32" else "Updater"
82
- EDGE_TTS_NAME = "edge-tts.exe" if sys .platform == "win32" else "edge-tts"
83
82
84
83
# The default updater path (relative to the application's root directory) - For Windows
85
84
UPDATER_PATH = os .path .join (BIN_DIR , UPDATER_NAME )
86
- EDGE_TTS_PATH = os .path .join (BIN_DIR , EDGE_TTS_NAME )
87
85
88
86
# Move the binary file to the config folder to prevent "file not found" error
89
87
def move_bin (filename , dst_dir ):
@@ -94,7 +92,6 @@ def move_bin(filename, dst_dir):
94
92
shutil .move (original_path , dst_dir )
95
93
96
94
move_bin (UPDATER_NAME , UPDATER_PATH )
97
- move_bin (EDGE_TTS_NAME , EDGE_TTS_PATH )
98
95
99
96
CONTACT = "yjg30737@gmail.com"
100
97
APP_INITIAL_WINDOW_SIZE = (1280 , 768 )
@@ -205,6 +202,7 @@ def move_bin(filename, dst_dir):
205
202
ICON_PATREON = os .path .join (ICON_PATH , "patreon.svg" )
206
203
ICON_SHORTCUT = os .path .join (ICON_PATH , "shortcut.svg" )
207
204
ICON_REALTIME_API = os .path .join (ICON_PATH , "realtime_api.svg" )
205
+ ICON_FILE = os .path .join (ICON_PATH , "file.svg" )
208
206
209
207
## CUSTOMIZE
210
208
DEFAULT_ICON_SIZE = (24 , 24 )
@@ -213,6 +211,7 @@ def move_bin(filename, dst_dir):
213
211
DEFAULT_FONT_SIZE = 12
214
212
DEFAULT_FONT_FAMILY = "Arial"
215
213
214
+ DEFAULT_HIGHLIGHT_TEXT_COLOR = "#A2D0DD"
216
215
DEFAULT_BUTTON_HOVER_COLOR = "#A2D0DD"
217
216
DEFAULT_BUTTON_PRESSED_COLOR = "#B3E0FF"
218
217
DEFAULT_BUTTON_CHECKED_COLOR = "#B3E0FF"
@@ -240,26 +239,37 @@ def move_bin(filename, dst_dir):
240
239
# DEFAULT_MARKDOWN_h6_color = '#000'
241
240
# DEFAULT_MARKDOWN_a_color = '#000'
242
241
242
+
243
+
244
+ command_key = "Ctrl"
245
+ if sys .platform == "darwin" :
246
+ command_key = "Cmd"
247
+
248
+
243
249
## SHORTCUT
244
250
DEFAULT_SHORTCUT_GENERAL_ACTION = "Return"
245
- DEFAULT_SHORTCUT_FIND_PREV = "Ctrl +Shift+D"
246
- DEFAULT_SHORTCUT_FIND_NEXT = "Ctrl +D"
251
+ DEFAULT_SHORTCUT_FIND_PREV = f" { command_key } +Shift+D"
252
+ DEFAULT_SHORTCUT_FIND_NEXT = f" { command_key } +D"
247
253
DEFAULT_SHORTCUT_FIND_CLOSE = "Escape"
248
- DEFAULT_SHORTCUT_PROMPT_BEGINNING = "Ctrl +B"
249
- DEFAULT_SHORTCUT_PROMPT_ENDING = "Ctrl +E"
250
- DEFAULT_SHORTCUT_SUPPORT_PROMPT_COMMAND = "Ctrl +Shift+P"
251
- DEFAULT_SHORTCUT_STACK_ON_TOP = "Ctrl +Shift+S"
252
- DEFAULT_SHORTCUT_SHOW_SECONDARY_TOOLBAR = "Ctrl +Shift+T"
254
+ DEFAULT_SHORTCUT_PROMPT_BEGINNING = f" { command_key } +B"
255
+ DEFAULT_SHORTCUT_PROMPT_ENDING = f" { command_key } +E"
256
+ DEFAULT_SHORTCUT_SUPPORT_PROMPT_COMMAND = f" { command_key } +Shift+P"
257
+ DEFAULT_SHORTCUT_STACK_ON_TOP = f" { command_key } +Shift+S"
258
+ DEFAULT_SHORTCUT_SHOW_SECONDARY_TOOLBAR = f" { command_key } +Shift+T"
253
259
DEFAULT_SHORTCUT_FOCUS_MODE = "F10"
254
260
DEFAULT_SHORTCUT_FULL_SCREEN = "F11"
255
- DEFAULT_SHORTCUT_FIND = "Ctrl+F"
256
- DEFAULT_SHORTCUT_JSON_MODE = "Ctrl+J"
257
- DEFAULT_SHORTCUT_LEFT_SIDEBAR_WINDOW = "Ctrl+L"
258
- DEFAULT_SHORTCUT_RIGHT_SIDEBAR_WINDOW = "Ctrl+R"
259
- DEFAULT_SHORTCUT_CONTROL_PROMPT_WINDOW = "Ctrl+Shift+C"
260
- DEFAULT_SHORTCUT_RECORD = "Ctrl+Shift+R"
261
- DEFAULT_SHORTCUT_SETTING = "Ctrl+Alt+S"
262
- DEFAULT_SHORTCUT_SEND = "Ctrl+Return"
261
+ DEFAULT_SHORTCUT_FIND = f"{ command_key } +F"
262
+ DEFAULT_SHORTCUT_JSON_MODE = f"{ command_key } +J"
263
+ DEFAULT_SHORTCUT_LEFT_SIDEBAR_WINDOW = f"{ command_key } +L"
264
+ DEFAULT_SHORTCUT_RIGHT_SIDEBAR_WINDOW = f"{ command_key } +R"
265
+ DEFAULT_SHORTCUT_CONTROL_PROMPT_WINDOW = f"{ command_key } +Shift+C"
266
+ DEFAULT_SHORTCUT_RECORD = f"{ command_key } +Shift+R"
267
+ DEFAULT_SHORTCUT_SETTING = f"{ command_key } +Alt+S"
268
+ DEFAULT_SHORTCUT_SEND = f"{ command_key } +Return"
269
+
270
+ DEFAULT_SWITCH_PROMPT_UP = f"{ command_key } +Up"
271
+ DEFAULT_SWITCH_PROMPT_DOWN = f"{ command_key } +Down"
272
+
263
273
264
274
## DIRECTORY PATH & FILE'S NAME
265
275
MAIN_INDEX = "main.py"
@@ -303,6 +313,8 @@ def move_bin(filename, dst_dir):
303
313
THREAD_TRIGGER_NAME_OLD = "conv_tr"
304
314
MESSAGE_TABLE_NAME_OLD = "conv_unit_tb"
305
315
316
+ CHAT_FILE_TABLE_NAME = "chat_file_tb"
317
+
306
318
THREAD_TABLE_NAME = "thread_tb"
307
319
THREAD_TRIGGER_NAME = "thread_tr"
308
320
MESSAGE_TABLE_NAME = "message_tb"
@@ -336,6 +348,7 @@ def move_bin(filename, dst_dir):
336
348
PROMPT_GROUP_TABLE_NAME = "prompt_group_tb"
337
349
PROMPT_ENTRY_TABLE_NAME = "prompt_entry_tb"
338
350
351
+
339
352
# AI
340
353
## OPENAI
341
354
OPENAI_REQUEST_URL = "https://api.openai.com/v1/models"
@@ -418,7 +431,13 @@ def move_bin(filename, dst_dir):
418
431
{"display_name" : "OpenAI" , "env_var_name" : "OPENAI_API_KEY" , "api_key" : "" },
419
432
{"display_name" : "Gemini" , "env_var_name" : "GEMINI_API_KEY" , "api_key" : "" },
420
433
{"display_name" : "Claude" , "env_var_name" : "CLAUDE_API_KEY" , "api_key" : "" },
421
- {"display_name" : "Llama" , "env_var_name" : "LLAMA_API_KEY" , "api_key" : "" },
434
+
435
+ # For G4F only
436
+ {"display_name" : "DeepInfra" , "env_var_name" : "DEEPINFRA_API_KEY" , "api_key" : "" },
437
+ {"display_name" : "Groq" , "env_var_name" : "GROQ_API_KEY" , "api_key" : "" },
438
+ {"display_name" : "HuggingFace" , "env_var_name" : "HUGGINGFACE_API_KEY" , "api_key" : "" },
439
+ {"display_name" : "OpenRouter" , "env_var_name" : "OPENROUTER_API_KEY" , "api_key" : "" },
440
+ {"display_name" : "Perplexity API" , "env_var_name" : "PERPLEXITY_API_KEY" , "api_key" : "" }
422
441
]
423
442
424
443
# This has to be managed separately since some of the arguments are different with usual models
@@ -436,8 +455,7 @@ def move_bin(filename, dst_dir):
436
455
PROVIDER_MODEL_DICT = {
437
456
"OpenAI" : ["gpt-4o" , "gpt-4o-mini" ] + O1_MODELS ,
438
457
"Gemini" : ["gemini-1.5-flash" , "gemini-1.5-pro" ],
439
- "Claude" : ["claude-3-5-sonnet-20240620" ],
440
- "Llama" : ["llama3-70b" ],
458
+ "Claude" : ["claude-3-5-sonnet-20240620" ]
441
459
}
442
460
443
461
# Constants related to the number of messages LLM will store
@@ -633,24 +651,25 @@ def move_bin(filename, dst_dir):
633
651
# ----------------------------
634
652
CONFIG_DATA = {
635
653
"General" : {
636
- "TAB_IDX" : 0 ,
654
+ # Language
637
655
"lang" : "English" ,
638
- "show_chat_list" : True ,
639
- "stream" : True ,
656
+ # DB
640
657
"db" : "conv" ,
641
- "model" : DEFAULT_LLM ,
658
+ # GUI & Application settings
659
+ "TAB_IDX" : 0 ,
660
+ "show_chat_list" : True ,
642
661
"show_setting" : True ,
643
- "use_llama_index" : False ,
644
662
"do_not_ask_again" : False ,
645
663
"show_prompt" : True ,
646
- "system" : "You are a helpful assistant." ,
647
664
"notify_finish" : True ,
648
- "temperature" : 1 ,
649
- "max_tokens" : - 1 ,
650
665
"show_secondary_toolbar" : True ,
651
- "top_p" : 1 ,
666
+ "focus_mode" : False ,
667
+ "show_as_markdown" : True ,
668
+ "show_realtime_api" : False ,
669
+ "run_at_startup" : True ,
670
+ "manual_update" : True ,
671
+ # Columns
652
672
"chat_column_to_show" : ["id" , "name" , "insert_dt" , "update_dt" ],
653
- "frequency_penalty" : 0 ,
654
673
"image_column_to_show" : [
655
674
"id" ,
656
675
"model" ,
@@ -666,25 +685,28 @@ def move_bin(filename, dst_dir):
666
685
"update_dt" ,
667
686
"insert_dt" ,
668
687
],
688
+ # Parameters
689
+ "model" : DEFAULT_LLM ,
690
+ "system" : "You are a helpful assistant." ,
691
+ "stream" : True ,
692
+ "temperature" : 1 ,
693
+ "max_tokens" : - 1 ,
694
+ "top_p" : 1 ,
695
+ "frequency_penalty" : 0 ,
669
696
"presence_penalty" : 0 ,
670
697
"json_object" : False ,
671
698
"maximum_messages_in_parameter" : MAXIMUM_MESSAGES_IN_PARAMETER ,
672
- "show_as_markdown" : True ,
673
- "run_at_startup" : True ,
674
699
"use_max_tokens" : False ,
700
+ # Llama Index
701
+ "use_llama_index" : False ,
702
+ "llama_index_directory" : "" ,
703
+ # Customize
675
704
"background_image" : "" ,
676
705
"user_image" : DEFAULT_USER_IMAGE_PATH ,
677
706
"ai_image" : DEFAULT_AI_IMAGE_PATH ,
678
707
"font_size" : DEFAULT_FONT_SIZE ,
679
708
"font_family" : DEFAULT_FONT_FAMILY ,
680
- "llama_index_directory" : "" ,
681
709
"apply_user_defined_styles" : False ,
682
- "focus_mode" : False ,
683
- "OPENAI_API_KEY" : "" ,
684
- "GEMINI_API_KEY" : "" ,
685
- "CLAUDE_API_KEY" : "" ,
686
- "LLAMA_API_KEY" : "" ,
687
- "show_realtime_api" : False ,
688
710
# G4F
689
711
"g4f_model" : DEFAULT_LLM ,
690
712
"provider" : G4F_PROVIDER_DEFAULT ,
@@ -747,13 +769,11 @@ def move_bin(filename, dst_dir):
747
769
},
748
770
}
749
771
750
-
751
772
# Dynamically add the API keys to the configuration data
752
773
def update_general_config_with_api_keys (config_data , api_configs ):
753
774
for config in api_configs :
754
775
config_data ["General" ][config ["env_var_name" ]] = config ["api_key" ]
755
776
756
-
757
777
update_general_config_with_api_keys (CONFIG_DATA , DEFAULT_API_CONFIGS )
758
778
759
779
# Set the default llama index cache directory for preventing any issues such as PermissionError
0 commit comments