From dbbf22489fec48cdd7b864747e3df6c40b97a1a0 Mon Sep 17 00:00:00 2001 From: yjg30737 Date: Wed, 13 Nov 2024 17:38:10 +0900 Subject: [PATCH] Initialize openai client and replicate client --- pyqt_openai/mainWindow.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyqt_openai/mainWindow.py b/pyqt_openai/mainWindow.py index 40bd251..8255eaf 100644 --- a/pyqt_openai/mainWindow.py +++ b/pyqt_openai/mainWindow.py @@ -65,7 +65,7 @@ restart_app, show_message_box_after_change_to_restart, set_auto_start_windows, - init_llama, + init_llama, set_api_key, ) from pyqt_openai.widgets.navWidget import NavBar @@ -102,7 +102,7 @@ def __initUi(self): self.__setTrayMenu() self.__setToolBar() - init_llama() + self.__loadApiKeys() self.setCentralWidget(self.__mainWidget) self.resize(*APP_INITIAL_WINDOW_SIZE) @@ -112,6 +112,11 @@ def __initUi(self): self.__customizeParamsContainer ) + def __loadApiKeys(self): + set_api_key('OPENAI_API_KEY', CONFIG_MANAGER.get_general_property('OPENAI_API_KEY')) + set_api_key('REPLICATE_API_KEY', CONFIG_MANAGER.get_general_property('REPLICATE_API_KEY')) + init_llama() + def __setActions(self): self.__langAction = QAction()