-1

Code:

response = openai.ChatCompletion.create(
        timeout=10,
        deployment_id=deployment_name,
        model="gpt-3.5-turbo",  # The name of the OpenAI chatbot model to use
        messages=message_log,  # The conversation history up to this point, as a list of dictionaries
        max_tokens=512,  # The maximum number of tokens (words or subwords) in the generated response
        stop=None,  # The stopping sequence for the generated response, if any (not used here)
        temperature=0.1,  # The "creativity" of the generated response (higher temperature = more creative)
    )

When I execute this code then its going on long hold and maybe after 5 to 10 minutes I have to wait to get the exception even after using timeout parameter.

Even I have tried @retry(stop=stop_after_delay(10)) still It goes to hold.

The Error is:

Error in openai :  Error communicating with OpenAI: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Note : I'm using Azure OPENAI service and I have also check the ongoing issues related to this error: Openai Community Discussion

krisskad
  • 131
  • 9

0 Answers0