Skip to content

Latest commit

 

History

History
113 lines (66 loc) · 4.86 KB

File metadata and controls

113 lines (66 loc) · 4.86 KB

Setup SAP Business Application Studio and Your Development Space

SAP Business Application Studio is based on Code-OSS, an open-source project used for building Visual Studio Code. Available as a cloud service, SAP Business Application Studio (BAS) provides a desktop-like experience similar to leading IDEs, with command line and optimized editors.

At the heart of SAP Business Application Studio are the dev spaces. Dev spaces are comparable to isolated virtual machines in the cloud containing tailored tools and pre-installed runtimes per business scenario. This simplifies and speeds up the setup of your development environment, enabling you to efficiently develop, test, build, and run your solutions locally or in the cloud.

Open SAP Business Application Studio

👉 Go back to the BTP cockpit.

👉 Navigate to Instances and Subscriptions and open SAP Business Application Studio.

Open BAS

Create a New Dev Space for CodeJam Exercises

👉 Create a new Dev Space.

Create a Dev Space 1

👉 Enter the name GenAICodeJam_XX, select the Basic kind of application, and choose Node.js from Additional SAP Extensions.

Replace XX with your initials.

👉 Click Create Dev Space.

Create a Dev Space 2

You should see the dev space STARTING.

Dev Space is Starting

👉 Wait for the dev space to reach the RUNNING state and then open it.

Dev Space is Running

Clone the Repository

👉 Once your dev space is open in BAS, clone this Git repository using the URL below:

https://github.com/SAP-samples/codejam-code-based-agents.git

Clone the repo

👉 Click Open to open the project in the Explorer view.

Open a project

Configure the Connection to Generative AI Hub

👉 Go back to the Subaccount in the BTP cockpit.

👉 Navigate to Instances and Subscriptions and open the SAP AI Core instance's service binding.

Service Binding in the BTP Cockpit

👉 Click Copy JSON.

👉 Return to BAS and create a new file .env in /project/JavaScript/starter-project/ by copying the provided .env.example:

cp project/JavaScript/starter-project/.env.example project/JavaScript/starter-project/.env

👉 Open the .env file and paste your SAP AI Core service key JSON as the value of AICORE_SERVICE_KEY (the entire JSON on a single line, wrapped in single quotes):

AICORE_SERVICE_KEY='{"clientid":"sb-...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}'
RESOURCE_GROUP=ai-agents-codejam
MODEL_NAME=gpt-4o
GROUNDING_PIPELINE_ID=

☝️ You will fill in the GROUNDING_PIPELINE_ID in a later exercise.

💡 Why a single-line JSON string? The SAP Cloud SDK for AI reads AICORE_SERVICE_KEY as a raw JSON string from the environment. Pasting the service key JSON as a single line (without newlines) ensures dotenv parses it correctly. Newlines inside the value would break the .env format.

Install Node.js Dependencies

👉 Open a new Terminal in BAS.

Start terminal

👉 Verify your Node.js version (18 or newer required):

node --version

⚠️ Important: The SAP Cloud SDK for AI requires Node.js 18 or newer. If your version is older, install a current LTS release from nodejs.org.

👉 Navigate to the starter project and install dependencies:

cd project/JavaScript/starter-project
npm install

This installs all packages defined in package.json, including:

  • @langchain/langgraph — the graph-based agent framework
  • @sap-ai-sdk/orchestration — SAP Cloud SDK for AI, LLM access via Generative AI Hub
  • @sap-ai-sdk/rpt — SAP Cloud SDK for AI, RPT-1 structured data model
  • dotenv — loads your .env file into process.env
  • tsx — TypeScript Execute runtime, runs .ts files directly

💡 No compilation step needed for development. You will run TypeScript files directly using npx tsx. This means you edit a .ts file and run it immediately, with no tsc build required during the workshop.

Let's Start Coding!

Next exercise