ChatGPT
ChatGPT copied to clipboard
[Bug]: Chatbot.ask() and AsyncChatbot.ask() cannot specify already existing conversation
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.
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
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.
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
same problem
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
i mean, that
except Exception as e: print(str(e.args))
prints ('',), sometimes normal messages
Limited by OpenAI up to 50. I can't fix
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.
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.