From 8890f69096fba3cafc1a708944ca90fa6cfcf7e4 Mon Sep 17 00:00:00 2001 From: Sergey Date: Wed, 11 Jun 2025 18:25:39 +0300 Subject: [PATCH] Update hugchat.py fix login and answer --- src/hugchat/hugchat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hugchat/hugchat.py b/src/hugchat/hugchat.py index 77f257e..64e77d8 100644 --- a/src/hugchat/hugchat.py +++ b/src/hugchat/hugchat.py @@ -414,7 +414,7 @@ def get_remote_llms(self) -> list: try: - models_data_list = json.loads(r.text) + models_data_list = json.loads(r.text)['json'] except json.JSONDecodeError as e: logging.error(f"Error decoding JSON: {e}") models_data_list = [] @@ -541,7 +541,7 @@ def get_conversation_info(self, conversation: Union[Conversation, str] = None) - # you'll never understand the following codes until you try to debug huggingchat in person. try: - data = r.json() + data = r.json()['json'] except json.JSONDecodeError as e: logging.error(f"Failed to decode JSON: {e}") return None