gpt4free
gpt4free copied to clipboard
Error GPT 3.5 turbo Response 401: {"detail":"Unauthorized"}
I added it yesterday .HAR File to the folder ./harder, the model is working, today the error Response 401: {"detail":"Unauthorized"} What to do? Do I need to add a file every time? Is it possible to do as before and not use this file?
You could install and use nodriver. It performs the same function as the previous webdriver.
Could you please tell me how to do this or provide a link to the tutorial?
The installation of Nodriver can be achieved through the following command:
pip install -U nodriver
No further configuration is required.
Please, could you elaborate how to use nodriver to make WebUI start working instead of bringing up:
Using OpenaiChat provider and gpt-3.5-turbo model
ERROR:root:Response 401: {"detail":"Could not parse your authentication token. Please try signing in again."}
Traceback (most recent call last):
File "c:\gpt4free\venv\Lib\site-packages\g4f\gui\server\api.py", line 125, in _create_response_stream
for chunk in ChatCompletion.create(**kwargs):
File "c:\gpt4free\venv\Lib\site-packages\g4f\providers\base_provider.py", line 208, in create_completion
yield loop.run_until_complete(await_callback(gen.__anext__))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "c:\gpt4free\venv\Lib\site-packages\g4f\providers\base_provider.py", line 40, in await_callback
return await callback()
^^^^^^^^^^^^^^^^
File "c:\gpt4free\venv\Lib\site-packages\g4f\Provider\needs_auth\OpenaiChat.py", line 381, in create_async_generator
await raise_for_status(response)
File "c:\gpt4free\venv\Lib\site-packages\g4f\requests\raise_for_status.py", line 28, in raise_for_status_async
raise ResponseStatusError(f"Response {response.status}: {message}")
g4f.errors.ResponseStatusError: Response 401: {"detail":"Could not parse your authentication token. Please try signing in again."}
127.0.0.1 - - [10/Apr/2024 15:03:45] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [10/Apr/2024 15:03:45] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
Thanks, I'll try!
Could you reflect this point somewhere in the tutorials, at least where we are talking about the .har file? Thank you in advance
PS. Forgot to mention that even with nodriver installed, the aforementioned error still occurs.
I have resolved the authentication token parsing issue in the GUI.
Nodriver should now automatically open a browser window.
Now (0.2.9.3 version) it starts work fine with the presence of the har file, but without it only arises the following error:
Using OpenaiChat provider and gpt-3.5-turbo model
127.0.0.1 - - [10/Apr/2024 18:24:50] "GET /static/img/user.png HTTP/1.1" 200 -
ERROR:root:
Traceback (most recent call last):
File "c:\gpt4free\venv\Lib\site-packages\g4f\gui\server\api.py", line 125, in _create_response_stream
for chunk in ChatCompletion.create(**kwargs):
File "c:\gpt4free\venv\Lib\site-packages\g4f\providers\base_provider.py", line 211, in create_completion
yield loop.run_until_complete(await_callback(gen.__anext__))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "c:\gpt4free\venv\Lib\site-packages\g4f\providers\base_provider.py", line 40, in await_callback
return await callback()
^^^^^^^^^^^^^^^^
File "c:\gpt4free\venv\Lib\site-packages\g4f\Provider\needs_auth\OpenaiChat.py", line 371, in create_async_generator
await cls.nodriver_access_token()
File "c:\gpt4free\venv\Lib\site-packages\g4f\Provider\needs_auth\OpenaiChat.py", line 584, in nodriver_access_token
browser = await uc.start(user_data_dir=user_data_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\gpt4free\venv\Lib\site-packages\nodriver\core\util.py", line 74, in start
return await Browser.create(config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\gpt4free\venv\Lib\site-packages\nodriver\core\browser.py", line 87, in create
await instance.start()
File "c:\gpt4free\venv\Lib\site-packages\nodriver\core\browser.py", line 312, in start
await asyncio.create_subprocess_exec(
File "C:\Python312\Lib\asyncio\subprocess.py", line 222, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 1708, in subprocess_exec
transport = await self._make_subprocess_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 502, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
127.0.0.1 - - [10/Apr/2024 18:24:51] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [10/Apr/2024 18:24:51] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
Error after installation pip install -U nodriver: list index out of range
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
Do you still have this error?
yes(
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
The validity period of an OpenAI Chat .har file is limited to one day.
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
Closing due to inactivity.