diff --git a/gui/conversation_sidebar.py b/gui/conversation_sidebar.py index 4f8a3b7..5f8e497 100644 --- a/gui/conversation_sidebar.py +++ b/gui/conversation_sidebar.py @@ -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: @@ -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: diff --git a/gui/main_window.py b/gui/main_window.py index 2c95181..6fa692b 100644 --- a/gui/main_window.py +++ b/gui/main_window.py @@ -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}") diff --git a/sdk/azure-ai-assistant/azure/ai/assistant/management/base_assistant_client.py b/sdk/azure-ai-assistant/azure/ai/assistant/management/base_assistant_client.py index 8b4d884..a08c2f6 100644 --- a/sdk/azure-ai-assistant/azure/ai/assistant/management/base_assistant_client.py +++ b/sdk/azure-ai-assistant/azure/ai/assistant/management/base_assistant_client.py @@ -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()