ui5-cap-ai-features
Both halves of an AI text feature in one package: a CDS plugin serving an AIService over SAP AI Core's Orchestration Service, and the be.wl.ai UI5 control library that calls exactly that service.
Eleven controls bound to a model through the ordinary value property — polish, spell check, tone, translate, generate, summarize, extract keywords, compare, sentiment, an input with a suggestion popover and a self-completing TextArea. The prompts live server-side in the plugin; the client sends an operation key and, where one applies, an allowlisted option such as a language or a tone. Input length limits and per-user rate limiting are enforced in the handler rather than trusted to the caller.
Facts
Where it sits
Who is behind it
In the atlas: maintains 25, contributes to 39, wrote 12@lemaiwomaintainer
Before choosing this
Conditions
LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
- § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
- § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
- § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
Also, from LLM integration§ 3: Calling a model for inference is not automatically AI training. Section 3 matters when the covered material or application participates in training, model development, refinement or the text-and-data-mining uses it names.
PracticalFunctional boundary
It is text processing, not an agent: there is no tool calling, no retrieval and no conversation. It needs SAP AI Core, and the backend half needs @sap-ai-sdk/orchestration@sap-ai-sdk/orchestrationThe Orchestration Service client of SAP's AI SDK, which applies templating, grounding, filtering and masking around a model call rather than in the application.sap official, cap installed alongside it — an optional peer, so a frontend-only install stays lean.
What it declares
Every artifact
- Type
- CDS plugin
- Origin
- Independently maintained
- Runtime
- Node.js
- Runs on
- Cloud Foundry
As a CDS plugin
- Declared for
- >=8
- Type declarations
- declared
- Distributed through
- npm
For LLM integration
- Models it reaches
- SAP AI Core
Connections
Calling a language model with tenant and credential handling solved
Stores UI5 and HTML5 apps and serves them through the approuter
Orchestration Service client for templating, grounding and masking
Product-review screen consuming ui5-cap-ai-features on CAP
Download
Install
npm add ui5-cap-ai-featuresDerived from the package name. No recipe recorded; the README has the configuration.
Learn more
- UI5 AI Features library is now an npm PackageUI5 AI Features library is now an npm PackageThe release note for a demo turning into a dependency, and it is explicit about why that matters: the earlier version worked, but using it meant cloning the repo and copying both halves, which stops working the moment one of them changes. The post walks through what shipping the CAP plugin and the be.wl.ai control library in one npm version buys — a client and server contract that cannot drift — then lists the eleven controls by group, shows the two-line configuration that activates each half, and notes that this version is actually deployed on BTP behind both a standalone approuter and Work Zone. It closes on the demo repository, written with no library source in it as the test that the package stands alone.published 2026-08-31Wouter Lemaire, SAP Community
Where it sits in your app
Download
Seen in
README
quoted from lemaiwo/ui5-ai-features under Apache-2.0, readui5-cap-ai-features
AI-powered text processing for CAP + UI5 applications — one npm package containing both halves:
- a CAP CDS plugin that serves an
AIService(/odata/v4/ai) backed by SAP AI Core's Orchestration Service - the
be.wl.aiUI5 control library (TypeScript, SAPUI5/OpenUI5) with ready-to-use AI controls that call exactly that service
Because both ship together in one version, the client/server contract (operation keys, action signature) can never drift.
| Control | Purpose |
|---|---|
AIPolishButton | Polish/improve a text (grammar, clarity, professionalism) |
AISummarizeButton | Summarize a text |
AITranslateButton | Translate a text (language picker included) |
AIToneButton | Rewrite a text in a selected tone |
AIGenerateButton | Generate text from a description |
AISpellCheckButton | Spelling/grammar corrections incl. summary of changes |
AIExtractKeywordsButton | Extract keywords from a text |
AICompareTexts | Compare two texts |
AIInputSuggestion | Input with AI improvement suggestion |
AIAutoComplete | TextArea with AI auto-completion |
AISentimentIndicator | Sentiment analysis indicator |
All prompts are maintained server-side in the plugin — clients only send an operation key plus, where applicable, an allowlisted option (a language or tone key). The handler enforces input length limits and per-user rate limiting.
Backend setup (CAP)
npm install ui5-cap-ai-features @sap-ai-sdk/orchestration
(@sap-ai-sdk/orchestration is an optional peer dependency so that pure frontend installs stay lean — backend projects install it explicitly.)
Installing alone does not activate anything. Enable the plugin in your project's cds configuration (package.json or .cdsrc.json):
{
"cds": {
"requires": {
"ai-features": true
}
}
}
Once enabled, CAP loads the AIService model from the package and serves it at /odata/v4/ai:
POST /odata/v4/ai/processText
{ "operation": "polish", "text": "text to process", "text2": null, "option": null }
Supported operations: polish, summarize, translate, tone, generate, spellcheck, spellcheckSummary, keywords, compare, suggest, autocomplete, sentiment.
The plugin also registers the AI Core service requirement ("AICORE": { "kind": "aicore" }), keeping any existing AICORE settings (such as a hybrid-profile binding) intact.
Disable it again by setting the entry to false (or removing it) — the installed package is then fully inert. Profiles work too, e.g. "[development] ai-features": true.
Requirements
@sap/cds>= 8- An SAP AI Core instance (
extendedplan). For local development, bind to it on BTP:
cds bind AICORE --to aicore --profile hybrid
cds watch --profile hybrid
Configuration
Defaults can be overridden in the cds.ai section of your project configuration:
{
"cds": {
"ai": {
"model": "anthropic--claude-4.6-sonnet",
"maxTokens": 4096,
"temperature": 0.7,
"maxTextLength": 20000,
"rateLimitWindowMs": 60000,
"rateLimitMaxRequests": 20
}
}
}
Frontend setup (UI5 app)
Add the package to your UI5 app as well:
npm install ui5-cap-ai-features
The package ships the prebuilt be.wl.ai library (dist/) together with a ui5.yaml, so the UI5 tooling (v3+) picks it up automatically as a project dependency — no extra configuration for local development with ui5 serve. In a CAP monorepo with npm workspaces, the same single install serves both the backend and the app.
Declare the library in your app's manifest.json:
"sap.ui5": {
"dependencies": {
"libs": {
"be.wl.ai": {}
}
}
}
Use the controls via the be.wl.ai namespace. The value property supports two-way binding, so accepted AI results are written back to your model:
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:ai="be.wl.ai">
<TextArea value="{/sourceText}" width="100%" rows="8" />
<OverflowToolbar>
<ai:AIPolishButton text="Polish" value="{/sourceText}" />
<ai:AISummarizeButton text="Summarize" value="{/sourceText}" />
<ai:AITranslateButton text="Translate" value="{/sourceText}" />
<ai:AIToneButton text="Change Tone" value="{/sourceText}" />
</OverflowToolbar>
</mvc:View>
Configurable properties are limited to UI texts (e.g. dialogTitle, outputLabel) and bindable values — the AI prompts themselves are maintained server-side and cannot be altered from the client.
How the controls find the AI service
The controls resolve their OData model in this order:
- A model named
aipropagated to the control (e.g. defined in your app'smanifest.json) — used automatically whenever present. - The library's shared singleton, targeting the URL set via
setAIServiceUrl(url). - Default:
/odata/v4/ai/on the same origin — CAP's default path for the plugin'sAIService. Works out of the box when the app is served from the same origin as the CAP backend: local development (cds watchserves both) and deployments behind one app router.
Consuming from a separate deployment (SAP Build Work Zone)
The backend and the app do not have to live in the same MTA/monorepo. A typical setup: one "provider" MTA deploys the CAP service and the library to the HTML5 Application Repository; other UI5 apps in their own MTAs consume both via Work Zone:
-
Library resolution: declare
"be.wl.ai": {}undersap.ui5/dependencies/libs. When both the library and your app are deployed to the HTML5 Application Repository in the same subaccount (or shared via content federation), the Work Zone runtime resolves the library from the provider's deployment — no bundling needed. -
Service connectivity: create a destination to the provider's CAP service and add a route to your app's
xs-app.json:{ "source": "^/odata/v4/ai/(.*)$", "target": "/odata/v4/ai/$1", "destination": "ai-features-srv", "authenticationType": "xsuaa" } -
Model: under the managed app router, routes are scoped to your app's path, so define the service as an app-relative dataSource and name the model
aiin yourmanifest.json— the controls pick it up automatically:"sap.app": { "dataSources": { "aiService": { "uri": "odata/v4/ai/", "type": "OData", "settings": { "odataVersion": "4.0" } } } }, "sap.ui5": { "models": { "ai": { "dataSource": "aiService" } } }Note the relative URI (no leading slash) — it resolves against your app's base path and therefore hits the route from step 2.
Alternatively, without a named model, set an explicit URL once before the first AI control is used, e.g. in Component.init:
import { setAIServiceUrl } from "be/wl/ai/AIModel";
export default class Component extends UIComponent {
public init(): void {
super.init();
setAIServiceUrl("/backend/odata/v4/ai/");
}
}
Deploying to SAP BTP from the npm package
The published package ships a ready-to-deploy HTML5 Application Repository archive at node_modules/ui5-cap-ai-features/dist/bewlai.zip (library resources with manifest.json, prebuilt and zipped). That means an MTA can deploy the library without the library's source and even without any UI5 app — for example a headless "provider" MTA containing only the CAP service and the library content for consumption by other apps via SAP Build Work Zone.
Create a small content folder in your project, e.g. ai-lib-content/package.json:
{
"name": "ai-lib-content",
"private": true,
"dependencies": { "ui5-cap-ai-features": "^1.0.0" },
"scripts": {
"copy-archive": "node -e \"const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('node_modules/ui5-cap-ai-features/dist/bewlai.zip','dist/bewlai.zip')\""
}
}
and wire it into your mta.yaml next to the CAP server module:
modules:
# ... your CAP srv module (with ai-features enabled) ...
- name: ai-provider-app-deployer
type: com.sap.application.content
path: gen
requires:
- name: ai-provider-html5-repo-host
parameters:
content-target: true
build-parameters:
build-result: app/
requires:
- artifacts: [bewlai.zip]
name: bewlai
target-path: app/
- name: bewlai
type: html5
path: ai-lib-content
build-parameters:
build-result: dist
builder: custom
commands:
- npm install
- npm run copy-archive
supported-platforms: []
resources:
- name: ai-provider-html5-repo-host
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-host
Consumer apps then resolve the library through Work Zone (see the previous section) and reach the CAP service via a destination pointing at the provider's srv URL. The same copy-archive trick also works inside a consumer's MTA if you prefer each app to deploy its own copy of the library instead of consuming a centrally provisioned one.
Development
npm install
npm run build # transpiles TypeScript and builds the be.wl.ai library into dist/
The package's ui5.yaml points at dist/, so consumers always get the prebuilt resources; prepublishOnly rebuilds dist/ (including the deployable bewlai.zip) before publishing.
Example
A complete demo project (CAP + SAPUI5 TypeScript app using this package for both halves) is available at lemaiwo/ui5-ai-features.
License
Apache-2.0
History
Others providing
Compare all 23 on the LLM integration page →- llm_clientllm_clientAn ABAP client that gives chat-completion LLM APIs one interface for chat messages, structured output and tool calls across ten providers, from OpenAI and Anthropic to OLLAMA and AWS Bedrock.independent, abapABAP client with one interface to chat-completion LLM APIsfrom ABAP
- abap-agent-runtimeabap-agent-runtimeAn ABAP-native MCP endpoint inside the SAP system: an agent reads the screen of an opted-in abap2UI5 app as structured data, fills its fields and fires its events as the logged-on SAP user.community org, abapABAP-native MCP endpoint that drives opted-in abap2UI5 appsfrom ABAP
- abap_btocs_ollamaabap_btocs_ollamaAn ABAP plugin, built on the B-Tocs ABAP SDK, that calls models served by Ollama through an SM59 RFC destination, implementing four of its API endpoints: generate, tags, show and embeddings.independent, abapB-Tocs ABAP SDK plugin connecting to Ollama modelsfrom ABAP
- SAP AI CoreSAP AI CoreSAP's AI service on BTP: the runtime for AI assets, and through the Generative AI Hub inside it the access to foundation models, the orchestration service with its templating, masking, filtering and grounding modules, the Prompt Registry and Document Grounding.sap official, btpAI runtime on BTP with the Generative AI Hubfrom BTP/BAIP
- cap-java/cds-aicap-java/cds-aiBridges CAP Java to SAP AI Core and adds AI-powered field recommendations to Fiori draft UIs, as two alpha Maven modules with mock fallbacks for local development.sap official, capBridge from CAP Java to SAP AI Core, with Fiori field recommendationsfrom CAP
- @cap-js/ai@cap-js/aiOut-of-the-box value-help recommendations powered by SAP RPT-1, SAP AI Core as a standard CAP service, and an experimental local embedding model behind SQLite's vector functions.sap official, capValue-help recommendations and SAP AI Core as a CAP servicefrom CAP
- cap-llm-plugincap-llm-pluginGenerative AI in a CAP application with the sensitive fields anonymised through SAP HANA before the prompt leaves, so the model never sees the confidential half.independent, capGenerative AI in CAP with fields anonymised through SAP HANAfrom CAP
- @geertjanklaps/cds-toon-ai-protocol-adapter@geertjanklaps/cds-toon-ai-protocol-adapterA protocol adapter that serves CAP data as TOON — Token-Oriented Object Notation — instead of JSON, so a payload bound for a language model costs fewer tokens to send.independent, capProtocol adapter serving CAP data as TOON instead of JSONfrom CAP
- abap-sdk-nwas-xabap-sdk-nwas-xAn ABAP client library for IBM's watsonx.ai and watsonx.ai Runtime APIs, installed into an SAP NetWeaver AS ABAP system through abapGit, generating and refreshing the IAM token from an API key.independent, abapABAP client library for IBM watsonx.ai APIsfrom ABAP
- @jerome-benoit/sap-ai-provider@jerome-benoit/sap-ai-providerA provider for the Vercel AI SDK that speaks to SAP AI Core through its orchestration or foundation models API, so an application written against that SDK runs on SAP's models without being rewritten.independent, capVercel AI SDK provider for SAP AI Corefrom CAP
- Microsoft AI SDK for SAPMicrosoft AI SDK for SAPMicrosoft's ABAP library for calling Azure OpenAI and OpenAI from an SAP application server, wrapping completions, embeddings, fine-tuning and the other operations in ABAP data types, installed with abapGit.partner, abapABAP library for calling Azure OpenAI and OpenAIfrom ABAP
- zllmzllmAn ABAP framework for chaining and orchestrating calls to large language models in pure ABAP, with templated prompts, routing by complexity, response caching and token estimation.independent, abapABAP framework for chaining and orchestrating LLM callsfrom ABAP
- ABAP AI SDKABAP AI SDKSAP's reuse library for calling a large language model from ABAP code, powered by Intelligent Scenario Lifecycle Management and reaching the models in the Generative AI Hub; delivered with SAP BTP ABAP environment, SAP S/4HANA Cloud Public and Private Edition and SAP S/4HANA.sap official, abapSAP reuse library for calling large language models from ABAPfrom ABAP
- @sap-ai-sdk/ai-api@sap-ai-sdk/ai-apiThe AI Core API surface of SAP's AI SDK, covering deployments, configurations and the rest of the control plane, as opposed to calling a model.sap official, capAI Core control plane API surface of SAP's AI SDKfrom CAP
- @sap-ai-sdk/core@sap-ai-sdk/coreThe shared internals that the packages of SAP's AI SDK build on, which its own readme says are not meant to be depended on directly.sap official, capShared internals of SAP's AI SDKfrom CAP
- @sap-ai-sdk/foundation-models@sap-ai-sdk/foundation-modelsThe package of SAP's AI SDK that calls foundation models through SAP AI Core and the Generative AI Hub, and the one an application actually reaches for.sap official, capClient for foundation models via SAP AI Core and Generative AI Hubfrom CAP
- @sap-ai-sdk/orchestration@sap-ai-sdk/orchestrationThe Orchestration Service client of SAP's AI SDK, which applies templating, grounding, filtering and masking around a model call rather than in the application.sap official, capOrchestration Service client for templating, grounding and maskingfrom CAP
- @sap-ai-sdk/prompt-registry@sap-ai-sdk/prompt-registryA package for keeping prompts in SAP's prompt registry rather than in the codebase, so changing a prompt is not a deployment.sap official, capClient for prompts kept in SAP's prompt registryfrom CAP
- @saptarishi/cds-plugin-llm@saptarishi/cds-plugin-llmA CAP service kind that puts eleven model providers behind one chat, stream, embed and batch interface, so which backend a service calls is a profile in package.json rather than a change to the handler.independent, capCAP service kind putting eleven model providers behind one APIfrom CAP
- @shahid.la/cds-db-nlquery-mcp@shahid.la/cds-db-nlquery-mcpMCP server that answers plain-English questions against the entities in db/schema.cds — it discovers the schema, generates CQN-backed SQL with real joins, and returns rows.independent, capMCP server answering plain-English questions against a CDS schemafrom CAP
- @ui5/webcomponents@ui5/webcomponentsSAP's UI elements as standard custom elements, ui5-button among them, implementing SAP Fiori design and usable from plain HTML, React, Angular or Vue.sap official, ui5SAP's UI elements as standard custom elementsfrom UI5
- abap-sdk-nwasabap-sdk-nwasAn ABAP client library for IBM Watson's Discovery, Language Translator, Natural Language Understanding, Speech to Text, Text to Speech and Assistant services, installed through abapGit.independent, abapAn ABAP client library for IBM Watson's Discovery, Language Translator, Natural Language Understanding, Speech to Text, Text to Speech and Assistant services, installed through abapGit.from ABAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Flavors
“the `be.wl.ai` UI5 control library (AI Polish Button, AI Translate Button, AI Autocomplete, ...) that calls it” — lemaiwo/ui5-ai-features — README
History in the atlas
- model_access: SAP AI Core, and the README sentence that names the service the AIService is backed by
- conditional, with the README's optional-peer sentence quoted
- First seen.
For your agent
- Ref
artifact:lemaiwo-ui5-cap-ai-features- JSON
- /artifacts/lemaiwo-ui5-cap-ai-features.json
- MCP
- Connecting an agent