gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

Why all of a sudden using g4f and getting the GPT with the corresponding empty string?

Open lotusnowshen opened this issue 1 year ago • 5 comments

def request_chatgpt(content):
    response = g4f.ChatCompletion.create(
        model=g4f.models.gpt_35_turbo,
        messages=[{"role": "user", "content": content}],
        provider=OpenaiChat,
        auth=cookie,
    )  # Alternative model setting
    print('ChatGPT响应: ', response)
    return response

I've been using g4f and it's working fine, however, just now I realized that I'm getting responses that are all empty, but it's fine to post a dialog to GPT on the web.

Is the openai server detecting this client.

I upgraded to the latest version (2.0.9) and still no result.

image

lotusnowshen avatar Feb 02 '24 05:02 lotusnowshen

Traceback (most recent call last):
  File "/app/g4f/gui/server/backend.py", line 185, in _create_response_stream
    for chunk in ChatCompletion.create(**kwargs):
  File "/app/g4f/Provider/base_provider.py", line 201, in create_completion
    yield loop.run_until_complete(gen.__anext__())
  File "/home/g4f/.local/lib/python3.10/site-packages/nest_asyncio.py", line 98, in run_until_complete
    return f.result()
  File "/usr/lib/python3.10/asyncio/futures.py", line 201, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 232, in __step
    result = coro.send(None)
  File "/app/g4f/Provider/needs_auth/OpenaiChat.py", line 378, in create_async_generator
    raise RuntimeError(f"Response {response.status_code}: {await response.text()}")
RuntimeError: Response 400: {"detail":{"message":"Requests with `action=continue` must have a conversation_id and parent_message_id.","code":"continue_with_messages"}}

I ran the client with docker and then saw this error log in the terminal.

lotusnowshen avatar Feb 02 '24 15:02 lotusnowshen

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Feb 14 '24 00:02 github-actions[bot]

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Feb 23 '24 00:02 github-actions[bot]

How did you called OpenaiChat. Did you set a api_key?

hlohaus avatar Feb 25 '24 10:02 hlohaus

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Mar 17 '24 00:03 github-actions[bot]

Closing due to inactivity.

github-actions[bot] avatar Apr 22 '24 00:04 github-actions[bot]