Установка
SKILL.md
SAP Cloud SDK for AI
Related Skills
- sap-cap-capire: Use for building CAP applications that consume AI services, including event handler patterns and async LLM orchestration
- sap-ai-core: Use for AI Core platform setup, orchestration configuration, and model deployment
- sap-dependency-security: Hardening guidance for npm package upgrades, lockfile policies, and secure dependency workflows
The official SDK for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. Package versions are verified against public registries; AI Core tenant execution and exact model availability still require target-tenant validation.
When to Use This Skill
Use this skill when:
- Integrating AI/LLM capabilities into SAP BTP applications
- Building chat completion or embedding features
- Using tenant-approved OpenAI, Claude, Gemini, Amazon, Mistral, or other model families via SAP AI Core
- Implementing content filtering, data masking, or document grounding
- Creating agentic workflows with LangChain or Spring AI
- Managing prompts via Prompt Registry
- Deploying AI models on SAP AI Core
Table of Contents
- Quick Start
- Prerequisites
- Connection Setup
- Available Packages
- Supported Models
- Core Features
- Bundled Resources
Quick Start
Note: This skill uses SAP Cloud SDK for AI JavaScript v2.11.0+ and Java v1.19.0+ based on public package registry evidence from 2026-06-15. If you're migrating from v1.x, see V1 to V2 Migration Guide for breaking changes.
JavaScript/TypeScript
npm install @sap-ai-sdk/orchestration@^2
import { OrchestrationClient } from '@sap-ai-sdk/orchestration';
const client = new OrchestrationClient({
promptTemplating: {
model: { name: 'gpt-4o' },
prompt: [{ role: 'user', content: '{{?question}}' }]
}
});
const response = await client.chatCompletion({
placeholderValues: { question: 'What is SAP?' }
});
console.log(response.getContent());
Java
<dependency>
<groupId>com.sap.ai.sdk</groupId>
<artifactId>orchestration</artifactId>
<version>${ai-sdk.version}</version>
</dependency>
var client = new OrchestrationClient();
var config = new OrchestrationModuleConfig()
.withLlmConfig(OrchestrationAiModel.GPT_4O);
var prompt = new OrchestrationPrompt("What is SAP?");
var result = client.chatCompletion(prompt, config);
System.out.println(result.getContent());
Prerequisites
- Node.js 20+ (JavaScript) or Java 17+ (Java)
- SAP AI Core service instance (extended or sap-internal plan)
- Orchestration deployment in AI Core (default resource group has this)
Connection Setup
BTP Runtime (Cloud Foundry/Kyma)
Bind AI Core service instance to your application. SDK auto-detects via VCAP_SERVICES or mounted secrets.
Local Development
Set environment variable:
export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}'
Or use CAP hybrid mode:
# JavaScript
cds bind -2 <AICORE_INSTANCE> && cds-tsx watch --profile hybrid
# Java
cds bind --to aicore --exec mvn spring-boot:run
For detailed connection options, see references/connecting-to-ai-core.md
Available Packages
JavaScript/TypeScript
| Package | Purpose |
|---|---|
@sap-ai-sdk/orchestration | Chat completion, filtering, grounding |
@sap-ai-sdk/foundation-models | Direct model access (OpenAI) |
@sap-ai-sdk/langchain | LangChain integration |
@sap-ai-sdk/ai-api | Deployments, artifacts, configurations |
@sap-ai-sdk/document-grounding | Pipeline, Vector, Retrieval APIs |
@sap-ai-sdk/prompt-registry | Prompt template management |
Java
| Artifact | Purpose |
|---|---|
orchestration | Chat completion, filtering, grounding |
openai (foundationmodels) | Direct OpenAI model access |
core | Base connectivity |
document-grounding | Pipeline, Vector, Retrieval APIs |
prompt-registry | Prompt template management |
Supported Models
Model IDs and versions are tenant-specific. Before copying an example into application code, list the target catalog through SAP AI Launchpad Model Library or the AI Core model-list API.
Example Families
- OpenAI: GPT-family chat, multimodal, reasoning, and embedding models where entitled
- Anthropic (AWS): Claude-family models where entitled
- Amazon: Nova/Titan-family models where entitled
- Google: Gemini-family models where entitled
- Mistral: Mistral-family models where entitled
Deprecated Models (Use Replacements)
| Deprecated | Use Instead |
|---|---|
| text-embedding-ada-002 | text-embedding-3-small/large |
| gpt-35-turbo (all variants) | gpt-4o-mini |
| gpt-4-32k | gpt-4o |
| gpt-4 (base) | gpt-4o or gpt-4.1 |
| gemini-1.0-pro | gemini-2.0-flash |
| gemini-1.5-pro/flash | gemini-2.5-flash |
| mistralai--mixtral-8x7b | mistralai--mistral-small-instruct |
Core Features
Chat Completion with Streaming
// JavaScript
const stream = client.stream({
placeholderValues: { question: 'Explain SAP CAP' }
});
for await (const chunk of stream.toContentStream()) {
process.stdout.write(chunk);
}
// Java
client.streamChatCompletion(prompt, config)
.forEach(chunk -> System.out.print(chunk.getDeltaContent()));
Function/Tool Calling
// JavaScript
const tools = [{
type: 'function',
function: {
name: 'get_weather',
parameters: { type: 'object', properties: { city: { type: 'string' } } }
}
}];
const response = await client.chatCompletion({
placeholderValues: { question: 'Weather in Berlin?' }
}, { tools });
const toolCalls = response.getToolCalls();
Content Filtering
// JavaScript
import { buildAzureContentSafetyFilter } from '@sap-ai-sdk/orchestration';
const client = new OrchestrationClient({
promptTemplating: { model: { name: 'gpt-4o' } },
filtering: {
input: buildAzureContentSafetyFilter({ Hate: 'ALLOW_SAFE' }),
output: buildAzureContentSafetyFilter({ Violence: 'ALLOW_SAFE' })
}
});
Data Masking
// JavaScript
const client = new OrchestrationClient({
promptTemplating: { model: { name: 'gpt-4o' } },
masking: {
masking_providers: [{
type: 'sap_data_privacy_integration',
method: 'anonymization',
entities: [{ type: 'profile-email' }, { type: 'profile-person' }]
}]
}
});
Document Grounding
// JavaScript
const client = new OrchestrationClient({
promptTemplating: { model: { name: 'gpt-4o' } },
grounding: {
grounding_input: ['{{?question}}'],
grounding_output: ['{{?context}}'],
data_repositories: [{ type: 'vector', id: 'my-repo-id' }]
}
});
CAP Integration
The SDK integrates natively with CAP event handlers. Use OrchestrationClient inside CAP service classes to add AI capabilities to your CAP services.
Service binding in MTA:
resources:
- name: my-ai-core
type: org.cloudfoundry.managed-service
parameters:
service: aicore
service-plan: extended
CAP event handler with AI:
import { OrchestrationClient } from '@sap-ai-sdk/orchestration';
import cds from '@sap/cds';
export default class AnalysisService extends cds.ApplicationService {
async init() {
const client = new OrchestrationClient({
promptTemplating: {
model: { name: 'gpt-4o' },
prompt: [
{ role: 'system', content: 'Analyze and categorize as JSON.' },
{ role: 'user', content: '{{?input}}' }
]
}
});
this.on('analyzeText', async (req) => {
const response = await client.chatCompletion({
placeholderValues: { input: req.data.text }
});
return response.getContent();
});
return super.init();
}
}
Critical: Use async processing for production LLM calls. LLM responses can take 30-60 seconds, exceeding BTP load balancer timeouts. Return 202 Accepted and process in the background:
this.on('analyzeText', async (req) => {
const entry = await INSERT.into('Results').entries({
text: req.data.text, status: 'processing'
});
cds.spawn(() => processLLM(entry.id, req.data.text, client));
return req.reply(202, { id: entry.id, status: 'processing' });
});
For the complete CAP + AI integration guide including HANA Vector types for RAG and prompt externalization, see the sap-cap-capire skill.
Response Helpers
JavaScript SDK provides helper methods:
const response = await client.chatCompletion({ placeholderValues });
response.getContent(); // Model output string
response.getTokenUsage(); // { prompt_tokens, completion_tokens, total_tokens }
response.getFinishReason(); // 'stop', 'length', 'tool_calls', etc.
response.getToolCalls(); // Array of function calls
response.getDeltaToolCalls(); // Partial tool calls (streaming)
response.getAllMessages(); // Full message history
response.getAssistantMessage(); // Assistant response only
response.getRefusal(); // Refusal message if blocked
Streaming response methods:
const stream = client.stream({ placeholderValues });
for await (const chunk of stream.toContentStream()) {
process.stdout.write(chunk);
}
// After stream ends:
stream.getFinishReason();
stream.getTokenUsage();
Advanced Topics
For detailed guidance:
- Orchestration features:
references/orchestration-guide.md - Foundation models (direct OpenAI):
references/foundation-models-guide.md - LangChain integration:
references/langchain-guide.md - Spring AI integration:
references/spring-ai-guide.md - AI Core management:
references/ai-core-api-guide.md
Bundled Resources
Reference Documentation
references/foundation-models-guide.md- Foundation models and pricingreferences/ai-core-api-guide.md- AI Core service API referencereferences/orchestration-guide.md- Orchestration service guidereferences/langchain-guide.md- LangChain.js integrationreferences/spring-ai-guide.md- Spring AI integrationreferences/agentic-workflows.md- Agentic workflow patternsreferences/connecting-to-ai-core.md- Connection setup guidereferences/error-handling.md- Error handling patternsreferences/v1-to-v2-migration.md- V1 to V2 migration guide
Version Information
| SDK | Current Version | Node/Java Requirement |
|---|---|---|
| JavaScript | 2.11.0+ | Node.js 20+ |
| Java | 1.19.0+ | Java 17+ (21 LTS recommended) |
Version evidence: docs/project/package-evidence/2026-06-15.json. This is package-registry evidence only, not live AI Core runtime evidence.
Note: Generated model classes (in ...model packages) may change in minor releases but are safe to use.
Common Errors
| Error | Cause | Solution |
|---|---|---|
| "Could not find service bindings for 'aicore'" | Missing AI Core binding | Bind AI Core service or set AICORE_SERVICE_KEY |
| "Orchestration deployment not found" | No deployment in resource group | Deploy orchestration in AI Core or use different resource group |
| Content filter violation | Input/output blocked | Adjust filter thresholds or modify content |
| Token limit exceeded | Response too long | Set max_tokens parameter |
Documentation Sources
Keep this skill updated using these sources:
- JS Docs: https://github.com/SAP/ai-sdk/tree/main/docs-js
- Java Docs: https://github.com/SAP/ai-sdk/tree/main/docs-java
- JS SDK: https://github.com/SAP/ai-sdk-js
- Java SDK: https://github.com/SAP/ai-sdk-java
- Release Notes: Check docs-js/release-notes.mdx and docs-java/release-notes.mdx
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: sap-cloud-sdk-ai](https://darkplay.ru/ai/skills/secondsky-sap-skills-sap-cloud-sdk-ai)
Из того же репозитория
Похожие скиллы и другие разделы каталога
Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
Java Build Resolveraffaan-m · Специалист по ошибкам сборки Java/Maven/Gradle: определяет Spring Boot или Quarkus и…
Java Revieweraffaan-m · Ревьюер Java для Spring Boot и Quarkus: архитектура, JPA, безопасность и конкурентность.
Typescript Revieweraffaan-m · Ревьюер TypeScript/JavaScript: типы, async, безопасность Node/web.
ui-ux-pro-maxnextlevelbuilder · Профессиональные знания по UI/UX-дизайну для ИИ-ассистентов программирования. Включает…
ruflo-agentruvnet · Среды выполнения агентов: локальные агенты в песочнице WASM (rvagent) и Anthropic Claude…
agentic-bundle-aas-devops-cloudsickn33 · Установите набор редакционных навыков "AAS DevOps & Cloud" для Claude Code.
agentic-bundle-azure-ai-cloudsickn33 · Установите набор редакционных навыков "Azure AI & Cloud" для Claude Code.
agentic-bundle-devops-cloudsickn33 · Установите набор редакционных навыков «DevOps & Cloud» для Claude Code.
agentic-bundle-typescript-javascriptsickn33 · Установите набор редакционных навыков «TypeScript & JavaScript» для Claude Code.
astronomer-data-agentsanthropics · Инженерия данных для Apache Airflow и Astronomer: написание DAG по лучшим практикам…Лучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-makerЛучшие ИИ-инструменты для генерации текста и копирайтинга
Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра
NeuroscribeNeuroscribe
GoGPTGogpt
НейроТекстерNeuro-texter
ChatGPTOpenAI
Cosmo ScribeCosmoscribe
Memo HelperCopilot33
LibraChatLibrachatЛучшие ИИ-инструменты для генерации изображений
Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты
MagviMagvi
DALL-E 3OpenAI
SupaLabSupalab
Freestyling.aiFreestyling
ArtGeneration.meArtgeneration
BigjpgBigjpg
Художник от VKVK
Avato AI12ai
Virton AIVirton