How sap/ai-sdk-js works
SAP Cloud SDK for AI is a multi-package JavaScript/TypeScript SDK for SAP AI Core, Generative AI Hub, and Orchestration Service. An application selects a client and submits management, inference, orchestration, or grounding requests; the SDK resolves deployment context where applicable and sends service requests. The graph preserves the README’s documented package capabilities and uses sampled imports to show selected internal dependencies. Several package internals were not sampled, so their relationships are limited to documented capabilities rather than assumed call chains.
Main entry points: orchestration-client.ts Orchestration Client · repository-api.ts AI Core APIs · http-client.ts HTTP Client · azure-openai-embedding-client.ts Foundation Models
Components 18
AI Core Management
- AI Core APIs
packages/ai-api/src/client/AI_CORE_API/repository-api.ts - Deployment Management
sample-code/src/ai-api/deployment-api.ts - Scenario Access
sample-code/src/ai-api/scenario-api.ts
Model Inference
- Foundation Models
packages/foundation-models/src/azure-openai/azure-openai-embedding-client.ts - OpenAI Client
packages/openai/src/client.ts - Realtime Client
packages/openai/src/realtime/realtime-client.ts - RPT Predictions
packages/rpt/src/client.ts - Batch Jobs
packages/llm-batch/src/client/batch-service/batches-api.ts
Orchestration Services
- Orchestration Client
packages/orchestration/src/orchestration-client.ts - Orchestration Embeddings
packages/orchestration/src/orchestration-embedding-client.ts - LangChain Adapter
packages/langchain/src/orchestration/client.ts - Document Grounding
packages/document-grounding/src/client/api/pipelines-api.ts - Prompt Registry
packages/prompt-registry/src/client/prompt-registry/orchestration-configs-api.ts - Tabular Orchestration
packages/tabular-orchestration/src/client/tabular-orchestration/predict-api.ts - Context Registry
packages/context-registry/src/client/context-registry/scenario-configuration-manager-api.ts
SDK Foundation
- HTTP Client
packages/core/src/http-client.ts - OpenAI Context
packages/openai/src/config.ts
Other components
- Application
Connections 25
- Application → AI Core APIs: manages AI Core
README.md - Application → Foundation Models: uses models
README.md - Application → OpenAI Client: creates client
packages/openai/src/client.ts - Application → Orchestration Client: requests orchestration
README.md - Application → Document Grounding: uses grounding
README.md - Application → Prompt Registry: uses registry
README.md - Application → LangChain Adapter: uses adapter
README.md - Application → Batch Jobs: submits batch jobs
README.md - Application → RPT Predictions: requests predictions
packages/rpt/src/client.ts - Application → Tabular Orchestration: requests predictions
- Application → Context Registry: manages context
- Application → Realtime Client: uses realtime
- Application → Deployment Management: manages deployments
README.md - Application → Scenario Access: manages scenarios
README.md - Orchestration Client → AI Core APIs: resolves deployment
packages/orchestration/src/orchestration-client.ts - Orchestration Client → HTTP Client: executes requests
packages/orchestration/src/orchestration-client.ts - Orchestration Client → Prompt Registry: uses registry types
packages/orchestration/src/orchestration-client.ts - Orchestration Embeddings → AI Core APIs: resolves deployment
packages/orchestration/src/orchestration-embedding-client.ts - Orchestration Embeddings → HTTP Client: executes requests
packages/orchestration/src/orchestration-embedding-client.ts - LangChain Adapter → Orchestration Client: delegates calls
packages/langchain/src/orchestration/client.ts - Document Grounding → HTTP Client: builds requests
packages/document-grounding/src/client/api/pipelines-api.ts - OpenAI Client → OpenAI Context: creates context
packages/openai/src/client.ts - OpenAI Client → Realtime Client: offers realtime
- Foundation Models → AI Core APIs: resolves deployment
packages/foundation-models/src/azure-openai/azure-openai-embedding-client.ts - Foundation Models → HTTP Client: executes requests
packages/foundation-models/src/azure-openai/azure-openai-embedding-client.ts