This demo shows you how to generate text embeddings by passing a snippet of text input to an embedding model, by using the Vertex AI SDK for ABAP.
Before you begin
Before you run this demo, make sure that you or your administrators have completed the following prerequisites:
- Enabled the Vertex AI API in your Google Cloud project.
- Set up authentication to access the Vertex AI API.
- Configured the model generation parameters. For generating embeddings, only the following
parameters are required:
Client Key
,Model Key
,Model ID
,Google Cloud Region Location
andPublisher
.
Generate text embeddings
To generate text embeddings, perform the following steps:
In SAP GUI, execute the transaction code
/GOOG/SDK_IMG
.Alternatively, execute the transaction code
SPRO
, and then click SAP Reference IMG.Go to ABAP SDK for Google Cloud > Demos.
Open Demo: Invoke multimodal Embedding models
Select Generate text embeddings.
In the Client key field, enter the client key for authentication.
In the Model key field, enter the model key, which is configured in the model generation parameters.
In the Dimensions field, enter the number of dimensions for the output embeddings, such as
768
.In the Enter text field, provide your input text.
Run the program. The Response from LLM area shows the generated embeddings.