Skip to main content

AI SDK for SAP Deployments Overview

AI Engine and Versions:

  • 2022-12-01
  • 2023-03-15-preview
caution

Deployments feature in Azure Open AI has been moved to Cognitive services, and hence, is not supported directly by the AI SDK for following versions (for now).

  • 2023-05-15
  • 2023-06-01-preview
  • 2023-07-01-preview
  • 2023-08-01-preview

Demo Program

Program NamePackageDescription
ZP_MSAISDKDEMO_DEPLOYMENTSZPENGG_AZOAI_SDK_DEMOSMS AI SDK for SAP : Demo Program for Deployment
tip

Review the demo program along with the content of this page to understand the use of AI SDK feature. The demo program was imported to your SAP Application server as part of AI SDK Installation.


Operations

OperationDescription
CreateCreates a new deployment for the Azure OpenAI resource according to the given specification.
DeleteDeletes the deployment specified by the given deployment-id.
GetGets details for a single deployment specified by the given deployment-id.
ListGets the list of deployments owned by the Azure OpenAI resource.

Deployments - Create

Creates a new deployment for the Azure OpenAI resource according to the given specification.

DATA:
deployment TYPE zif_peng_azoai_sdk_types=>ty_deployments, "Deployments Information.
deployment_create TYPE zif_peng_azoai_sdk_types=>ty_deployments_create. "Deployment Creation

"Specify the base model for this deployment. Here, we are using "text-curie-001" as the base model.
deployment_create-model = 'text-curie-001'.

"Create deployment.
sdk_instance->deployments( )->create(
EXPORTING
iv_deployment_info = deployment_create
IMPORTING
statuscode = status_code
statusreason = status_reason
json = returnjson
deployment = deployment
error = error
).

Parameters and Exceptions

ParameterDirectionData TypeDescription
iv_deployment_infoEXPORTINGDeployment Create InfoDeployment Creation Inputs
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
deploymentIMPORTINGDeploymentABAP ready structure with deployment information, if operation was successful
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
201 CreatedDeploymentdeploymentThe deployment has been successfully created.
Other Status CodesErrorerrorAn error occurred.

Deployments - Delete

Deletes the deployment specified by the given deployment-id.


sdk_instance->deployments( )->delete(
EXPORTING
deploymentid = deployment-id
IMPORTING
statuscode = status_code
statusreason = status_reason
json = returnjson
error = error
).

Parameters and Exceptions

ParameterDirectionData TypeDescription
deploymentidEXPORTINGstringThe identifier of the deployment.
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
204 No ContentThe deployment was successfully deleted.
Other Status CodesErrorerrorAn error occurred.

Deployments - Get

Deletes the deployment specified by the given deployment-id.

DATA:
deployment TYPE zif_peng_azoai_sdk_types=>ty_deployments, "Deployments Information.

sdk_instance->deployments( )->get(
EXPORTING
deploymentid = deployment-id
IMPORTING
statuscode = status_code
statusreason = status_reason
json = returnjson
deployment = deployment
error = error
).

Parameters and Exceptions

ParameterDirectionData TypeDescription
deploymentidEXPORTINGstringThe identifier of the deployment.
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
deploymentIMPORTINGDeploymentABAP ready structure with deployment information, if operation was successful
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKDeploymentdeploymentSuccess.
Other Status CodesErrorerrorAn error occurred.

Deployments - List

Gets the list of deployments owned by the Azure OpenAI resource.

DATA:
deployment_list TYPE zif_peng_azoai_sdk_types=>ty_deployments_list. "ABAP Type for Deployment Listing

sdk_instance->deployments( )->list(
IMPORTING
statuscode = status_code
statusreason = status_reason
json = returnjson
deployments = deployment_list
error = error
).

Parameters and Exceptions

ParameterDirectionData TypeDescription
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
deploymentsIMPORTINGDeployment ListABAP ready structure with deployment information, if operation was successful
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKDeployment ListdeploymentsSuccess.
Other Status CodesErrorerrorAn error occurred.