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