@jerome-benoit/sap-ai-provider 4.4.15 → 4.4.17
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/README.md +10 -0
- package/dist/{chunk-CXZSTU4M.js → chunk-43B7TGUQ.js} +3 -3
- package/dist/{chunk-JV2ULRVE.js → chunk-MNXW5WBP.js} +65 -70
- package/dist/{chunk-JV2ULRVE.js.map → chunk-MNXW5WBP.js.map} +1 -1
- package/dist/{chunk-3JJ7OXMW.js → chunk-OOIFG33A.js} +2 -2
- package/dist/chunk-YPD3UZCL.js +54 -0
- package/dist/chunk-YPD3UZCL.js.map +1 -0
- package/dist/foundation-models-embedding-model-strategy-FYYPJCZ3.js +59 -0
- package/dist/foundation-models-embedding-model-strategy-FYYPJCZ3.js.map +1 -0
- package/dist/{foundation-models-language-model-strategy-ZCRPVWAV.js → foundation-models-language-model-strategy-QODADI4V.js} +4 -4
- package/dist/index.cjs +173 -152
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/orchestration-embedding-model-strategy-RMTIMOLO.js +60 -0
- package/dist/orchestration-embedding-model-strategy-RMTIMOLO.js.map +1 -0
- package/dist/{orchestration-language-model-strategy-NEW76M3M.js → orchestration-language-model-strategy-FUT3R3MK.js} +4 -4
- package/dist/orchestration-language-model-strategy-FUT3R3MK.js.map +1 -0
- package/package.json +5 -5
- package/dist/foundation-models-embedding-model-strategy-OEKTLGZN.js +0 -69
- package/dist/foundation-models-embedding-model-strategy-OEKTLGZN.js.map +0 -1
- package/dist/orchestration-embedding-model-strategy-QRHQIEEK.js +0 -79
- package/dist/orchestration-embedding-model-strategy-QRHQIEEK.js.map +0 -1
- package/dist/orchestration-language-model-strategy-NEW76M3M.js.map +0 -1
- /package/dist/{chunk-CXZSTU4M.js.map → chunk-43B7TGUQ.js.map} +0 -0
- /package/dist/{chunk-3JJ7OXMW.js.map → chunk-OOIFG33A.js.map} +0 -0
- /package/dist/{foundation-models-language-model-strategy-ZCRPVWAV.js.map → foundation-models-language-model-strategy-QODADI4V.js.map} +0 -0
package/README.md
CHANGED
|
@@ -262,6 +262,16 @@ const chatModel = provider.chat("gpt-4.1");
|
|
|
262
262
|
const embeddingModel = provider.embedding("text-embedding-3-small");
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
+
**Available methods:**
|
|
266
|
+
|
|
267
|
+
| Method | Description |
|
|
268
|
+
| ---------------------------------- | --------------------------------------------- |
|
|
269
|
+
| `provider(modelId)` | Callable syntax, creates language model |
|
|
270
|
+
| `provider.chat(modelId)` | Creates language model (alias) |
|
|
271
|
+
| `provider.languageModel(modelId)` | Creates language model (ProviderV3 standard) |
|
|
272
|
+
| `provider.embedding(modelId)` | Creates embedding model |
|
|
273
|
+
| `provider.embeddingModel(modelId)` | Creates embedding model (ProviderV3 standard) |
|
|
274
|
+
|
|
265
275
|
All methods accept an optional second parameter for model-specific settings.
|
|
266
276
|
|
|
267
277
|
## Authentication
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
createAISDKRequestBodySummary,
|
|
10
10
|
createStreamTransformer,
|
|
11
11
|
mapToolChoice
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OOIFG33A.js";
|
|
13
13
|
import {
|
|
14
14
|
VERSION,
|
|
15
15
|
convertToAISDKError,
|
|
16
16
|
getProviderName,
|
|
17
17
|
normalizeHeaders,
|
|
18
18
|
sapAILanguageModelProviderOptions
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MNXW5WBP.js";
|
|
20
20
|
|
|
21
21
|
// src/base-language-model-strategy.ts
|
|
22
22
|
import { parseProviderOptions } from "@ai-sdk/provider-utils";
|
|
@@ -181,4 +181,4 @@ var BaseLanguageModelStrategy = class {
|
|
|
181
181
|
export {
|
|
182
182
|
BaseLanguageModelStrategy
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-43B7TGUQ.js.map
|
|
@@ -29876,72 +29876,6 @@ var sapAIEmbeddingProviderOptions = lazySchema(
|
|
|
29876
29876
|
)
|
|
29877
29877
|
);
|
|
29878
29878
|
|
|
29879
|
-
// src/deep-merge.ts
|
|
29880
|
-
var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
29881
|
-
var MAX_DEPTH = 100;
|
|
29882
|
-
function deepMerge(...sources) {
|
|
29883
|
-
return mergeInternal(sources);
|
|
29884
|
-
}
|
|
29885
|
-
function cloneDeep(obj, seen, depth) {
|
|
29886
|
-
if (depth > MAX_DEPTH) {
|
|
29887
|
-
throw new Error("Maximum merge depth exceeded");
|
|
29888
|
-
}
|
|
29889
|
-
if (seen.has(obj)) {
|
|
29890
|
-
throw new Error("Circular reference detected during deep merge");
|
|
29891
|
-
}
|
|
29892
|
-
seen.add(obj);
|
|
29893
|
-
const result = {};
|
|
29894
|
-
for (const key of Object.keys(obj)) {
|
|
29895
|
-
if (!isSafeKey(key)) continue;
|
|
29896
|
-
const value = obj[key];
|
|
29897
|
-
result[key] = isPlainObject(value) ? cloneDeep(value, seen, depth + 1) : value;
|
|
29898
|
-
}
|
|
29899
|
-
return result;
|
|
29900
|
-
}
|
|
29901
|
-
function isPlainObject(value) {
|
|
29902
|
-
if (value === null || typeof value !== "object") return false;
|
|
29903
|
-
const proto = Object.getPrototypeOf(value);
|
|
29904
|
-
return proto === Object.prototype || proto === null;
|
|
29905
|
-
}
|
|
29906
|
-
function isSafeKey(key) {
|
|
29907
|
-
return !DANGEROUS_KEYS.has(key);
|
|
29908
|
-
}
|
|
29909
|
-
function mergeInternal(sources) {
|
|
29910
|
-
let result = {};
|
|
29911
|
-
for (const source of sources) {
|
|
29912
|
-
if (source == null) continue;
|
|
29913
|
-
result = mergeTwo(result, source, /* @__PURE__ */ new WeakSet(), 0);
|
|
29914
|
-
}
|
|
29915
|
-
return result;
|
|
29916
|
-
}
|
|
29917
|
-
function mergeTwo(target, source, seen, depth) {
|
|
29918
|
-
if (depth > MAX_DEPTH) {
|
|
29919
|
-
throw new Error("Maximum merge depth exceeded");
|
|
29920
|
-
}
|
|
29921
|
-
if (seen.has(source)) {
|
|
29922
|
-
throw new Error("Circular reference detected during deep merge");
|
|
29923
|
-
}
|
|
29924
|
-
seen.add(source);
|
|
29925
|
-
for (const key of Object.keys(source)) {
|
|
29926
|
-
if (!isSafeKey(key)) continue;
|
|
29927
|
-
const sourceValue = source[key];
|
|
29928
|
-
const targetValue = target[key];
|
|
29929
|
-
if (isPlainObject(sourceValue) && isPlainObject(targetValue)) {
|
|
29930
|
-
target[key] = mergeTwo(
|
|
29931
|
-
cloneDeep(targetValue, /* @__PURE__ */ new WeakSet(), depth + 1),
|
|
29932
|
-
sourceValue,
|
|
29933
|
-
seen,
|
|
29934
|
-
depth + 1
|
|
29935
|
-
);
|
|
29936
|
-
} else if (isPlainObject(sourceValue)) {
|
|
29937
|
-
target[key] = cloneDeep(sourceValue, seen, depth + 1);
|
|
29938
|
-
} else {
|
|
29939
|
-
target[key] = sourceValue;
|
|
29940
|
-
}
|
|
29941
|
-
}
|
|
29942
|
-
return target;
|
|
29943
|
-
}
|
|
29944
|
-
|
|
29945
29879
|
// src/sap-ai-error.ts
|
|
29946
29880
|
var import_util = __toESM(require_dist(), 1);
|
|
29947
29881
|
import { APICallError, LoadAPIKeyError, NoSuchModelError } from "@ai-sdk/provider";
|
|
@@ -30223,7 +30157,7 @@ See: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-serv
|
|
|
30223
30157
|
return new NoSuchModelError({
|
|
30224
30158
|
message: `SAP AI Core deployment error: ${originalErrorMsg}
|
|
30225
30159
|
|
|
30226
|
-
Make sure you have a running orchestration deployment in your AI Core instance.
|
|
30160
|
+
Make sure you have a running orchestration deployment in your SAP AI Core instance.
|
|
30227
30161
|
See: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-orchestration`,
|
|
30228
30162
|
modelId: modelId ?? "unknown",
|
|
30229
30163
|
modelType: "languageModel"
|
|
@@ -30430,8 +30364,69 @@ function tryExtractSAPErrorFromMessage(message) {
|
|
|
30430
30364
|
}
|
|
30431
30365
|
}
|
|
30432
30366
|
|
|
30367
|
+
// src/deep-merge.ts
|
|
30368
|
+
var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
30369
|
+
var MAX_DEPTH = 100;
|
|
30370
|
+
function deepMerge(...sources) {
|
|
30371
|
+
return mergeInternal(sources);
|
|
30372
|
+
}
|
|
30373
|
+
function cloneDeep(obj, seen, depth) {
|
|
30374
|
+
if (depth > MAX_DEPTH) {
|
|
30375
|
+
throw new Error("Maximum merge depth exceeded");
|
|
30376
|
+
}
|
|
30377
|
+
if (seen.has(obj)) {
|
|
30378
|
+
throw new Error("Circular reference detected during deep merge");
|
|
30379
|
+
}
|
|
30380
|
+
seen.add(obj);
|
|
30381
|
+
const result = {};
|
|
30382
|
+
for (const key of Object.keys(obj)) {
|
|
30383
|
+
if (!isSafeKey(key)) continue;
|
|
30384
|
+
const value = obj[key];
|
|
30385
|
+
result[key] = isPlainObject(value) ? cloneDeep(value, seen, depth + 1) : value;
|
|
30386
|
+
}
|
|
30387
|
+
return result;
|
|
30388
|
+
}
|
|
30389
|
+
function isPlainObject(value) {
|
|
30390
|
+
if (value === null || typeof value !== "object") return false;
|
|
30391
|
+
const proto = Object.getPrototypeOf(value);
|
|
30392
|
+
return proto === Object.prototype || proto === null;
|
|
30393
|
+
}
|
|
30394
|
+
function isSafeKey(key) {
|
|
30395
|
+
return !DANGEROUS_KEYS.has(key);
|
|
30396
|
+
}
|
|
30397
|
+
function mergeInternal(sources) {
|
|
30398
|
+
let result = {};
|
|
30399
|
+
for (const source of sources) {
|
|
30400
|
+
if (source == null) continue;
|
|
30401
|
+
result = mergeTwo(result, source, /* @__PURE__ */ new WeakSet(), 0);
|
|
30402
|
+
}
|
|
30403
|
+
return result;
|
|
30404
|
+
}
|
|
30405
|
+
function mergeTwo(target, source, seen, depth) {
|
|
30406
|
+
if (depth > MAX_DEPTH) {
|
|
30407
|
+
throw new Error("Maximum merge depth exceeded");
|
|
30408
|
+
}
|
|
30409
|
+
if (seen.has(source)) {
|
|
30410
|
+
throw new Error("Circular reference detected during deep merge");
|
|
30411
|
+
}
|
|
30412
|
+
seen.add(source);
|
|
30413
|
+
for (const key of Object.keys(source)) {
|
|
30414
|
+
if (!isSafeKey(key)) continue;
|
|
30415
|
+
const sourceValue = source[key];
|
|
30416
|
+
const targetValue = target[key];
|
|
30417
|
+
if (isPlainObject(sourceValue) && isPlainObject(targetValue)) {
|
|
30418
|
+
target[key] = mergeTwo(cloneDeep(targetValue, seen, depth + 1), sourceValue, seen, depth + 1);
|
|
30419
|
+
} else if (isPlainObject(sourceValue)) {
|
|
30420
|
+
target[key] = cloneDeep(sourceValue, seen, depth + 1);
|
|
30421
|
+
} else {
|
|
30422
|
+
target[key] = sourceValue;
|
|
30423
|
+
}
|
|
30424
|
+
}
|
|
30425
|
+
return target;
|
|
30426
|
+
}
|
|
30427
|
+
|
|
30433
30428
|
// src/version.ts
|
|
30434
|
-
var VERSION = true ? "4.4.
|
|
30429
|
+
var VERSION = true ? "4.4.17" : "0.0.0-test";
|
|
30435
30430
|
|
|
30436
30431
|
export {
|
|
30437
30432
|
__toESM,
|
|
@@ -30443,12 +30438,12 @@ export {
|
|
|
30443
30438
|
orchestrationConfigRefSchema,
|
|
30444
30439
|
sapAILanguageModelProviderOptions,
|
|
30445
30440
|
sapAIEmbeddingProviderOptions,
|
|
30446
|
-
deepMerge,
|
|
30447
30441
|
require_dist,
|
|
30448
30442
|
ApiSwitchError,
|
|
30449
30443
|
UnsupportedFeatureError,
|
|
30450
30444
|
convertToAISDKError,
|
|
30451
30445
|
normalizeHeaders,
|
|
30446
|
+
deepMerge,
|
|
30452
30447
|
VERSION
|
|
30453
30448
|
};
|
|
30454
30449
|
/*! Bundled license information:
|
|
@@ -30484,4 +30479,4 @@ mime-types/index.js:
|
|
|
30484
30479
|
axios/dist/node/axios.cjs:
|
|
30485
30480
|
(*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
30486
30481
|
*/
|
|
30487
|
-
//# sourceMappingURL=chunk-
|
|
30482
|
+
//# sourceMappingURL=chunk-MNXW5WBP.js.map
|