AI SDK for SAP Models Overview
AI Engine and Versions:
- Azure Open AI
- Open AI
- 2022-12-01
- 2023-03-15-preview
- 2023-05-15
- 2023-06-01-preview
- 2023-07-01-preview
- 2023-08-01-preview
- v1
Demo Program
- Azure Open AI
- Open AI
Program Name | Package | Description |
---|---|---|
ZP_MSAISDKDEMO_MODELS | ZPENGG_AZOAI_SDK_DEMOS | MS AI SDK for SAP : Demo Program for Model |
Program Name | Package | Description |
---|---|---|
ZP_MSAISDKDEMO_MODELS_OAI | ZPENGG_OAI_DEMOS | MS AI SDK for SAP : Demo program for Open AI Models |
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
Operation | Description |
---|---|
Get | Gets details for the model specified by the given modelId. |
List | Gets 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
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
iv_modelid | EXPORTING | string | The identifier of the model. |
ov_statuscode | IMPORTING | Integer | Response Code. |
ov_statusreason | IMPORTING | String | Status Description/Reason |
ov_model | IMPORTING | Model | ABAP ready structure, if operation was successful |
ov_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 | Model | ov_model | Success |
Other Status Codes | Error | ov_error | An 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
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
ov_statuscode | IMPORTING | Integer | Response Code. |
ov_statusreason | IMPORTING | String | Status Description/Reason |
ov_model | IMPORTING | Model List | ABAP ready structure, if operation was successful |
ov_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 | Model List | ov_model | Success |
Other Status Codes | Error | ov_error | An error occurred. |