Closed 3mora2 closed 7 months ago
can u post the code to call "chat.continue_chat"
same in __main__.py
from ChatGPTWeb.ChatGPTWeb import chatgpt
from ChatGPTWeb.config import Personality, MsgData
import asyncio
import aioconsole
session_token = [ "" ]
personality_definition = Personality(
[
{
"name": "Programmer",
'value': 'You are python Programmer'
},
])
chat = chatgpt(session_token=session_token, headless=False, begin_sleep_time=False)
# ,log_status=False
async def main():
c_id = await aioconsole.ainput("your conversation_id if you have:")
p_id = await aioconsole.ainput("your parent_message_id if you have:")
data: MsgData = MsgData(conversation_id=c_id, p_msg_id=p_id)
while 1:
print("\n------------------------------")
data.msg_send = await aioconsole.ainput("input:")
print("------------------------------\n")
if data.msg_send == "quit":
break
elif data.msg_send == "re":
data.msg_type = "back_loop"
data.p_msg_id = await aioconsole.ainput("your parent_message_id if you go back:")
elif data.msg_send == "reset":
data = await chat.back_init_personality(data)
print(f"ChatGPT:{data.msg_recv}")
continue
elif data.msg_send == "init_personality":
data.msg_send = "your ..."
data = await chat.init_personality(data)
print(f"ChatGPT:{data.msg_recv}")
continue
elif data.msg_send == "history":
print(await chat.show_chat_history(data))
continue
elif data.msg_send == "status":
print(await chat.token_status())
continue
data = await chat.continue_chat(data)
print(f"ChatGPT:{data.msg_recv}")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Did you enter a non-existent conversation_id during startup?
When starting, it will first prompt "your conversation_id if you have:". If not, just press the enter key. The second prompt "your parent_message_id if you have:" will do the same until it prompts "input:".
But sometimes the log will affect the vision.
The incorrect conversation_id problem will be fixed in the near future. Some new parameter descriptions will also be added.
now it work fine, thinks