ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

Complementing the answer with each iteration

Open Bainky opened this issue 3 years ago • 10 comments

How about making the output of the ChatGPT response "dynamic" so that the ask function can be placed in a for in loop and output the augmented ChatGPT response on each iteration. I suppose, I think this can be done through yield with sending get requests indicating message_id

Bainky avatar Dec 27 '22 10:12 Bainky

Could you give more details? I don't really understand what you're proposing.

As for streaming responses, I will need to modify the tls_client to support it

acheong08 avatar Dec 27 '22 10:12 acheong08

That's what I mean https://user-images.githubusercontent.com/61879874/209655208-ec73eb70-afd7-4b15-9974-f29de8d33233.mp4

Bainky avatar Dec 27 '22 10:12 Bainky

Ah. That was possible with the old library. I am still working to bring streaming support to tls_client. Need to port a lot of the requests library

acheong08 avatar Dec 27 '22 10:12 acheong08

Thanks for your work, I'll be waiting

Bainky avatar Dec 27 '22 10:12 Bainky

Spawning browser... Traceback (most recent call last): File "/data/chatgpt/bin/revChatGPT/ChatGPT.py", line 404, in get_cf_cookies browser_executable_path=self.config.get("browser_exec_path") File "/usr/local/lib/python3.6/site-packages/undetected_chromedriver/init.py", line 51, in new instance.init(*args, **kwargs) TypeError: init() got an unexpected keyword argument 'enable_cdp_events'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "chatgpt_app.py", line 10, in chatbot = Chatbot(config, conversation_id=None) File "/data/chatgpt/bin/revChatGPT/ChatGPT.py", line 77, in init self.get_cf_cookies() File "/data/chatgpt/bin/revChatGPT/ChatGPT.py", line 416, in get_cf_cookies driver.quit() UnboundLocalError: local variable 'driver' referenced before assignment run error ...

Liu-Angelo avatar Dec 28 '22 12:12 Liu-Angelo

@Liu-Angelo Open a new issue.

acheong08 avatar Dec 28 '22 12:12 acheong08

The streaming-mode in the old library is very useful ! And I look forward to the mode in this library~

luckcul avatar Dec 31 '22 03:12 luckcul

Might not be possible. Too much work to rewrite the requests library in a different language

acheong08 avatar Jan 08 '23 04:01 acheong08

This would be really interesting. Did you consider using fastAPI instead of flask? It has built in HTTP streaming support

alramalho avatar Jan 13 '23 09:01 alramalho

It won't work either way because the base library (tls_client) doesn't support streaming

acheong08 avatar Jan 13 '23 09:01 acheong08