AI SDK for SAP Fine-Tunes 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_FINETUNES | ZPENGG_AZOAI_SDK_DEMOS | MS AI SDK for SAP : Demo Program for Fine Tunes |
Program Name | Package | Description |
---|---|---|
ZP_MSAISDKDEMO_FINETUNES_OAI | ZPENGG_OAI_DEMOS | MS AI SDK for SAP : Demo program for Open AI FineTunes |
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 |
---|---|
Cancel | Cancels the processing of the fine-tune job specified by the given fine-tune-id. |
Create | Creates a job that fine-tunes a specified model from a given training file. Response includes details of the enqueued job including job status and hyper parameters. The name of the fine-tuned model is added to the response once complete. |
Delete | Deletes the fine-tune job specified by the given fine-tune-id. |
Get | Gets details for a single fine-tune job specified by the given fine-tune-id. The details contain the base model, training and validation files, hyper parameters, time stamps, status and events. Events are created when the job status changes, e.g. running or complete, and when results are uploaded. |
Get Events | Gets the events for the fine-tune job specified by the given fine-tune-id. Events are created when the job status changes, e.g. running or complete, and when results are uploaded. |
List | Gets a list of all fine-tune jobs owned by the Azure OpenAI resource. The details that are returned for each fine-tune job contain besides its identifier the base model, training and validation files, hyper parameters, time stamps, status and events. Events are created when the job status changes, e.g. running or complete, and when results are uploaded. |
Fine Tunes - Cancel
Cancels the processing of the fine-tune job specified by the given fine-tune-id.
DATA:
finetunes_cancel_result TYPE zif_peng_azoai_sdk_types=>ty_finetune_result.
sdk_instance->finetunes( )->cancel(
EXPORTING
finetuneid = finetune_id " The identifier of the fine-tune job
IMPORTING
statuscode = status_code " Status Code
statusreason = status_reason " Status Reason
finetune_cancelled = finetunes_cancel_result " ABAP Ready fine-tune cancellation details
error = error " ABAP Ready error details
).
Parameters and Exceptions
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
finetuneid | EXPORTING | string | The identifier of the fine-tune job. |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
finetune_cancelled | IMPORTING | Fine Tune Result | ABAP Ready fine fune operation result. |
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 | Fine Tune Result | finetune_cancelled | The fine tune has been successfully canceled |
Other Status Codes | Error | error | An error occurred. |
Fine Tunes - Create
Creates a job that fine-tunes a specified model from a given training file. Response includes details of the enqueued job including job status and hyper parameters. The name of the fine-tuned model is added to the response once complete.
DATA:
finetunes_create TYPE zif_peng_azoai_sdk_types=>ty_finetune_create,
finetunes_create_result TYPE zif_peng_azoai_sdk_types=>ty_finetune_result,.
sdk_instance->finetunes( )->create(
EXPORTING
finetune_create = finetunes_create
IMPORTING
statuscode = status_code " Status Code
statusreason = status_reason " HTTP status description
finetune = finetunes_create_result " ABAP Ready Fine Tune Creation result
error = error " ABAP Ready error details
).
Parameters and Exceptions
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
finetune_create | EXPORTING | Fine Tunes Create | Fine Tune creation parameters |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
finetune | IMPORTING | Fine Tune Result | ABAP Ready fine fune operation result. |
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 | Fine Tune Result | finetune | The fine tune has been successfully created |
Other Status Codes | Error | error | An error occurred. |
Fine Tunes - Delete
Deletes the fine-tune job specified by the given fine-tune-id.
sdk_instance->finetunes( )->delete(
EXPORTING
finetuneid = finetune_id " The identifier of the fine-tune job
IMPORTING
statuscode = status_code " Status Code
statusreason = status_reason " Status description
error = error " ABAP Ready error details
).
Parameters and Exceptions
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
finetuneid | EXPORTING | string | The identifier of the fine-tune job. |
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 fine tune was successfully deleted. | ||
Other Status Codes | Error | error | An error occurred. |
Fine Tunes - Get
Gets details for a single fine-tune job specified by the given fine-tune-id. The details contain the base model, training and validation files, hyper parameters, time stamps, status and events. Events are created when the job status changes, e.g. running or complete, and when results are uploaded.
DATA:
finetunes_get_result TYPE zif_peng_azoai_sdk_types=>ty_finetune_result.
sdk_instance->finetunes( )->get(
EXPORTING
finetuneid = finetune_id
IMPORTING
statuscode = status_code " Status Code
statusreason = status_reason " HTTP status description
finetune = finetunes_get_result " ABAP Ready Fine Tunes GET operation result
error = error " ABAP Ready error details
).
Parameters and Exceptions
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
finetuneid | EXPORTING | string | The identifier of the fine-tune job. |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
finetune | IMPORTING | Fine Tune Result | ABAP Ready fine fune operation result. |
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 | Fine Tune Result | finetune | Success |
Other Status Codes | Error | error | An error occurred. |
Fine Tunes - Get Events
Gets the events for the fine-tune job specified by the given fine-tune-id. Events are created when the job status changes, e.g. running or complete, and when results are uploaded.
DATA:
finetunes_events TYPE zif_peng_azoai_sdk_types=>ty_finetune_events.
sdk_instance->finetunes( )->get_events(
EXPORTING
finetuneid = finetunes_create_result-id
IMPORTING
statuscode = status_code " Status Code
statusreason = status_reason " HTTP status description
finetune_events = finetunes_events " ABAP Ready Fine Tunes Events List
error = error " ABAP Ready error details
).
Parameters and Exceptions
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
finetuneid | EXPORTING | string | The identifier of the fine-tune job. |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
finetune_events | IMPORTING | Fine Tune Events | ABAP Ready fine fune Events List. |
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 | Fine Tune Events | finetune_events | Success |
Other Status Codes | Error | error | An error occurred. |
Fine Tunes - List
Gets a list of all fine-tune jobs owned by the Azure OpenAI resource. The details that are returned for each fine-tune job contain besides its identifier the base model, training and validation files, hyper parameters, time stamps, status and events. Events are created when the job status changes, e.g. running or complete, and when results are uploaded.
DATA:
finetunes_list TYPE zif_peng_azoai_sdk_types=>ty_finetune_list.
sdk_instance->finetunes( )->list(
IMPORTING
statuscode = status_code " Status Code
statusreason = status_reason " HTTP status description
finetune_list = finetunes_list " ABAP Ready Fine Tunes List
error = error " ABAP Ready error details
).
Parameters and Exceptions
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
finetune_list | IMPORTING | Fine Tune List | ABAP Ready fine list. |
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 | Fine Tune List | finetune_list | Success |
Other Status Codes | Error | error | An error occurred. |