AI SDK for SAP Completions 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_AISDKDEMO_EMBEDDINGS | ZPENGG_AZOAI_SDK_DEMOS | MSPENG: AI SDK Demo programs - Embeddings |
Program Name | Package | Description |
---|---|---|
ZP_AISDKDEMO_EMBEDDINGS_OAI | ZPENGG_OAI_DEMOS | MS AI SDK for SAP : Demo program for Open AI 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
Operation | Description |
---|---|
Create | Get 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
- Parameters
- Exceptions
Parameter | Direction | Data Type | Description |
---|---|---|---|
deploymentid | EXPORTING | string | Deployment ID on which this embedding must be generated |
inputs | EXPORTING | Embeddings Input | Strings to be converted to embedding vectors. |
statuscode | IMPORTING | Integer | Response Code. |
statusreason | IMPORTING | String | Status Description/Reason |
response | IMPORTING | Embeddings Output | ABAP Ready embeddings 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.
caution
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 | Embeddings Output | response | Success |
Other Status Codes | Error | error | An error occurred. |