@jerome-benoit/sap-ai-provider 4.4.15 → 4.4.16
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-JV2ULRVE.js → chunk-U5TGXMXL.js} +69 -69
- package/dist/{chunk-JV2ULRVE.js.map → chunk-U5TGXMXL.js.map} +1 -1
- package/dist/{chunk-3JJ7OXMW.js → chunk-X3RVS75R.js} +2 -2
- package/dist/chunk-YWOWXJGS.js +54 -0
- package/dist/chunk-YWOWXJGS.js.map +1 -0
- package/dist/{chunk-CXZSTU4M.js → chunk-ZTTUNOQ4.js} +3 -3
- package/dist/foundation-models-embedding-model-strategy-3AL3KDCE.js +58 -0
- package/dist/foundation-models-embedding-model-strategy-3AL3KDCE.js.map +1 -0
- package/dist/{foundation-models-language-model-strategy-ZCRPVWAV.js → foundation-models-language-model-strategy-X6RMOTAL.js} +4 -4
- package/dist/index.cjs +169 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/orchestration-embedding-model-strategy-VCSK76HX.js +60 -0
- package/dist/orchestration-embedding-model-strategy-VCSK76HX.js.map +1 -0
- package/dist/{orchestration-language-model-strategy-NEW76M3M.js → orchestration-language-model-strategy-YFINEDMS.js} +4 -4
- 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/{chunk-3JJ7OXMW.js.map → chunk-X3RVS75R.js.map} +0 -0
- /package/dist/{chunk-CXZSTU4M.js.map → chunk-ZTTUNOQ4.js.map} +0 -0
- /package/dist/{foundation-models-language-model-strategy-ZCRPVWAV.js.map → foundation-models-language-model-strategy-X6RMOTAL.js.map} +0 -0
- /package/dist/{orchestration-language-model-strategy-NEW76M3M.js.map → orchestration-language-model-strategy-YFINEDMS.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
|
|
@@ -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";
|
|
@@ -30430,8 +30364,74 @@ 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(
|
|
30419
|
+
cloneDeep(targetValue, /* @__PURE__ */ new WeakSet(), depth + 1),
|
|
30420
|
+
sourceValue,
|
|
30421
|
+
seen,
|
|
30422
|
+
depth + 1
|
|
30423
|
+
);
|
|
30424
|
+
} else if (isPlainObject(sourceValue)) {
|
|
30425
|
+
target[key] = cloneDeep(sourceValue, seen, depth + 1);
|
|
30426
|
+
} else {
|
|
30427
|
+
target[key] = sourceValue;
|
|
30428
|
+
}
|
|
30429
|
+
}
|
|
30430
|
+
return target;
|
|
30431
|
+
}
|
|
30432
|
+
|
|
30433
30433
|
// src/version.ts
|
|
30434
|
-
var VERSION = true ? "4.4.
|
|
30434
|
+
var VERSION = true ? "4.4.16" : "0.0.0-test";
|
|
30435
30435
|
|
|
30436
30436
|
export {
|
|
30437
30437
|
__toESM,
|
|
@@ -30443,12 +30443,12 @@ export {
|
|
|
30443
30443
|
orchestrationConfigRefSchema,
|
|
30444
30444
|
sapAILanguageModelProviderOptions,
|
|
30445
30445
|
sapAIEmbeddingProviderOptions,
|
|
30446
|
-
deepMerge,
|
|
30447
30446
|
require_dist,
|
|
30448
30447
|
ApiSwitchError,
|
|
30449
30448
|
UnsupportedFeatureError,
|
|
30450
30449
|
convertToAISDKError,
|
|
30451
30450
|
normalizeHeaders,
|
|
30451
|
+
deepMerge,
|
|
30452
30452
|
VERSION
|
|
30453
30453
|
};
|
|
30454
30454
|
/*! Bundled license information:
|
|
@@ -30484,4 +30484,4 @@ mime-types/index.js:
|
|
|
30484
30484
|
axios/dist/node/axios.cjs:
|
|
30485
30485
|
(*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
30486
30486
|
*/
|
|
30487
|
-
//# sourceMappingURL=chunk-
|
|
30487
|
+
//# sourceMappingURL=chunk-U5TGXMXL.js.map
|