Skip to main content

AI SDK for SAP Models Overview

AI Engine and Versions:

  • 2022-12-01
  • 2023-03-15-preview
  • 2023-05-15
  • 2023-06-01-preview
  • 2023-07-01-preview
  • 2023-08-01-preview

Demo Program

Program NamePackageDescription
ZP_MSAISDKDEMO_MODELSZPENGG_AZOAI_SDK_DEMOSMS AI SDK for SAP : Demo Program for Model
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
GetGets details for the model specified by the given modelId.
ListGets a list of all models that are accessible by the AI Engine. These include base models as well as all successfully completed fine-tuned models.

Models - Get

Gets details for the model specified by the given modelId.

DATA:  
model_get TYPE zif_peng_azoai_sdk_types=>ty_model_get. "ABAP Type for A single Model information

sdk_instance->model( )->get(
EXPORTING
iv_modelid = model-id " Model ID
IMPORTING
ov_statuscode = status_code " HTTP status code
ov_statusreason = status_reason " HTTP status description
ov_json = returnjson " JSON String returned from AI Resource
ov_model = model_get " Details of the model
ov_error = error " Error if any.
).

Parameters and Exceptions

ParameterDirectionData TypeDescription
iv_modelidEXPORTINGstringThe identifier of the model.
ov_statuscodeIMPORTINGIntegerResponse Code.
ov_statusreasonIMPORTINGStringStatus Description/Reason
ov_modelIMPORTINGModelABAP ready structure, if operation was successful
ov_errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKModelov_modelSuccess
Other Status CodesErrorov_errorAn error occurred.

Models - List

Gets a list of all models that are accessible by the Azure OpenAI resource. These include base models as well as all successfully completed fine-tuned models owned by the Azure OpenAI resource.

DATA:  
model_list TYPE zif_peng_azoai_sdk_types=>ty_model_list.

sdk_instance->model( )->list(
IMPORTING
ov_statuscode = status_code " Status Code
ov_statusreason = status_reason " HTTP status description
ov_json = returnjson " JSON String returned from AI Resource
ov_model = model_list " List of Models available
ov_error = error " Error if any
).

Parameters and Exceptions

ParameterDirectionData TypeDescription
ov_statuscodeIMPORTINGIntegerResponse Code.
ov_statusreasonIMPORTINGStringStatus Description/Reason
ov_modelIMPORTINGModel ListABAP ready structure, if operation was successful
ov_errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKModel Listov_modelSuccess
Other Status CodesErrorov_errorAn error occurred.