Skip to content

Commit dbbf224

Browse files
committed
Initialize openai client and replicate client
1 parent dd1d8d5 commit dbbf224

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pyqt_openai/mainWindow.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
restart_app,
6666
show_message_box_after_change_to_restart,
6767
set_auto_start_windows,
68-
init_llama,
68+
init_llama, set_api_key,
6969
)
7070
from pyqt_openai.widgets.navWidget import NavBar
7171

@@ -102,7 +102,7 @@ def __initUi(self):
102102
self.__setTrayMenu()
103103
self.__setToolBar()
104104

105-
init_llama()
105+
self.__loadApiKeys()
106106

107107
self.setCentralWidget(self.__mainWidget)
108108
self.resize(*APP_INITIAL_WINDOW_SIZE)
@@ -112,6 +112,11 @@ def __initUi(self):
112112
self.__customizeParamsContainer
113113
)
114114

115+
def __loadApiKeys(self):
116+
set_api_key('OPENAI_API_KEY', CONFIG_MANAGER.get_general_property('OPENAI_API_KEY'))
117+
set_api_key('REPLICATE_API_KEY', CONFIG_MANAGER.get_general_property('REPLICATE_API_KEY'))
118+
init_llama()
119+
115120
def __setActions(self):
116121
self.__langAction = QAction()
117122

0 commit comments

Comments
 (0)