Python API supposed to take timeout parameter for API calls. But it appears the timeout parameter is not honored. Possible a bug?
Signature: openai.Completion.create(*args, timeout=None, **kwargs)
Docstring:
Create a new instance of this model.
Parameters:
timeout (float): the number of seconds to wait on the promise returned by the API, where 0 means wait forever.
File: /opt/anaconda3/lib/python3.7/site-packages/openai/api_resources/completion.py
Type: method
Unless it’s a hidden parameter, there is no timeout. It wouldn’t even make sense.
If a server cannot handle your request, how can it know to time you out?
Also, you are trying to use a model which is purposed for typing code. You either want Davinci, or GPTx in ChatCompletions
Use your own library to manage timeouts. retry · PyPI
Although I would still recommend using a client timeout and not relying on the server. It’s a very simple module to use and will be much more robust. Using hidden parameters is not recommended.
Looking a bit further, it could be possible to use the timeout currently - although again, it’s not really a good idea to use hidden parameters. There’s one other issue: You’re using Codex.