bupticybee / ChineseAiDungeonChatGPT

中文版的ai地牢,直接使用的openai的ChatGPT api作为讲故事的模型。
1.39k stars 142 forks source link

AttributeError: 'Chatbot' object has no attribute 'get_chat_response' #41

Closed eifan closed 1 year ago

eifan commented 1 year ago

Traceback (most recent call last): File "D:\myself\ChineseAiDungeonChatGPT\example_story.py", line 11, in story_teller.interactive() File "D:\myself\ChineseAiDungeonChatGPT\story.py", line 75, in interactive self.action(action) File "D:\myself\ChineseAiDungeonChatGPT\story.py", line 68, in action resp = self.chatbot.get_chat_response(prompt) # Sends a request to the API and returns the response by OpenAI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Chatbot' object has no attribute 'get_chat_response'

revChatGPT VER revChatGPT-2.2.7 报这个错误,是不是程序改动会比较大啊?

eifan commented 1 year ago

问题解决,经过尝试,将story.py中68行调整为:

    # resp = self.chatbot.get_chat_response(prompt)  # Sends a request to the API and returns the response by OpenAI
    #self.response = resp["message"]
    for data in self.chatbot.ask(
        prompt
    ):
        self.response = data["message"]
eifan commented 1 year ago

另一个问题,就是所有句子都要以中文”。“结尾,否则报各种奇怪的错误。

eifan commented 1 year ago

revChatGPT有一个明显的缺陷,每次回复之后都会打开一个新的new chat,这样上下文信息就丢失了,导致故事变的不知所谓。

bupticybee commented 1 year ago

我现在没有跟进revChatGPT的api变化,导致目前的结果,原因也比较简单,现在的open AI对于这种逆向api的观点还是比较负面,不会有官方支持。

而这个项目的目的也不是持续跟进api,做成一个持续可用的app,而是展示一种可能性,一种通过这种大语言模型进行文字冒险游戏的可能性。

所以我后续并不会在适配接口上再花很多功夫,可能得自己看下。