From e8ce7526f10ff1e27c4fc32e85e027243a732724 Mon Sep 17 00:00:00 2001 From: Sorin Suciu Date: Mon, 20 Jun 2022 15:21:27 +0200 Subject: [PATCH 1/2] [Azure] Capacity is not needed for scale types other than 'manual' --- openai/__init__.py | 2 +- openai/api_resources/deployment.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openai/__init__.py b/openai/__init__.py index 48215352b7..0af34274da 100644 --- a/openai/__init__.py +++ b/openai/__init__.py @@ -32,7 +32,7 @@ organization = os.environ.get("OPENAI_ORGANIZATION") api_base = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1") api_type = os.environ.get("OPENAI_API_TYPE", "open_ai") -api_version = "2021-11-01-preview" if api_type == "azure" else None +api_version = "2022-03-01-preview" if api_type == "azure" else None verify_ssl_certs = True # No effect. Certificates are always verified. proxy = None app_info = None diff --git a/openai/api_resources/deployment.py b/openai/api_resources/deployment.py index 7d6c3b5cd7..e3b9b78bc3 100644 --- a/openai/api_resources/deployment.py +++ b/openai/api_resources/deployment.py @@ -29,7 +29,8 @@ def create(cls, *args, **kwargs): param="scale_settings", ) - if "scale_type" not in scale_settings or "capacity" not in scale_settings: + if "scale_type" not in scale_settings or \ + (scale_settings["scale_type"].lower() == 'manual' and "capacity" not in scale_settings): raise InvalidRequestError( "The 'scale_settings' parameter contains invalid or incomplete values.", param="scale_settings", From 6ffafe6c6d8089bc6ead442edaaa749b07f35bef Mon Sep 17 00:00:00 2001 From: Sorin Suciu Date: Mon, 20 Jun 2022 15:22:14 +0200 Subject: [PATCH 2/2] Bump version --- openai/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openai/version.py b/openai/version.py index 62c0a105e2..9565641640 100644 --- a/openai/version.py +++ b/openai/version.py @@ -1 +1 @@ -VERSION = "0.20.0" +VERSION = "0.20.1"