Frequently Asked Questions
How to add a custom header to AI Core requests?
The SAP AI SDK leverages the destination concept from the SAP Cloud SDK for AI to manage the connection to AI Core. This opens up a wide range of possibilities to customize the connection, including adding custom headers.
var service = new AiCoreService();
var destination =
DefaultHttpDestination.fromDestination(service.getBaseDestination())
.header("my-header-key", "my-header-value")
.build();
// AI Core client
service = service.withBaseDestination(destination);
DeploymentApi client = new DeploymentApi(service);
// Orchestration client
OrchestrationClient client = new OrchestrationClient(destination);
// OpenAI client
OpenAiClient client2 = OpenAiClient.withCustomDestination(destination);
For more information, please refer to the AI Core connectivity guide and the SAP Cloud SDK documentation.
Can I apply a minor version update for the SAP Cloud SDK for AI dependency?
Yes, we recommend updating to the latest version of the SAP Cloud SDK for AI. The SAP Cloud SDK for AI follows semantic versioning so minor version updates should generally be safe and backward-compatible. However, there are some exceptional cases where API changes may occur:
Internal Classes
Internal classes are intended for use only within the SAP Cloud SDK for AI itself. Their API signatures may change without notice and are not guaranteed to be stable.
Generated Classes
The following clients are primarily generated by the SAP Cloud SDK Generator. Their API signatures may change, for example, due to updates in the underlying specifications:
There's a vulnerability warning CVE-2021-41251
?
This is a known false-positive finding. Depending on the tooling any product called "SAP Cloud SDK for AI" or similar with a low version number may be marked as vulnerable, incorrectly. Please consider suppressing the warning, as we do.
Are there any example projects?
Explore example applications and code snippets: