nek0us / ChatGPT

a ChatGPT api,no web ui
GNU General Public License v3.0
11 stars 3 forks source link

[BUG] Repeat Query #11

Open verazuo opened 1 week ago

verazuo commented 1 week ago

Hi, when following the ReadMe, I face the following bugs:

ChatGPT basically only repeats the question once, and then the session does not work any longer. Any idea how to fix it?

your conversation_id if you have:
your parent_message_id if you have:
------------------------------
input:tell me a story
------------------------------
2024/06/20 16:41:28 ChatGPTWeb.py INFO receive message: tell me a story
ChatGPT:tell me a story
------------------------------
input:tell me a story
------------------------------
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x105dfb190>
2024/06/20 16:41:41 api.py WARNING recive_handle error:msg_data.recv == None,This content may violate openai's content policy,error:
2024/06/20 16:41:41 ChatGPTWeb.py WARNING send message error:recive_handle error:msg_data.recv == None
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x105e87850>
2024/06/20 16:41:46 api.py WARNING recive_handle error:msg_data.recv == None,This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2

2024/06/20 16:41:46 ChatGPTWeb.py WARNING send message error:recive_handle error:msg_data.recv == None
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x105e745d0>
2024/06/20 16:41:50 api.py WARNING recive_handle error:msg_data.recv == None,This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2

send message error: recive_handle error:msg_data.recv == None ,retry: 1

2024/06/20 16:41:50 ChatGPTWeb.py WARNING send message error:recive_handle error:msg_data.recv == None
2024/06/20 16:41:50 ChatGPTWeb.py INFO receive message: 
error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2

send message error: recive_handle error:msg_data.recv == None ,retry: 1
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openinput:

BTW, I use openai auth

    {
        "email": "xxx@gmail.com",
        "password": "xxx",
        "mode":"openai" ,
        "session_token": session_token,
    },

And I also check the web interface, it look likes following:

image

Many thanks!

nek0us commented 1 week ago

You can set logger_level='DEBUG' first, then export the log

verazuo commented 1 week ago

Thanks for this prompt response! Here is the debug log.

your conversation_id if you have:
your parent_message_id if you have:
------------------------------
input:2024/06/20 16:53:25 ChatGPTWeb.py DEBUG Firefox browser is already installed.
te2024/06/20 16:53:26 ChatGPTWeb.py DEBUG xxxxx@gmail.com begin login when it start
2024/06/20 16:53:27 api.py DEBUG flush xxxxx@gmail.com cf cookie OK!
^R
tell me a story
------------------------------
2024/06/20 16:53:42 ChatGPTWeb.py DEBUG context xxxxx@gmail.com start!
2024/06/20 16:53:42 ChatGPTWeb.py DEBUG start!
2024/06/20 16:53:43 ChatGPTWeb.py DEBUG session xxxxx@gmail.com begin work
2024/06/20 16:53:43 ChatGPTWeb.py DEBUG send:tell me a story
2024/06/20 16:53:46 ChatGPTWeb.py INFO receive message: tell me a story
2024/06/20 16:53:46 ChatGPTWeb.py DEBUG session xxxxx@gmail.com finish work
ChatGPT:tell me a story
------------------------------
input:

I don't see any errors, to be honest, and that is why I am a bit confused.

nek0us commented 1 week ago

Are you using the code from github or pypi?

verazuo commented 1 week ago

Github.

git submodule add https://github.com/nek0us/ChatGPT.git
cd ChatGPT
pip install -e .
verazuo commented 1 week ago

I just tried to install it via pip and I meet the same bug.

your conversation_id if you have:
your parent_message_id if you have:
------------------------------
input:t2024/06/20 17:13:30 ChatGPTWeb.py DEBUG Firefox browser is already installed.
ell me 2024/06/20 17:13:31 ChatGPTWeb.py DEBUG xxxxx@gmail.com begin login when it start

------------------------------
2024/06/20 17:13:32 api.py DEBUG flush xxxxx@gmail.com cf cookie OK!
2024/06/20 17:13:47 ChatGPTWeb.py DEBUG context xxxxx@gmail.com start!
2024/06/20 17:13:47 ChatGPTWeb.py DEBUG start!
2024/06/20 17:13:48 ChatGPTWeb.py DEBUG session xxxxx@gmail.com begin work
2024/06/20 17:13:48 ChatGPTWeb.py DEBUG send:tell me 
2024/06/20 17:13:52 ChatGPTWeb.py INFO receive message: tell me 
2024/06/20 17:13:52 ChatGPTWeb.py DEBUG session xxxxx@gmail.com finish work
ChatGPT:tell me 
------------------------------
input:why
------------------------------
2024/06/20 17:13:59 ChatGPTWeb.py DEBUG session xxxxx@gmail.com begin work
2024/06/20 17:13:59 ChatGPTWeb.py DEBUG send:why
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x103f32450>
2024/06/20 17:14:02 api.py WARNING recive_handle error:msg_data.recv == None,This content may violate openai's content policy,error:
2024/06/20 17:14:02 ChatGPTWeb.py WARNING send message error:recive_handle error:msg_data.recv == None
2024/06/20 17:14:02 ChatGPTWeb.py DEBUG resend 2
2024/06/20 17:14:02 ChatGPTWeb.py DEBUG send:why
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x108140810>
2024/06/20 17:14:05 api.py DEBUG flush xxxxx@gmail.com cf cookie OK!
2024/06/20 17:14:06 ChatGPTWeb.py DEBUG flush over,wait next...
2024/06/20 17:14:06 api.py WARNING recive_handle error:msg_data.recv == None,This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2

2024/06/20 17:14:06 ChatGPTWeb.py WARNING send message error:recive_handle error:msg_data.recv == None
2024/06/20 17:14:06 ChatGPTWeb.py DEBUG resend 1
2024/06/20 17:14:07 ChatGPTWeb.py DEBUG send:why
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x10817b710>
2024/06/20 17:14:10 api.py WARNING recive_handle error:msg_data.recv == None,This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2

send message error: recive_handle error:msg_data.recv == None ,retry: 1

2024/06/20 17:14:10 ChatGPTWeb.py WARNING send message error:recive_handle error:msg_data.recv == None
2024/06/20 17:14:10 ChatGPTWeb.py DEBUG resend 0
2024/06/20 17:14:11 ChatGPTWeb.py INFO receive message: 
2024/06/20 17:14:11 ChatGPTWeb.py DEBUG session xxxxx@gmail.com finish work
error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2

send message error: recive_handle error:msg_data.recv == None ,retry: 1
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:
send message error: recive_handle error:msg_data.recv == None ,retry: 2
recive_handle error:msg_data.recv == None, This content may violate openai's content policy,error:recive_handle error:msg_data.recv == None, This cinput:
nek0us commented 1 week ago

Sorry, I can't reproduce this bug at the moment. I'll need some time to investigate

verazuo commented 1 week ago

Np! So you can directly run the code successfully, right? Could you please tell me which auth method you are using? I can test whether there is a problem with my auth.

nek0us commented 1 week ago

The github code can be used directly, if you use the pypi code, you need to set httpx_status=False. I used an openai account, a Microsoft account, and a google account, but they all work normally. 图片 图片