Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e37b49

Browse files
[Azure] Capacity is not needed for scale types other than 'manual' (openai#103)
* [Azure] Capacity is not needed for scale types other than 'manual' * Bump version
1 parent 24fc692 commit 0e37b49

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

openai/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
organization = os.environ.get("OPENAI_ORGANIZATION")
3333
api_base = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1")
3434
api_type = os.environ.get("OPENAI_API_TYPE", "open_ai")
35-
api_version = "2021-11-01-preview" if api_type == "azure" else None
35+
api_version = "2022-03-01-preview" if api_type == "azure" else None
3636
verify_ssl_certs = True # No effect. Certificates are always verified.
3737
proxy = None
3838
app_info = None

openai/api_resources/deployment.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def create(cls, *args, **kwargs):
2929
param="scale_settings",
3030
)
3131

32-
if "scale_type" not in scale_settings or "capacity" not in scale_settings:
32+
if "scale_type" not in scale_settings or \
33+
(scale_settings["scale_type"].lower() == 'manual' and "capacity" not in scale_settings):
3334
raise InvalidRequestError(
3435
"The 'scale_settings' parameter contains invalid or incomplete values.",
3536
param="scale_settings",

openai/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.20.0"
1+
VERSION = "0.20.1"

0 commit comments

Comments
 (0)