Describe the bug
Sometimes chatgpt don't give an answer to the question. When it happens, response, which is 114 line in revChatGPT.pyresponse = s.post( "https://chat.openai.com/backend-api/conversation", data=json.dumps(data), ), will be like
{'message': {......, 'content': {'content_type': 'text', 'parts': []}, ......}, ......}.
Note that the parts value is an empty list. This causes an IndexError exception to be raised when the code tries to access the first element of the list on line 140:
To Reproduce
Steps to reproduce the behavior:
Here is an example prompt that can be used to reproduce the behavior:
请你学习一下下面的说法方式和语气,并用这样的语气和我对话,而不是机械性地重复文本,尽可能不要重复一样的话语,文本为(“洒家是经略府提辖,姓鲁,讳个达字。“,“洒家始投老种经略 相公,做到关西五路廉访使,也不枉了叫做镇关西。你是个卖肉的操刀屠户,狗一般的人,也叫做镇关西!你如何强骗了金翠莲?“,“你 诈死,洒家和你慢慢理会。“,“洒家在林子里听你多时。“,“你这两个撮鸟!洒家不看兄弟面时,把你这两个都剁做肉酱。且看兄弟面皮,饶你两个性命。“,“你两个撮鸟!本是路上砍了你两个头,兄弟面上,饶你两个鸟命。如今没多路了,休生歹心。“,“你两个撮鸟的头,硬似这松树么?“,“一言难尽。洒家在大相国寺管菜园,遇着那豹子头林冲被高太尉要陷害他性命。俺却路见不平,直送他到沧州,救了他一命。这日娘贼恨杀洒家,分付寺里长老不许俺挂搭,又差人来捉洒家。却得一伙泼皮通报,不是着了那厮的手。吃俺一把火烧了那菜园里廨宇,逃走在江湖上。东又不着,西又不着。来到孟州十字坡过,险些儿被个酒店里妇人害了性命,把洒家着蒙汗药麻翻了。得他的丈夫归来的早,见了洒家这般模样,又看了俺的禅杖、戒刀吃惊,连忙把解药救俺醒来。因问起洒家名字,留住俺过了数日,结义洒家做了弟兄。那人夫妻两个,亦是江湖上好汉有名的,都叫他做菜园子张青,其妻母夜叉孙二娘,甚是好义气。住了四五日,打听的这里二龙山宝珠寺可以安身,洒家特地来奔他邓龙入伙,叵耐那厮不肯安着洒家在这山上。邓龙那厮和俺厮并,又敌洒家不过,只把这山下三座关牢牢地拴住,又没个道路上去。打紧这座山生的险峻,又没别路上去,那撮鸟由你叫骂,只是不下来厮杀,气得洒家正苦,在这里没个委结。不想却是大哥来。“)
On the web page, the following image is displayed:
In the console , the following image is displayed:
Expected behavior
I think it would be better to raise and reset the exception, with an error message like "empty answer". The current exception is confusing.
Describe the bug Sometimes chatgpt don't give an answer to the question. When it happens, response, which is 114 line in revChatGPT.py
response = s.post( "https://chat.openai.com/backend-api/conversation", data=json.dumps(data), )
, will be like{'message': {......, 'content': {'content_type': 'text', 'parts': []}, ......}, ......}
. Note that the parts value is an empty list. This causes an IndexError exception to be raised when the code tries to access the first element of the list on line 140:To Reproduce Steps to reproduce the behavior:
Expected behavior I think it would be better to raise and reset the exception, with an error message like "empty answer". The current exception is confusing.
Please forgive my poor English.