ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[Bug]: Chatbot.ask() and AsyncChatbot.ask() cannot specify already existing conversation

Open discordine opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

I tried to specify the already existing conversation to ask ChatGPT, but they don't work with different errors.

image image

Steps to reproduce the problem

Simply copy&paste the examples, then add conversation_id argument for chatbot.ask()

What should have happened?

It should've select and resume the existing conversation

Version where the problem happens

2.3.13

What Python version are you running this with?

3.7

What is your operating system ?

No response

Command Line Arguments

no

Console logs

see the attached pics

Additional information

Both works fine with no conversation_id arguments. It happens only when I add it.

discordine avatar Feb 26 '23 06:02 discordine

I have also encountered such a situation when the number of sessions exceeds 50. It should be that there is a problem with the __map_conversations of v1.py. It only limits 20 conversations, and if it exceeds, it will not be available.

https://github.com/acheong08/ChatGPT/blob/0d83a603452beb9156879881a0345a691e79299b/src/revChatGPT/V1.py#L520

vip68 avatar Feb 26 '23 12:02 vip68

same problem

zentixua avatar Feb 27 '23 10:02 zentixua

I updated to the latest version from github and the problem is gone. But another one appeared - if we add a conversation_id, then sometimes errors will not be parsed. I don't know why but it is

My code:

async def handle_response(message, conv_id) -> str:
    print(conv_id)
    chatbot = AsyncChatbot(conversation_id=conv_id, config={
        "access_token": "-----"})
    print(conv_id)
    async for response in chatbot.ask(prompt=message, conversation_id=conv_id):
        responseMessage = response["message"]

    return responseMessage

i call this code from other classes

zentixua avatar Feb 27 '23 13:02 zentixua

i mean, that

except Exception as e: print(str(e.args))

prints ('',), sometimes normal messages

zentixua avatar Feb 27 '23 13:02 zentixua

Limited by OpenAI up to 50. I can't fix

acheong08 avatar Feb 28 '23 05:02 acheong08

How can we use this repo to develop a multi-session backend API? For example, we have many clients talking with ChatGPT and each client should have his own session. Currently, all clients' conversations are in one session, which is unsecure and inefficient.

yaohaizhou avatar Feb 28 '23 05:02 yaohaizhou

There needs to be a bit of a restructuring to fit this purpose. This code base is a bit old and requires a small rewrite soon. I will support these once I have the time.

acheong08 avatar Feb 28 '23 06:02 acheong08