This track introduces attendees to using orchestration capabilities of SAP Generative AI Hub using the SAP Cloud SDK for AI (JavaScript).
- Follow all the instructions as described in the How to Start section.
- After receiving the test system access details via email, update the .env, by using the attached file.
AICORE_SERVICE_KEY='{"clientid": "<demo-credentials-file.js.clientid>","clientsecret": "<demo-credentials-file.js.clientsecret>","url": "<demo-credentials-file.js.url>","serviceurls": {"AI_API_URL": "<demo-credentials-file.js.serviceurls.AI_API_URL>"}}'
- It is highly recommended to use an IDE like VS Code or WebStorm. Open the project that you cloned from the previous step.
- Install Node 20.
The project used for this session is an Express-based web application.
The necessary dependencies for the exercises are specified in the package.json. The SAP Cloud SDK for AI uses the scope @sap-ai-sdk, e.g., @sap-ai-sdk/orchestration, for npm packages.
-
The server.ts file defines the application, including the startup process, the list of exposed endpoints, and their implementation.
-
The orchestration.ts file contains implementation details for calling the orchestration service using the client libraries provided by the SAP Cloud SDK. You will mainly work with this file during your exercises.
Note
Most endpoints will not return meaningful responses until the exercises are completed.
Tip
The solutions to the exercises are provided but have been commented out. We strongly recommend that you attempt to solve the exercises by writing the code yourself instead of just uncommenting or copying the solution. This approach will allow you to experience the full developer workflow, including useful features like auto-completion and debugging. By typing the code, you’ll better understand the logic, discover useful functions, and build muscle memory, all of which contribute to a deeper learning experience.
The exercises demonstrate how to use the SAP generative AI hub SDK to interact with the orchestration service, enabling you to build AI-driven workflows by combining multiple modules such as templating, large language models (LLM), and content filtering.
- Preparation
- Exercise 1 - Getting LLM Access via Orchestration Service
- Exercise 2 - Prompt Templating
- Exercise 3 - Content Filtering
Start from here.