Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jhakulin committed May 9, 2024
1 parent b2f5d22 commit 920fe13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion gui/conversation_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ def load_assistant_list(self, ai_client_type : AIClientType):
for name in assistant_names:
if not self.assistant_client_manager.get_client(name):
assistant_config : AssistantConfig = self.assistant_config_manager.get_config(name)
assistant_config.config_folder = "config"
if assistant_config.assistant_type == "assistant":
assistant_client = AssistantClient.from_json(assistant_config.to_json(), self.main_window, self.main_window.connection_timeout)
else:
Expand All @@ -434,7 +435,7 @@ def on_ai_client_type_changed(self, index):
self.threadList.clear_files()

# Get the threads for the selected AI client type
threads_client = ConversationThreadClient.get_instance(self._ai_client_type)
threads_client = ConversationThreadClient.get_instance(self._ai_client_type, config_folder='config')
threads = threads_client.get_conversation_threads()
self.threadList.load_threads_with_attachments(threads)
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def initialize_variables(self):
self.conversation_thread_clients : dict[AIClientType, ConversationThreadClient] = {}
for ai_client_type in AIClientType:
try:
self.conversation_thread_clients[ai_client_type] = ConversationThreadClient.get_instance(ai_client_type)
self.conversation_thread_clients[ai_client_type] = ConversationThreadClient.get_instance(ai_client_type, config_folder='config')
except Exception as e:
self.conversation_thread_clients[ai_client_type] = None
logger.error(f"Error initializing conversation thread client for ai_client_type {ai_client_type.name}: {e}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ def _initialize_client(
self._name = self._config_data["name"]
self._ai_client_type = self._get_ai_client_type(self._config_data["ai_client_type"], async_mode)
self._ai_client : Union[OpenAI, AsyncOpenAI, AzureOpenAI, AsyncAzureOpenAI] = self._get_ai_client(self._ai_client_type, **client_args)
config_folder = None
if "config_folder" in self._config_data:
config_folder = self._config_data["config_folder"]
if async_mode:
self._callbacks = callbacks if callbacks is not None else AsyncAssistantClientCallbacks()
self._conversation_thread_client = AsyncConversationThreadClient.get_instance(self._ai_client_type, config_folder=self._config_data["config_folder"])
self._conversation_thread_client = AsyncConversationThreadClient.get_instance(self._ai_client_type, config_folder=config_folder)
else:
self._callbacks = callbacks if callbacks is not None else AssistantClientCallbacks()
self._conversation_thread_client = ConversationThreadClient.get_instance(self._ai_client_type, config_folder=self._config_data["config_folder"])
self._conversation_thread_client = ConversationThreadClient.get_instance(self._ai_client_type, config_folder=config_folder)
self._functions = {}
self._assistant_config = AssistantConfig.from_dict(self._config_data)
self._cancel_run_requested = threading.Event()
Expand Down

0 comments on commit 920fe13

Please sign in to comment.