Frequently Asked Questions
"How to add a custom header to AI Core requests?"
The 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.
"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: