Open Hertaspace opened 1 year ago
Hi, it seems the current version prints ChatGPT's message after the message finished, is there any convinient way to realtime display the response (display anything replied by ChatGPT when the whole message is not finished) ? Thanks!
just as the way the website does.
from pyChatGPT import ChatGPT
session_token = "eyxxxxxx..."
api = ChatGPT(session_token)
result = api.send_message("你好",True)
print(result["message"])
(chatgpt) D:\chatgpt>python test.py
Traceback (most recent call last):
File "D:\chatgpt\test.py", line 5, in <module>
result = api.send_message("你好",True)
File "C:\Users\iwaitu\anaconda3\envs\chatgpt\lib\site-packages\pyChatGPT\pyChatGPT.py", line 427, in send_message
for i in self.__stream_message():
File "C:\Users\iwaitu\anaconda3\envs\chatgpt\lib\site-packages\pyChatGPT\pyChatGPT.py", line 393, in __stream_message
response = self.driver.find_elements(*chatgpt_small_response)[-1]
IndexError: list index out of range
Read the readme
Hi, it seems the current version prints ChatGPT's message after the message finished, is there any convinient way to realtime display the response (display anything replied by ChatGPT when the whole message is not finished) ? Thanks!