From 8f3fbee0d8a4ca69af72dae989ae8954181d0108 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Tue, 19 Nov 2024 15:26:03 +0100 Subject: Add show log option to gui --- g4f/Provider/Copilot.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'g4f/Provider/Copilot.py') diff --git a/g4f/Provider/Copilot.py b/g4f/Provider/Copilot.py index 6e64c714..c79f028d 100644 --- a/g4f/Provider/Copilot.py +++ b/g4f/Provider/Copilot.py @@ -93,13 +93,11 @@ class Copilot(AbstractProvider): if return_conversation: yield Conversation(conversation_id, session.cookies.jar, access_token) prompt = format_prompt(messages) - if debug.logging: - print(f"Copilot: Created conversation: {conversation_id}") + debug.log(f"Copilot: Created conversation: {conversation_id}") else: conversation_id = conversation.conversation_id prompt = messages[-1]["content"] - if debug.logging: - print(f"Copilot: Use conversation: {conversation_id}") + debug.log(f"Copilot: Use conversation: {conversation_id}") images = [] if image is not None: @@ -143,8 +141,7 @@ class Copilot(AbstractProvider): if not has_nodriver: raise MissingRequirementsError('Install "nodriver" package | pip install -U nodriver') user_data_dir = user_config_dir("g4f-nodriver") if has_platformdirs else None - if debug.logging: - print(f"Copilot: Open nodriver with user_dir: {user_data_dir}") + debug.log(f"Copilot: Open nodriver with user_dir: {user_data_dir}") browser = await nodriver.start( user_data_dir=user_data_dir, browser_args=None if proxy is None else [f"--proxy-server={proxy}"], -- cgit v1.2.3