@jerome-benoit/sap-ai-provider-v2 4.9.0 → 4.9.1
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/dist/{chunk-3KCERYUB.js → chunk-5EDF6MHL.js} +3 -3
- package/dist/{chunk-RW6WSPU2.js → chunk-5JVF4555.js} +3 -3
- package/dist/{chunk-4PLJVJX4.js → chunk-5ZKQJNHO.js} +40 -3
- package/dist/{chunk-4PLJVJX4.js.map → chunk-5ZKQJNHO.js.map} +1 -1
- package/dist/{chunk-4SQ5HC6Y.js → chunk-RJFB6VFO.js} +2 -2
- package/dist/{chunk-33WLQYKB.js → chunk-VHZSAQBJ.js} +2 -2
- package/dist/{foundation-models-embedding-model-strategy-RVJQSJPU.js → foundation-models-embedding-model-strategy-VKBRG7RT.js} +4 -4
- package/dist/{foundation-models-language-model-strategy-UWJ6FHBI.js → foundation-models-language-model-strategy-FBGKZSTU.js} +4 -4
- package/dist/index.cjs +53 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{orchestration-embedding-model-strategy-OMIXGLHJ.js → orchestration-embedding-model-strategy-DVPO2TP3.js} +5 -5
- package/dist/{orchestration-language-model-strategy-UE7OQO5K.js → orchestration-language-model-strategy-KEJWB4E2.js} +18 -9
- package/dist/orchestration-language-model-strategy-KEJWB4E2.js.map +1 -0
- package/package.json +1 -3
- package/dist/orchestration-language-model-strategy-UE7OQO5K.js.map +0 -1
- /package/dist/{chunk-3KCERYUB.js.map → chunk-5EDF6MHL.js.map} +0 -0
- /package/dist/{chunk-RW6WSPU2.js.map → chunk-5JVF4555.js.map} +0 -0
- /package/dist/{chunk-4SQ5HC6Y.js.map → chunk-RJFB6VFO.js.map} +0 -0
- /package/dist/{chunk-33WLQYKB.js.map → chunk-VHZSAQBJ.js.map} +0 -0
- /package/dist/{foundation-models-embedding-model-strategy-RVJQSJPU.js.map → foundation-models-embedding-model-strategy-VKBRG7RT.js.map} +0 -0
- /package/dist/{foundation-models-language-model-strategy-UWJ6FHBI.js.map → foundation-models-language-model-strategy-FBGKZSTU.js.map} +0 -0
- /package/dist/{orchestration-embedding-model-strategy-OMIXGLHJ.js.map → orchestration-embedding-model-strategy-DVPO2TP3.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ApiSwitchError,
|
|
4
4
|
UnsupportedFeatureError,
|
|
5
5
|
deepMerge
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5ZKQJNHO.js";
|
|
7
7
|
|
|
8
8
|
// src/sap-ai-validation.ts
|
|
9
9
|
function validateEscapeTemplatePlaceholders(api, escapeTemplatePlaceholders) {
|
|
@@ -187,4 +187,4 @@ export {
|
|
|
187
187
|
validateMaskingProvidersDeprecation,
|
|
188
188
|
validateSettings
|
|
189
189
|
};
|
|
190
|
-
//# sourceMappingURL=chunk-
|
|
190
|
+
//# sourceMappingURL=chunk-RJFB6VFO.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
normalizeHeaders,
|
|
6
6
|
sapAIEmbeddingProviderOptions,
|
|
7
7
|
validateModelParamsWithWarnings
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5ZKQJNHO.js";
|
|
9
9
|
|
|
10
10
|
// src/strategy-utils.ts
|
|
11
11
|
import { TooManyEmbeddingValuesForCallError } from "@ai-sdk/provider";
|
|
@@ -825,4 +825,4 @@ export {
|
|
|
825
825
|
normalizeEmbedding,
|
|
826
826
|
prepareEmbeddingCall
|
|
827
827
|
};
|
|
828
|
-
//# sourceMappingURL=chunk-
|
|
828
|
+
//# sourceMappingURL=chunk-VHZSAQBJ.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
BaseEmbeddingModelStrategy
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5JVF4555.js";
|
|
5
5
|
import {
|
|
6
6
|
buildModelDeployment,
|
|
7
7
|
extractResponseMetadata,
|
|
8
8
|
hasKeys,
|
|
9
9
|
mergeRequestConfig,
|
|
10
10
|
normalizeEmbedding
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-VHZSAQBJ.js";
|
|
12
|
+
import "./chunk-5ZKQJNHO.js";
|
|
13
13
|
|
|
14
14
|
// src/foundation-models-embedding-model-strategy.ts
|
|
15
15
|
var FoundationModelsEmbeddingModelStrategy = class extends BaseEmbeddingModelStrategy {
|
|
@@ -56,4 +56,4 @@ var FoundationModelsEmbeddingModelStrategy = class extends BaseEmbeddingModelStr
|
|
|
56
56
|
export {
|
|
57
57
|
FoundationModelsEmbeddingModelStrategy
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=foundation-models-embedding-model-strategy-
|
|
59
|
+
//# sourceMappingURL=foundation-models-embedding-model-strategy-VKBRG7RT.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
BaseLanguageModelStrategy
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5EDF6MHL.js";
|
|
5
5
|
import "./chunk-4JIMBRMV.js";
|
|
6
6
|
import {
|
|
7
7
|
buildModelDeployment,
|
|
8
8
|
convertResponseFormat,
|
|
9
9
|
convertToolsToSAPFormat,
|
|
10
10
|
mergeRequestConfig
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-VHZSAQBJ.js";
|
|
12
|
+
import "./chunk-5ZKQJNHO.js";
|
|
13
13
|
|
|
14
14
|
// src/foundation-models-language-model-strategy.ts
|
|
15
15
|
var FOUNDATION_MODELS_PARAM_MAPPINGS = [
|
|
@@ -97,4 +97,4 @@ var FoundationModelsLanguageModelStrategy = class extends BaseLanguageModelStrat
|
|
|
97
97
|
export {
|
|
98
98
|
FoundationModelsLanguageModelStrategy
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=foundation-models-language-model-strategy-
|
|
100
|
+
//# sourceMappingURL=foundation-models-language-model-strategy-FBGKZSTU.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -317,7 +317,7 @@ function parseSAPPartProviderOptions(providerOptions, warnings) {
|
|
|
317
317
|
}
|
|
318
318
|
return void 0;
|
|
319
319
|
}
|
|
320
|
-
var import_provider_utils, import_zod, SAP_AI_PROVIDER_NAME, modelParamsSchema, embeddingModelParamsSchema, sapAIApiTypeSchema, cacheControlSchema, sapAIPartProviderOptionsSchema, promptTemplateScopeSchema, promptTemplateRefByIdSchema, promptTemplateRefByScenarioNameVersionSchema, promptTemplateRefSchema, orchestrationConfigRefByIdSchema, orchestrationConfigRefByScenarioNameVersionSchema, orchestrationConfigRefSchema, sapAILanguageModelProviderOptions, sapAIEmbeddingProviderOptions;
|
|
320
|
+
var import_provider_utils, import_zod, SAP_AI_PROVIDER_NAME, modelParamsSchema, embeddingModelParamsSchema, sapAIApiTypeSchema, cacheControlSchema, sapAIPartProviderOptionsSchema, promptTemplateScopeSchema, promptTemplateRefByIdSchema, promptTemplateRefByScenarioNameVersionSchema, promptTemplateRefSchema, orchestrationConfigRefOverrideSchema, orchestrationConfigRefByIdSchema, orchestrationConfigRefByScenarioNameVersionSchema, orchestrationConfigRefSchema, sapAILanguageModelProviderOptions, sapAIEmbeddingProviderOptions;
|
|
321
321
|
var init_sap_ai_provider_options = __esm({
|
|
322
322
|
"src/sap-ai-provider-options.ts"() {
|
|
323
323
|
"use strict";
|
|
@@ -361,11 +361,48 @@ var init_sap_ai_provider_options = __esm({
|
|
|
361
361
|
promptTemplateRefByIdSchema,
|
|
362
362
|
promptTemplateRefByScenarioNameVersionSchema
|
|
363
363
|
]);
|
|
364
|
+
orchestrationConfigRefOverrideSchema = import_zod.z.custom(
|
|
365
|
+
(value) => typeof value === "object" && value !== null && !Array.isArray(value),
|
|
366
|
+
{ message: "overrideConfig must be an object" }
|
|
367
|
+
).refine(
|
|
368
|
+
(value) => {
|
|
369
|
+
let stream;
|
|
370
|
+
try {
|
|
371
|
+
stream = value.stream;
|
|
372
|
+
} catch {
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
return stream === void 0 || Boolean(stream) && typeof stream === "object" && !Array.isArray(stream);
|
|
376
|
+
},
|
|
377
|
+
{ message: "overrideConfig.stream must be an object" }
|
|
378
|
+
).refine(
|
|
379
|
+
(value) => {
|
|
380
|
+
let stream;
|
|
381
|
+
try {
|
|
382
|
+
stream = value.stream;
|
|
383
|
+
} catch {
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
if (stream === void 0 || stream === null || typeof stream !== "object") {
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
try {
|
|
390
|
+
return !("enabled" in stream);
|
|
391
|
+
} catch {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
message: "stream.enabled is not allowed in overrideConfig: it is controlled by the call site (stream() or chatCompletion())"
|
|
397
|
+
}
|
|
398
|
+
);
|
|
364
399
|
orchestrationConfigRefByIdSchema = import_zod.z.object({
|
|
365
|
-
id: import_zod.z.string().min(1, "Config ID cannot be empty")
|
|
400
|
+
id: import_zod.z.string().min(1, "Config ID cannot be empty"),
|
|
401
|
+
overrideConfig: orchestrationConfigRefOverrideSchema.optional()
|
|
366
402
|
});
|
|
367
403
|
orchestrationConfigRefByScenarioNameVersionSchema = import_zod.z.object({
|
|
368
404
|
name: import_zod.z.string().min(1, "Config name cannot be empty"),
|
|
405
|
+
overrideConfig: orchestrationConfigRefOverrideSchema.optional(),
|
|
369
406
|
scenario: import_zod.z.string().min(1, "Scenario cannot be empty"),
|
|
370
407
|
version: import_zod.z.string().min(1, "Version cannot be empty")
|
|
371
408
|
});
|
|
@@ -31796,7 +31833,7 @@ var VERSION;
|
|
|
31796
31833
|
var init_version = __esm({
|
|
31797
31834
|
"src/version.ts"() {
|
|
31798
31835
|
"use strict";
|
|
31799
|
-
VERSION = true ? "4.9.
|
|
31836
|
+
VERSION = true ? "4.9.1" : "0.0.0-test";
|
|
31800
31837
|
}
|
|
31801
31838
|
});
|
|
31802
31839
|
|
|
@@ -32715,7 +32752,7 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32715
32752
|
* @internal
|
|
32716
32753
|
*/
|
|
32717
32754
|
resolveAdditionalState(_config, settings, sapOptions, options, warnings) {
|
|
32718
|
-
const configRef = this.resolveConfigRef(sapOptions, settings);
|
|
32755
|
+
const configRef = this.resolveConfigRef(sapOptions, settings, warnings);
|
|
32719
32756
|
const promptTemplateRef = this.resolvePromptTemplateRef(sapOptions, settings);
|
|
32720
32757
|
if (configRef === void 0) {
|
|
32721
32758
|
validateMaskingProvidersDeprecation(settings, warnings);
|
|
@@ -32941,17 +32978,26 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32941
32978
|
}
|
|
32942
32979
|
/**
|
|
32943
32980
|
* Resolves the orchestrationConfigRef from provider options or settings.
|
|
32944
|
-
* Provider options take priority over settings.
|
|
32981
|
+
* Provider options take priority over settings. A present-but-invalid reference is
|
|
32982
|
+
* ignored with a warning instead of failing the request.
|
|
32945
32983
|
* @param sapOptions - Parsed provider options from commonParts.
|
|
32946
32984
|
* @param settings - The model settings.
|
|
32985
|
+
* @param warnings - Shared warnings sink for degradation signals.
|
|
32947
32986
|
* @returns The resolved config reference or undefined.
|
|
32948
32987
|
* @internal
|
|
32949
32988
|
*/
|
|
32950
|
-
resolveConfigRef(sapOptions, settings) {
|
|
32989
|
+
resolveConfigRef(sapOptions, settings, warnings) {
|
|
32951
32990
|
const configRefCandidate = sapOptions?.orchestrationConfigRef ?? settings.orchestrationConfigRef;
|
|
32952
|
-
if (configRefCandidate
|
|
32991
|
+
if (!configRefCandidate) {
|
|
32992
|
+
return void 0;
|
|
32993
|
+
}
|
|
32994
|
+
if (isOrchestrationConfigRef(configRefCandidate)) {
|
|
32953
32995
|
return configRefCandidate;
|
|
32954
32996
|
}
|
|
32997
|
+
warnings.push({
|
|
32998
|
+
message: "orchestrationConfigRef is invalid and was ignored; falling back to local module settings.",
|
|
32999
|
+
type: "other"
|
|
33000
|
+
});
|
|
32955
33001
|
return void 0;
|
|
32956
33002
|
}
|
|
32957
33003
|
/**
|