As we are witnessing one of the exciting time in the field of AI and lots of experiments and evolutions are still happening , the things we never thought of are coming into reality hence the only option for us to Keep adopting these beautiful break through in tech. and Keep supporting Supporting community and Humanity by every means.
Intended Audience:
Someone who wants to start exploring these APIs and willing to integrate/consume them inside SAP BTP Box then this is your article to read.
Hi All ,
As i have stated above this article is written to give you information about how can we leverage google vertex AI APIs into SAP Build Apps smoothly by adding the CAP Layer in middle to establish communication between them.
Lets start enabling and Testing Vertex API on google cloud.
Once you enabled these API , you can see this screen and try out few prompts before we switch to consumption of these APIs/Models.
Lets try some prompt for converting an email request data into particular JSON format using this model , you can try prompts according to your need/testing.
Disclaimer: I am not promoting any AI Product , I am just exploring these APIs and sharing the learning and possibilities of consumption/integration with them.
Prompt : I uploaded the above image and added a simple text "What is this image about ?" and got a satisfactory answer from API.
I think we are good here , i am not gonna add other prompts here , i shall request you to try out few more prompts and check accuracy and results carefully before deciding the usage of these APIs.
Next Part: How to consume these APIs in SAP CAP.
Lets do this. let download the service key from your service Account in GCP.
Navigate to your project -> To Service Account and Click create/ Add new Key download JSON and Save it somewhere on your computer.
Go to your Vertex AI API Prompt and navigate to Code section and get the Code Choose NodeJS code as we are going to use exactly the same code to call these APIs from CAP.
Note: I am not going to add anything related to CAP Application , this will be a simple Application with one entity called GEMINI prompt as an input and response in output and create a corresponding handler to handle the incoming request from UI.
Once you click on Get Code , you will get the NodeJS Code related to this API , install required libraries and test the integration.
if you are good with CAP Layer integration with Vertex AI then you will be able to test these APIs from POSTMAN Successfully , Make sure to Authenticate request successfully before model call otherwise it is gonna give you some error related to unauthorized.
Lets test these APIs from POSTMAN now.
So we have completed CAP Integration , Awesome lets build and deploy this API into your BTP Box.
MBT Build + CF Deploy _mtar -> Done ?
Final Part: Integrate CAP APIs into your SAP Build App.
Go to your BTP Cockpit and Open SAP Build Apps
Choose create an Application and select Mobile App ( aka Appgyver )
Create a Simple Application with one input one button and an output field ( A Chatbot interface ).
Integration with CAP APIs.
Go to Data Section and choose Rest Based Direct Integration
These APIs will be integrated at the button click event to complete the call to backend.
Lets Test this Application end-2-end.
At last : Don't forget to share feedback/suggestions if any.
#KeepLearning#KeepSharing
Thanks - Shivam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |