@jerome-benoit/sap-ai-provider 4.2.6 → 4.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +15 -15
- package/dist/index.cjs +161 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +161 -140
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/LICENSE.md
CHANGED
|
@@ -173,7 +173,7 @@ APPENDIX: How to apply the Apache License to your work.
|
|
|
173
173
|
same "printed page" as the copyright notice for easier
|
|
174
174
|
identification within third-party archives.
|
|
175
175
|
|
|
176
|
-
Copyright 2026
|
|
176
|
+
Copyright 2026 Jérôme Benoit
|
|
177
177
|
|
|
178
178
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
179
179
|
this file except in compliance with the License. You may obtain a copy of the
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SAP AI Core Provider for Vercel AI SDK
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@jerome-benoit/sap-ai-provider)
|
|
4
4
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
5
|
[](https://sdk.vercel.ai/docs)
|
|
6
6
|
[](https://sdk.vercel.ai/docs/ai-sdk-core/provider-management)
|
|
@@ -75,12 +75,12 @@ familiar Vercel AI SDK interface.
|
|
|
75
75
|
## Quick Start
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
npm install @
|
|
78
|
+
npm install @jerome-benoit/sap-ai-provider ai
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
```typescript
|
|
82
82
|
import "dotenv/config"; // Load environment variables
|
|
83
|
-
import { createSAPAIProvider } from "@
|
|
83
|
+
import { createSAPAIProvider } from "@jerome-benoit/sap-ai-provider";
|
|
84
84
|
import { generateText } from "ai";
|
|
85
85
|
import { APICallError } from "@ai-sdk/provider";
|
|
86
86
|
|
|
@@ -112,7 +112,7 @@ try {
|
|
|
112
112
|
|
|
113
113
|
| Task | Code Pattern | Documentation |
|
|
114
114
|
| ------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
115
|
-
| **Install** | `npm install @
|
|
115
|
+
| **Install** | `npm install @jerome-benoit/sap-ai-provider ai` | [Installation](#installation) |
|
|
116
116
|
| **Auth Setup** | Add `AICORE_SERVICE_KEY` to `.env` | [Environment Setup](./ENVIRONMENT_SETUP.md) |
|
|
117
117
|
| **Create Provider** | `createSAPAIProvider()` or use `sapai` | [Provider Creation](#provider-creation) |
|
|
118
118
|
| **Text Generation** | `generateText({ model: provider("gpt-4o"), prompt })` | [Basic Usage](#text-generation) |
|
|
@@ -127,17 +127,17 @@ try {
|
|
|
127
127
|
**Requirements:** Node.js 18+ and Vercel AI SDK 6.0+
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
|
-
npm install @
|
|
130
|
+
npm install @jerome-benoit/sap-ai-provider ai
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
Or with other package managers:
|
|
134
134
|
|
|
135
135
|
```bash
|
|
136
136
|
# Yarn
|
|
137
|
-
yarn add @
|
|
137
|
+
yarn add @jerome-benoit/sap-ai-provider ai
|
|
138
138
|
|
|
139
139
|
# pnpm
|
|
140
|
-
pnpm add @
|
|
140
|
+
pnpm add @jerome-benoit/sap-ai-provider ai
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
## Provider Creation
|
|
@@ -148,7 +148,7 @@ You can create an SAP AI provider in two ways:
|
|
|
148
148
|
|
|
149
149
|
```typescript
|
|
150
150
|
import "dotenv/config"; // Load environment variables
|
|
151
|
-
import { createSAPAIProvider } from "@
|
|
151
|
+
import { createSAPAIProvider } from "@jerome-benoit/sap-ai-provider";
|
|
152
152
|
|
|
153
153
|
const provider = createSAPAIProvider({
|
|
154
154
|
resourceGroup: "production",
|
|
@@ -160,7 +160,7 @@ const provider = createSAPAIProvider({
|
|
|
160
160
|
|
|
161
161
|
```typescript
|
|
162
162
|
import "dotenv/config"; // Load environment variables
|
|
163
|
-
import { sapai } from "@
|
|
163
|
+
import { sapai } from "@jerome-benoit/sap-ai-provider";
|
|
164
164
|
import { generateText } from "ai";
|
|
165
165
|
|
|
166
166
|
// Use directly with auto-detected configuration
|
|
@@ -250,7 +250,7 @@ for await (const delta of result.textStream) {
|
|
|
250
250
|
|
|
251
251
|
```typescript
|
|
252
252
|
import "dotenv/config"; // Load environment variables
|
|
253
|
-
import { createSAPAIProvider } from "@
|
|
253
|
+
import { createSAPAIProvider } from "@jerome-benoit/sap-ai-provider";
|
|
254
254
|
import { generateText } from "ai";
|
|
255
255
|
|
|
256
256
|
const provider = createSAPAIProvider();
|
|
@@ -282,7 +282,7 @@ search, and similarity matching.
|
|
|
282
282
|
|
|
283
283
|
```typescript
|
|
284
284
|
import "dotenv/config"; // Load environment variables
|
|
285
|
-
import { createSAPAIProvider } from "@
|
|
285
|
+
import { createSAPAIProvider } from "@jerome-benoit/sap-ai-provider";
|
|
286
286
|
import { embed, embedMany } from "ai";
|
|
287
287
|
|
|
288
288
|
const provider = createSAPAIProvider();
|
|
@@ -415,7 +415,7 @@ Use SAP's Data Privacy Integration to mask sensitive data:
|
|
|
415
415
|
[API Reference - Data Masking](./API_REFERENCE.md#builddpimaskingproviderconfig)
|
|
416
416
|
|
|
417
417
|
```typescript
|
|
418
|
-
import { buildDpiMaskingProvider } from "@
|
|
418
|
+
import { buildDpiMaskingProvider } from "@jerome-benoit/sap-ai-provider";
|
|
419
419
|
|
|
420
420
|
const dpiConfig = buildDpiMaskingProvider({
|
|
421
421
|
method: "anonymization",
|
|
@@ -429,7 +429,7 @@ const dpiConfig = buildDpiMaskingProvider({
|
|
|
429
429
|
|
|
430
430
|
```typescript
|
|
431
431
|
import "dotenv/config"; // Load environment variables
|
|
432
|
-
import { buildAzureContentSafetyFilter, createSAPAIProvider } from "@
|
|
432
|
+
import { buildAzureContentSafetyFilter, createSAPAIProvider } from "@jerome-benoit/sap-ai-provider";
|
|
433
433
|
|
|
434
434
|
const provider = createSAPAIProvider({
|
|
435
435
|
defaultSettings: {
|
|
@@ -735,7 +735,7 @@ instructions.**
|
|
|
735
735
|
## Important Note
|
|
736
736
|
|
|
737
737
|
> **Third-Party Provider**: This SAP AI Core provider
|
|
738
|
-
> (`@
|
|
738
|
+
> (`@jerome-benoit/sap-ai-provider`) is developed and maintained by jerome-benoit, not
|
|
739
739
|
> by SAP SE. While it uses the official SAP AI SDK and integrates with SAP AI
|
|
740
740
|
> Core services, it is not an official SAP product.
|
|
741
741
|
|
|
@@ -762,7 +762,7 @@ for details.
|
|
|
762
762
|
|
|
763
763
|
### Community
|
|
764
764
|
|
|
765
|
-
- 🐛 [Issue Tracker](https://github.com/
|
|
765
|
+
- 🐛 [Issue Tracker](https://github.com/jerome-benoit/sap-ai-provider/issues) - Report
|
|
766
766
|
bugs, request features, and ask questions
|
|
767
767
|
|
|
768
768
|
### Related Projects
|