SAP-samples/codejam-cap-llm
A CodeJam that builds a CAP-based job posting service exposing SAP AI Core's generative AI capabilities, including vector embeddings, through an OData API.
Exposing generative AI capabilities through a business API is usually explained in the abstract, and this CodeJam walks it through ten exercises instead: connecting to SAP AI Core and SAP AI Launchpad, exploring the SAP HANA CloudSAP HANA CloudThe managed database under most of this: CAP's default target, the store Datasphere and Analytics Cloud sit on, and a service with plans and components.sap official, btp Vector Engine, defining a database schema, creating vector embeddings from an embedding model, and then defining and implementing a Job Posting Service on top. It covers data masking, anonymisation and pseudonymisation as a dedicated exercise before the service is built, and an optional exercise on prompt engineering with AI Launchpad after. It is written to be run instructor-led during a live CodeJam session, one exercise at a time, and support is available only for the duration of the scheduled event.
Facts
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainerAjay SorengContributes to this
In the atlas: contributes to 36@ajaysorengAjinkya PatilContributes to this
In the atlas: contributes to 112@ajinkyapatil8190Antonio MaradiagaContributes to this
Developer Advocate
In the atlas: contributes to 10@ajmaradiagaKevin RiedelsheimerContributes to this
In the atlas: contributes to 11@KevinRiedelsheimerShrinivasan NeelamegamContributes to this
In the atlas: contributes to 4@neelamegamsNora von ThenenContributes to this
In the atlas: contributes to 3@noravthVitaliy RudnytskiyContributes to this
In the atlas: contributes to 6, wrote 1@Sygyzmundovych7 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
As a sample
- Form
- Workshop or CodeJam material
Connections
Calling a language model with tenant and credential handling solved
Download
README
quoted from SAP-samples/codejam-cap-llm under Apache-2.0, readBuild AI services using the SAP Cloud Application Programming Model, SAP AI Core and Generative AI Hub
Table of Contents
Description
This repository contains the material for the "Expose SAP AI Core capabilities with the SAP Cloud Application Programming Model" CodeJam.
Overview
This CodeJam introduces attendees to aspects of exposing generative artificial intelligence (genAI) capabilities to execute tasks using a given business context.
During this event, you'll become acquainted with the theory behind genAI, SAP AI Core, SAP AI Launchpad, and learn how to use the SAP Cloud Application Programming Model to expose AI capabilities through your own OData service.
While working through the exercises, you'll become comfortable creating CDS-based service definitions and integrating them into the SAP Business Technology Platform (BTP) and SAP AI Core Foundation Models.

Session prerequisites
Certain prerequisites must be fulfilled before the day of the CodeJam in order to get the most from this CodeJam and be able to work through the exercises.
The prerequisites are detailed in a separate prerequisites file. Please ensure you have everything ready before attending the CodeJam.
Exercises
These are the exercises, each in their directory, sometimes with supporting files and scripts. We will work through the exercises in the order shown here. From a session flow perspective, we are taking the "coordinated" approach:
- Exercise 00 - Set up your workspace
- Exercise 01 - Explore Generative AI Hub in SAP AI Launchpad
- Exercise 02 - Create the SAP AI Core connection configuration
- Exercise 03 - Explore the SAP HANA Cloud Vector Engine
- Exercise 04 - Create the database schema for the CAP application
- Exercise 05 - Create vector embeddings using an embedding model
- Exercise 06 - Define the Job Posting Service
- Exercise 07 - Implement the Job Posting Service
- Exercise 08 - Understand data masking, what is anonymization and pseudonymization
- Optional Exercise 09 - Prompt Engineering with AI Launchpad
The instructor will start you on the first exercise, and that's the only one you should do. You should only proceed to the next exercise once the instructor tells you to.
For this CodeJam you are provided with a subaccount on SAP BTP. The subaccount is only available for the duration of this CodeJam.
Frequently asked Questions
You can find a list of frequently asked questions in the Frequently Asked Questions Document
Further Learning on AI
YouTube Videos
- What are AI Agents?
- SAP Business AI: Explore AI Across Your Business
- 2 Minutes of AI@SAP
- SAP Business AI - SAP Developers
- Transformers (how LLMs work) explained visually | DL5 by 3Blue1Brown
- But what is a neural network? | Deep learning chapter 1
Learning
Customer & Partner projects
Feedback
If you can spare a couple of minutes at the end of the session, please provide feedback to help us improve next time.
Use this Give feedback link to create a special "feedback" issue, and follow the instructions in there.
Thank you!
Other CodeJams
CodeJam repositories
- Service integration with SAP Cloud Application Programming Model
- CodeJam - Getting Started with Machine Learning using SAP HANA and Python
- Hands-on with the btp CLI and APIs
- CodeJam - Combine SAP Cloud Application Programming Model with SAP HANA Cloud to Create Full-Stack Applications
- All CodeJams in one list
CodeJam Community
Acknowledgements
The exercise content in this repository is based on a sample repository created by the CAP team.
How to obtain support
Support for the content in this repository is available during the CodeJam event for which this content has been designed.
License
Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0, except as noted otherwise in the LICENSE file.
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-codejam-cap-llm- JSON
- /artifacts/sap-samples-codejam-cap-llm.json
- MCP
- Connecting an agent