Closed
Description
Describe the bug
When making a call to the ChatCompletion create method, e.g.:
response = openai.ChatCompletion.create(
model=self.model_id,
messages=self.get_formatted_messages(),
timeout=10
)
The timeout is pop
d off of the kwargs by this line in the completion class (link):
timeout = kwargs.pop("timeout", None)
The pop
method removes the arg from kwargs
before it's passed to super
, which means that the timeout
doesn't have the intended effect (the local method there does do some stuff with it, but that would only allow you to increase the timeout).
To Reproduce
Run an API call with a shorter timeout:
response = openai.ChatCompletion.create(
model=self.model_id,
messages=self.get_formatted_messages(),
timeout=10
)
And observe that said timeout is not respected. The timeout remains 600 seconds.
Code snippets
No response
OS
macOS
Python version
3.10.9
Library version
openai==0.27.2