-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta
Description
Describe the bug
When I use request_timeout on a text completion, it works fine:
openai.Completion.create(prompt="1,2,3,4,", request_timeout=10.0)
But when I try to do it with an image creation, it fails:
openai.Image.create(prompt="beautiful sunset", request_timeout=10.0)
==> openai.error.InvalidRequestError: Additional properties are not allowed ('request_timeout' was unexpected)
I'm not familiar enough with the code base to know how this ought to work, but I can get it to work with an ugly hack like (starting at line 36 of openai/api_resouces/image.py):
response, _, api_key = requestor.request(
"post", cls._get_url("generations"), params
)
becomes:
request_timeout = params.pop("request_timeout", None)
response, _, api_key = requestor.request(
"post", cls._get_url("generations"), params, request_timeout=request_timeout
)
To Reproduce
import openai
openai.api_key = ...
openai.Image.create(prompt="beautiful sunset", request_timeout=10.0)
Code snippets
No response
OS
macOS
Python version
Python 3.11.1
Library version
openai-python v0.26.5 (and others)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta