Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions openai/api_resources/abstract/engine_api_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ def class_url(
if typed_api_type in (ApiType.AZURE, ApiType.AZURE_AD):
if not api_version:
raise error.InvalidRequestError(
"An API version is required for the Azure API type."
"An API version is required for the Azure API type.",
"api_version"
)
if engine is None:
raise error.InvalidRequestError(
"You must provide the deployment name in the 'engine' parameter to access the Azure OpenAI service"
"You must provide the deployment name in the 'engine' parameter to access the Azure OpenAI service",
"engine"
)
extn = quote_plus(engine)
return "/%s/%s/%s/%s?api-version=%s" % (
Expand Down Expand Up @@ -269,7 +271,8 @@ def instance_url(self):
api_version = self.api_version or openai.api_version
if not api_version:
raise error.InvalidRequestError(
"An API version is required for the Azure API type."
"An API version is required for the Azure API type.",
"api_version"
)
base = self.OBJECT_NAME.replace(".", "/")
url = "/%s/%s/%s/%s/%s?api-version=%s" % (
Expand Down