Skip to main content

AI SDK for SAP Completions 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_AISDKDEMO_EMBEDDINGSZPENGG_AZOAI_SDK_DEMOSMSPENG: AI SDK Demo programs - Embeddings
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
CreateGet a vector representation of a given input that can be easily consumed by machine learning models and other algorithms.

Embeddings - Create

With the Embeddings operation, the model will generate a vector representation of a given input that can be easily consumed by machine learning models and other algorithms.

DATA:
embeddings_input TYPE zif_peng_azoai_sdk_types=>ty_embeddings_input,
embeddings_output TYPE zif_peng_azoai_sdk_types=>ty_embeddings_output.

sdk_instance->embeddings( )->create(
EXPORTING
deploymentid = deployment_id " Deployment ID on which the embedding must be generated.
inputs = embeddings_input " Input texts for embedding
IMPORTING
statuscode = status_code " Status Code
statusreason = status_reason " HTTP status description
response = embeddings_output " ABAP Friendly Embeddings operation output
error = error " ABAP Ready error details
).

Parameters and Exceptions

ParameterDirectionData TypeDescription
deploymentidEXPORTINGstringDeployment ID on which this embedding must be generated
inputsEXPORTINGEmbeddings InputStrings to be converted to embedding vectors.
statuscodeIMPORTINGIntegerResponse Code.
statusreasonIMPORTINGStringStatus Description/Reason
responseIMPORTINGEmbeddings OutputABAP Ready embeddings result
errorIMPORTINGErrorABAP Ready error structure, if operation resulted in an error

Responses/Status Code

NameTypeStructure PopulatedDescription
200 OKEmbeddings OutputresponseSuccess
Other Status CodesErrorerrorAn error occurred.