Skip to main content

AI SDK for SAP Fine-Tunes 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_FINETUNESZPENGG_AZOAI_SDK_DEMOSMS AI SDK for SAP : Demo Program for Fine Tunes
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
CancelCancels the processing of the fine-tune job specified by the given fine-tune-id.
CreateCreates 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.
DeleteDeletes the fine-tune job specified by the given fine-tune-id.
GetGets 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 EventsGets 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.
ListGets 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

ParameterDirectionData TypeDescription
finetuneidEXPORTINGstringThe identifier of the fine-tune job.
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
finetune_cancelledIMPORTINGFine Tune ResultABAP Ready fine fune operation result.
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKFine Tune Resultfinetune_cancelledThe fine tune has been successfully canceled
Other Status CodesErrorerrorAn 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

ParameterDirectionData TypeDescription
finetune_createEXPORTINGFine Tunes CreateFine Tune creation parameters
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
finetuneIMPORTINGFine Tune ResultABAP Ready fine fune operation result.
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
201 CreatedFine Tune ResultfinetuneThe fine tune has been successfully created
Other Status CodesErrorerrorAn 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

ParameterDirectionData TypeDescription
finetuneidEXPORTINGstringThe identifier of the fine-tune job.
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
204 No ContentThe fine tune was successfully deleted.
Other Status CodesErrorerrorAn 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

ParameterDirectionData TypeDescription
finetuneidEXPORTINGstringThe identifier of the fine-tune job.
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
finetuneIMPORTINGFine Tune ResultABAP Ready fine fune operation result.
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKFine Tune ResultfinetuneSuccess
Other Status CodesErrorerrorAn 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

ParameterDirectionData TypeDescription
finetuneidEXPORTINGstringThe identifier of the fine-tune job.
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
finetune_eventsIMPORTINGFine Tune EventsABAP Ready fine fune Events List.
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKFine Tune Eventsfinetune_eventsSuccess
Other Status CodesErrorerrorAn 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

ParameterDirectionData TypeDescription
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
finetune_listIMPORTINGFine Tune ListABAP Ready fine list.
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKFine Tune Listfinetune_listSuccess
Other Status CodesErrorerrorAn error occurred.