AI SDK for SAP Deployments Overview
AI Engine and Versions:
- Azure Open AI
- Open AI
- 2022-12-01
- 2023-03-15-preview
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
NOT APPLICABLE/AVAILABLE - Deployments are not supported for Open AI. Instead, the model name itself is used for operations.
Demo Program
- Azure Open AI
- Open AI
Program Name | Package | Description |
---|---|---|
ZP_MSAISDKDEMO_DEPLOYMENTS | ZPENGG_AZOAI_SDK_DEMOS | MS AI SDK for SAP : Demo Program for Deployment |
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.
NOT APPLICABLE/AVAILABLE - Deployments are not supported for Open AI. Instead, the model name itself is used for operations.
Operations
Operation | Description |
---|---|
Create | Creates a new deployment for the Azure OpenAI resource according to the given specification. |
Delete | Deletes the deployment specified by the given deployment-id. |
Get | Gets details for a single deployment specified by the given deployment-id. |
List | Gets 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
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
iv_deployment_info | EXPORTING | Deployment Create Info | Deployment Creation Inputs |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
deployment | IMPORTING | Deployment | ABAP ready structure with deployment information, if operation was successful |
error | IMPORTING | Error | ABAP Ready error structure, if operation resulted in an error |
ZCX_PENG_AZOAI_SDK_EXCEPTION - Raised if an error occured during processing.
The exception is not raised if an error occured during AI Engine processing. In such situations, the ov_error parameter will provide error details. The exception is raised only if SDK encouters a situation where it cannot proceed with the requested operation.
Responses/Status Code
Name | Type | Structure Populated | Description |
---|---|---|---|
201 Created | Deployment | deployment | The deployment has been successfully created. |
Other Status Codes | Error | error | An 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
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
deploymentid | EXPORTING | string | The identifier of the deployment. |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
error | IMPORTING | Error | ABAP Ready error structure, if operation resulted in an error |
ZCX_PENG_AZOAI_SDK_EXCEPTION - Raised if an error occured during processing.
The exception is not raised if an error occured during AI Engine processing. In such situations, the ov_error parameter will provide error details. The exception is raised only if SDK encouters a situation where it cannot proceed with the requested operation.
Responses/Status Code
Name | Type | Structure Populated | Description |
---|---|---|---|
204 No Content | The deployment was successfully deleted. | ||
Other Status Codes | Error | error | An 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
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
deploymentid | EXPORTING | string | The identifier of the deployment. |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
deployment | IMPORTING | Deployment | ABAP ready structure with deployment information, if operation was successful |
error | IMPORTING | Error | ABAP Ready error structure, if operation resulted in an error |
ZCX_PENG_AZOAI_SDK_EXCEPTION - Raised if an error occured during processing.
The exception is not raised if an error occured during AI Engine processing. In such situations, the ov_error parameter will provide error details. The exception is raised only if SDK encouters a situation where it cannot proceed with the requested operation.
Responses/Status Code
Name | Type | Structure Populated | Description |
---|---|---|---|
200 OK | Deployment | deployment | Success. |
Other Status Codes | Error | error | An 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
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
deployments | IMPORTING | Deployment List | ABAP ready structure with deployment information, if operation was successful |
error | IMPORTING | Error | ABAP Ready error structure, if operation resulted in an error |
ZCX_PENG_AZOAI_SDK_EXCEPTION - Raised if an error occured during processing.
The exception is not raised if an error occured during AI Engine processing. In such situations, the ov_error parameter will provide error details. The exception is raised only if SDK encouters a situation where it cannot proceed with the requested operation.
Responses/Status Code
Name | Type | Structure Populated | Description |
---|---|---|---|
200 OK | Deployment List | deployments | Success. |
Other Status Codes | Error | error | An error occurred. |