ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

Is AsyncChatbot still work ?I want text replay in a stream way

Open anribras opened this issue 3 years ago • 7 comments

I found squence reply text is flushed out at same time, I sure it worked in former version:

        response = gptChatbot.get_chat_response(message['data'], output="stream")
        for i, res in enumerate(response):
            print(res['message'])

anribras avatar Dec 14 '22 06:12 anribras

I found squence reply text is flushed out at same time, I sure it worked in former version:

        response = gptChatbot.get_chat_response(message['data'], output="stream")
        for i, res in enumerate(response):
            print(res['message'])

I can work that way

jackielics avatar Dec 14 '22 06:12 jackielics

I found squence reply text is flushed out at same time, I sure it worked in former version:

        response = gptChatbot.get_chat_response(message['data'], output="stream")
        for i, res in enumerate(response):
            print(res['message'])

I can work that way

You get a stream text in this way ?

anribras avatar Dec 14 '22 07:12 anribras

Version updated so quickly....So can anyone gives a stanadard snippet demo on how to get stream text...pls

anribras avatar Dec 14 '22 07:12 anribras

https://github.com/acheong08/ChatGPT/blob/6cc7dd974a0eaffc14d23ae978d9952206b724cf/src/revChatGPT/main.py#L142-L165

acheong08 avatar Dec 14 '22 07:12 acheong08

https://github.com/acheong08/ChatGPT/blob/6cc7dd974a0eaffc14d23ae978d9952206b724cf/src/revChatGPT/main.py#L142-L165 I 'm using socketio in flask. still I got :"name 'Chatbot_ "async_func_for_check'" is not defined": should I add "async await " or some what?

gptChatbot = Chatbot(config, conversation_id=None)
socketio = SocketIO(app, logger=True, engineio_logger=True, cors_allowed_origins="*", async_mode="eventlet")


@socketio.on('ask')
def message_handler(message):
    print('received ask')
    logging.info(message['data'])
    try:
        index = 0
        response = gptChatbot.get_chat_response(message['data'], output="stream")
        for res in response:
            print(res['message'])
            emit('answer', {
                'data': res['message'],
                'index': index,
                'conversationID': res['conversation_id'],
                'parentID': res['parent_id']
            })
            index += 1
    except Exception as e:
        emit('exception', {
            'data': str(e),
            'errorCode': 1000,
        })
socketio.run(app, host='0.0.0.0', port=8001)

anribras avatar Dec 14 '22 08:12 anribras

hello, have you successfully replayed the text in streaming mode?

nowindnowave avatar Dec 14 '22 11:12 nowindnowave

yeah.but I encountered another BUG now.So, temporarily, I won't be able to replay it for now.

---Original--- From: @.> Date: Wed, Dec 14, 2022 19:48 PM To: @.>; Cc: "Jackie @.@.>; Subject: Re: [acheong08/ChatGPT] Is AsyncChatbot still work ?I want textreplay in a stream way (Issue #331)

hello, have you successfully replayed the text in streaming mode?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jackielics avatar Dec 14 '22 23:12 jackielics