We’re excited to announce the initial release of the SAP Cloud SDK for AI for Java! Only a few weeks ago we already announced the release of the JavaScript/TypeScript variant. Similarly, this SDK for Java enables convenient integration of generative AI capabilities within your SAP Business Technology Platform (BTP) applications and allows you to utilize the Generative AI Hub in SAP AI Core.
For SAP BTP developers, the AI SDK is crafted to simplify AI integration and enhance application impact. With features that optimize deployment, improve content safety, and facilitate model orchestration, the SDK lets you bring advanced AI functionality to your applications swiftly and with minimal setup. Whether you need adaptable workflows, secure data handling, or smooth generative model integration, the SDK equips you with robust tools to embed AI-powered features in your SAP BTP solutions.
This post introduces the main modules and their features.
<dependency> <groupId>com.sap.ai.sdk</groupId> <artifactId>core</artifactId> <version>1.0.0</version> </dependency>
Automate tasks such as creating AI Core artifacts, configurations, and deployments, executing batch inference jobs, as well as managing Docker registries and object storage for training data. The core module provides tools for workflow and scenario management within SAP AI Core.
Example SDK code: Create a deployment in SAP AI Core.
var api = new DeploymentApi(); var resourceGroupId = "default"; var request = AiDeploymentCreationRequest.create().configurationId("12345-123-123-123-123456abcdefg"); AiDeploymentCreationResponse deployment = api.create(resourceGroupId, request); String id = deployment.getId(); AiExecutionStatus status = deployment.getStatus();
<dependency> <groupId>com.sap.ai.sdk</groupId> <artifactId>orchestration</artifactId> <version>1.0.0</version> </dependency>
Example SDK code: Write a simple chat completion.
var client = new OrchestrationClient(); var config = new OrchestrationModuleConfig().withLlmConfig(OrchestrationAiModel.GPT_4O); var prompt = new OrchestrationPrompt("Hello world! Why is this phrase so famous?"); var result = client.chatCompletion(prompt, config); String messageResult = result.getContent();
<dependency> <groupId>com.sap.ai.sdk.foundationmodels</groupId> <artifactId>openai</artifactId> <version>1.0.0</version> </dependency>
Currently only openai is supported. Please open a feature request, if you need direct LLM access for other foundation models.
Example SDK code: Write a simple chat completion.
var result = OpenAiClient.forModel(GPT_35_TURBO) .withSystemPrompt("You are a helpful AI") .chatCompletion("Hello World! Why is this phrase so famous?"); String resultMessage = result.getContent();
You will need Java 17 or higher. Spring Boot or SAP Cloud Application Programming Model (CAP) as a framework is recommended, but not required. To explore these packages further, check out our sample project, which shows the usage of the various SDK packages.
We’d love your feedback on this first release! For support or to share your ideas, feel free to open an issue on GitHub.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 36 | |
| 33 | |
| 29 | |
| 27 | |
| 26 | |
| 26 | |
| 25 | |
| 23 | |
| 23 | |
| 23 |