This track introduces attendees to using orchestration capabilities of SAP Generative AI Hub using the SAP Cloud SDK for AI (Java). You can find all mentioned features and some most samples in the SDK documentation portal.
- 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 IntelliJ. Open the project that you cloned from the previous step.
- Check whether Maven is installed and a modern version of Java (i.e. JRE17+). Your installed IDE (e.g. IntelliJ) may already provide the relevant tools for you.
The project used for this session is a neat Spring Boot-based web application.
The necessary dependencies for the exercises are specified in the pom.xml. Additional dependencies or plugins are not required for the exercises. However, you are free to add any dependencies or plugins you find useful.
The SAP Cloud SDK for AI uses the group-id com.sap.ai.sdk, e.g., com.sap.ai.sdk:orchestration, for orchestration service consumption.
-
The Application class defines the application root, including application based annotations. You can execute the
main()method from here to start the application easily. -
The OrchestrationController class contains all relevant endpoint definitions and their implementation details. Here we'll write the code 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
While the method stubs are provided, the implementation is left to you. The exercises give hints and solution to approach the target implementation, but you are encouraged to just try out. See how the IDE guides you, what methods and options are available. Maybe you can figure out the solution by yourself. 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
- Exercise 4 - Streamed Responses
Start from here.
If you encounter errors, please look closely at the exceptions and stacktraces.
For detailed HTTP context, you can enable the debug logging for different packages in the src/main/resources/application.properties file.
Use DEBUG instead of WARN to extract verbose logs.