You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
Trying the new ChatGpt provider in the beginning everything was fine, but after some time the following error appeared in response to any request:
Using ChatGpt provider and gpt-4o-mini model
ERROR:root:Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "c:\gpt4free\venv\Lib\site-packages\g4f\api\__init__.py", line 167, in chat_completions
return JSONResponse((await response).to_json())
^^^^^^^^^^^^^^
File "c:\gpt4free\venv\Lib\site-packages\g4f\client\async_client.py", line 71, in iter_append_model_and_provider
async for chunk in response:
File "c:\gpt4free\venv\Lib\site-packages\g4f\client\async_client.py", line 42, in iter_response
async for chunk in response:
File "c:\gpt4free\venv\Lib\site-packages\g4f\client\helper.py", line 46, in cast_iter_async
for chunk in iter:
File "c:\gpt4free\venv\Lib\site-packages\g4f\Provider\ChatGpt.py", line 194, in create_completion
data = json.loads(line.decode()[6:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
INFO: 127.0.0.1:57845 - "POST /v1/chat/completions?provider=ChatGpt HTTP/1.1" 500 Internal Server Error
Screenshots
curl -H "Content-Type: application/json" -H "Authorization: Bearer" -d "{\"model\":\"gpt-4o-mini\",\"messages\":[{\"role\":\"system\",\"content\":\"Say this is a test!\"},{\"role\":\"user\",\"content\":\"Hi, there!\"}],\"temperature\":0.7}" http://127.0.0.1:1337/v1/chat/completions?provider=ChatGpt
Environment
python version - 3.12
location ( are you in a cloudfare flagged country ) ? - No.
The text was updated successfully, but these errors were encountered:
Bug description
Trying the new ChatGpt provider in the beginning everything was fine, but after some time the following error appeared in response to any request:
Screenshots
curl -H "Content-Type: application/json" -H "Authorization: Bearer" -d "{\"model\":\"gpt-4o-mini\",\"messages\":[{\"role\":\"system\",\"content\":\"Say this is a test!\"},{\"role\":\"user\",\"content\":\"Hi, there!\"}],\"temperature\":0.7}" http://127.0.0.1:1337/v1/chat/completions?provider=ChatGpt
Environment
The text was updated successfully, but these errors were encountered: