Commit 0e37b492

Sorin Suciu <sorin.suciu@microsoft.com>
2022-06-21 22:12:10
[Azure] Capacity is not needed for scale types other than 'manual' (#103)
* [Azure] Capacity is not needed for scale types other than 'manual' * Bump version
1 parent 24fc692
Changed files (3)
openai/api_resources/deployment.py
@@ -29,7 +29,8 @@ class Deployment(CreateableAPIResource, ListableAPIResource, DeletableAPIResourc
                 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",
openai/__init__.py
@@ -32,7 +32,7 @@ api_key_path: Optional[str] = os.environ.get("OPENAI_API_KEY_PATH")
 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
openai/version.py
@@ -1,1 +1,1 @@
-VERSION = "0.20.0"
+VERSION = "0.20.1"