Describe the bug
openai.ChatCompletion.create takes timeout parameter but the call might take significantly longer without timing out.
I think it is because of this code:
timeout = kwargs.pop("timeout", None)
while True:
try:
return super().create(*args, **kwargs)
Wouldn't it be more consistent overall if you replace pop with get, like this:
timeout = kwargs.get("timeout", None)
To Reproduce
run
openai.ChatCompletion.create(timeout=1, the rest of parameters...)
expected the call either complete under 1 second or fail.
actual: it can take more than 1 second.
Code snippets
No response
OS
Windows 11
Python version
Python 3.9.13
Library version
openai 0.27.8