acheong08 / ChatGPT

Reverse engineered ChatGPT API
GNU General Public License v2.0
28.01k stars 4.48k forks source link

[Bug]: V1 stream broken? #1401

Closed ghost closed 1 year ago

ghost commented 1 year ago

Is there an existing issue for this?

What happened?

https://github.com/acheong08/ChatGPT#basic-example-streamed Used this example code. Worked in 5.2.0. In 6.0.0 it stucked until the server finished responding.

from revChatGPT.V1 import Chatbot
chatbot = Chatbot(config={
  "access_token": "<your access_token>"
})
print("Chatbot: ")
prev_text = ""
for data in chatbot.ask(
    "Repeat A as many times as you can",
):
    message = data["message"][len(prev_text) :]
    print(message, end="", flush=True)
    prev_text = data["message"]
print()

Steps to reproduce the problem

https://github.com/acheong08/ChatGPT#basic-example-streamed Use this example code. Ask "Repeat A as many times as you can".

What should have happened?

stream works.

Version where the problem happens

Name: revChatGPT Version: 6.0.0 Summary: ChatGPT is a reverse engineering of OpenAI's ChatGPT API Home-page: https://github.com/acheong08/ChatGPT Author: Antonio Cheong Author-email: acheong@student.dalat.org License: GNU General Public License v2.0 Location: C:\Users\Void\scoop\apps\python\current\Lib\site-packages Requires: async-tio, curl-cffi, httpx, openai, OpenAIAuth, prompt-toolkit, requests, tiktoken Required-by:

What Python version are you running this with?

Python 3.11.3

What is your operating system ?

Windows

Command Line Arguments

No

Console logs

Using chat.openai.com backend

Additional information

No response

acheong08 commented 1 year ago

Yes. I just noticed because the speed was so fast. I'll look into this. In the meantime, just downgrade

acheong08 commented 1 year ago

CC

acheong08 commented 1 year ago

Current workaround uses chunks that are written to a file. The chunk size might not be optimal

acheong08 commented 1 year ago

Closing for now. Fixed on latest release.

Will open another issue for proper tls spoofing + stream