acheong08 / Bard

Python SDK/API for reverse engineered Google Bard
MIT License
1.42k stars 177 forks source link

Chatbot cannot be imported after update #45

Closed PhoenixPhyre closed 1 year ago

PhoenixPhyre commented 1 year ago

Hi, I updated from Pypi this morning, and now I am getting this error as soon as I call

from Bard import Chatbot

the error that I get is

line 119, in Chatbot def load_conversations(self, file_path: str) -> list[dict]: TypeError: 'type' object is not subscriptable

Any help greatly appreciated...

PhoenixPhyre commented 1 year ago

I made the following adjustments, and the loading and importing work fine now... since I only intend to use this for one off questions, I think it should work now, but ultimately I would like to know a better way if possible.

This was the original line 119 in Bard.py, effective this mornings update...

   def load_conversations(self, file_path: str):
        print('Load_Conversations was just called with '+ file_path)
        return []
    # def load_conversations(self, file_path: str) -> list[dict]:
    #     # Check if file exists
    #     if not os.path.isfile(file_path):
    #         return []
    #     with open(file_path, encoding="utf-8") as f:
    #         return json.load(f)
acheong08 commented 1 year ago

Duplicate of #43 and already fixed