@jerome-benoit/sap-ai-provider 4.7.0 → 4.7.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.
Files changed (29) hide show
  1. package/README.md +21 -31
  2. package/dist/{chunk-36DFHUVQ.js → chunk-BZWUUBX2.js} +2 -2
  3. package/dist/{chunk-WDUOKIKD.js → chunk-HDOSHLV6.js} +4 -2
  4. package/dist/chunk-HDOSHLV6.js.map +1 -0
  5. package/dist/{chunk-GMMX46AH.js → chunk-OA6TJHD2.js} +3 -3
  6. package/dist/{chunk-BZZJKLDG.js → chunk-RUCURXS7.js} +3 -3
  7. package/dist/{chunk-TVXWNZQT.js → chunk-XIWHF23D.js} +219 -104
  8. package/dist/chunk-XIWHF23D.js.map +1 -0
  9. package/dist/{foundation-models-embedding-model-strategy-YWPDIJEN.js → foundation-models-embedding-model-strategy-TACUPFS2.js} +4 -4
  10. package/dist/{foundation-models-language-model-strategy-WDSQWU64.js → foundation-models-language-model-strategy-LLWYUGA3.js} +4 -4
  11. package/dist/index.cjs +221 -103
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +2 -0
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +6 -6
  16. package/dist/index.js.map +1 -1
  17. package/dist/{orchestration-embedding-model-strategy-66QYAO64.js → orchestration-embedding-model-strategy-RYI3HWRZ.js} +5 -5
  18. package/dist/{orchestration-language-model-strategy-4TKRZK7U.js → orchestration-language-model-strategy-NIUPRYDW.js} +6 -5
  19. package/dist/orchestration-language-model-strategy-NIUPRYDW.js.map +1 -0
  20. package/package.json +9 -11
  21. package/dist/chunk-TVXWNZQT.js.map +0 -1
  22. package/dist/chunk-WDUOKIKD.js.map +0 -1
  23. package/dist/orchestration-language-model-strategy-4TKRZK7U.js.map +0 -1
  24. /package/dist/{chunk-36DFHUVQ.js.map → chunk-BZWUUBX2.js.map} +0 -0
  25. /package/dist/{chunk-GMMX46AH.js.map → chunk-OA6TJHD2.js.map} +0 -0
  26. /package/dist/{chunk-BZZJKLDG.js.map → chunk-RUCURXS7.js.map} +0 -0
  27. /package/dist/{foundation-models-embedding-model-strategy-YWPDIJEN.js.map → foundation-models-embedding-model-strategy-TACUPFS2.js.map} +0 -0
  28. /package/dist/{foundation-models-language-model-strategy-WDSQWU64.js.map → foundation-models-language-model-strategy-LLWYUGA3.js.map} +0 -0
  29. /package/dist/{orchestration-embedding-model-strategy-66QYAO64.js.map → orchestration-embedding-model-strategy-RYI3HWRZ.js.map} +0 -0
package/README.md CHANGED
@@ -531,29 +531,15 @@ const dpiConfig = buildDpiMaskingProvider({
531
531
 
532
532
  ### Content Filtering
533
533
 
534
- ```typescript
535
- import "dotenv/config"; // Load environment variables
536
- import { buildAzureContentSafetyFilter, createSAPAIProvider } from "@jerome-benoit/sap-ai-provider";
537
-
538
- const provider = createSAPAIProvider({
539
- defaultSettings: {
540
- filtering: {
541
- input: {
542
- filters: [
543
- buildAzureContentSafetyFilter("input", {
544
- hate: "ALLOW_SAFE",
545
- violence: "ALLOW_SAFE_LOW_MEDIUM",
546
- }),
547
- ],
548
- },
549
- },
550
- },
551
- });
552
- ```
534
+ Content filtering is available through the Orchestration API.
553
535
 
536
+ **Complete example:**
537
+ [examples/example-content-filtering.ts](./examples/example-content-filtering.ts)\
554
538
  **Complete documentation:**
555
539
  [API Reference - Content Filtering](./API_REFERENCE.md#buildazurecontentsafetyfiltertype-config)
556
540
 
541
+ **Run it:** `npx tsx examples/example-content-filtering.ts`
542
+
557
543
  ### Document Grounding (RAG)
558
544
 
559
545
  Ground LLM responses in your own documents using vector databases.
@@ -567,24 +553,27 @@ Ground LLM responses in your own documents using vector databases.
567
553
  const provider = createSAPAIProvider({
568
554
  defaultSettings: {
569
555
  grounding: buildDocumentGroundingConfig({
570
- filters: [
571
- {
572
- id: "vector-store-1", // Your vector database ID
573
- data_repositories: ["*"], // Search all repositories
574
- },
575
- ],
576
- placeholders: {
577
- input: ["?question"],
578
- output: "groundingOutput",
579
- },
556
+ filters: [{ id: "vector-store-1", data_repositories: ["*"] }],
557
+ placeholders: { input: ["groundingRequest"], output: "groundingOutput" },
580
558
  }),
581
559
  },
582
560
  });
583
561
 
584
- // Queries are now grounded in your documents
585
- const model = provider("gpt-4.1");
562
+ const result = await generateText({
563
+ model: provider("gpt-4.1"),
564
+ prompt: "Question: {{?groundingRequest}}\nContext: {{?groundingOutput}}",
565
+ providerOptions: {
566
+ "sap-ai": {
567
+ escapeTemplatePlaceholders: false,
568
+ placeholderValues: { groundingRequest: "What is SAP?" },
569
+ },
570
+ },
571
+ });
586
572
  ```
587
573
 
574
+ Set `escapeTemplatePlaceholders` to `false` only when intentionally sending SAP
575
+ or Jinja placeholders in prompts or messages.
576
+
588
577
  **Run it:** `npx tsx examples/example-document-grounding.ts`
589
578
 
590
579
  ### Translation
@@ -736,6 +725,7 @@ features:
736
725
  | `example-streaming-chat.ts` | Streaming responses | Real-time text generation, SSE |
737
726
  | `example-image-recognition.ts` | Multi-modal with images | Vision models, image analysis |
738
727
  | `example-data-masking.ts` | Data privacy integration | DPI masking, anonymization |
728
+ | `example-content-filtering.ts` | Content filtering | Azure Content Safety, orchestration |
739
729
  | `example-document-grounding.ts` | Document grounding (RAG) | Vector store, retrieval-augmented gen |
740
730
  | `example-translation.ts` | Input/output translation | Multi-language support, SAP translation |
741
731
  | `example-embeddings.ts` | Text embeddings | Vector generation, semantic similarity |
@@ -5,7 +5,7 @@ import {
5
5
  normalizeHeaders,
6
6
  sapAIEmbeddingProviderOptions,
7
7
  validateModelParamsWithWarnings
8
- } from "./chunk-TVXWNZQT.js";
8
+ } from "./chunk-XIWHF23D.js";
9
9
 
10
10
  // src/strategy-utils.ts
11
11
  import { TooManyEmbeddingValuesForCallError } from "@ai-sdk/provider";
@@ -819,4 +819,4 @@ export {
819
819
  normalizeEmbedding,
820
820
  prepareEmbeddingCall
821
821
  };
822
- //# sourceMappingURL=chunk-36DFHUVQ.js.map
822
+ //# sourceMappingURL=chunk-BZWUUBX2.js.map
@@ -3,7 +3,7 @@ import {
3
3
  ApiSwitchError,
4
4
  UnsupportedFeatureError,
5
5
  deepMerge
6
- } from "./chunk-TVXWNZQT.js";
6
+ } from "./chunk-XIWHF23D.js";
7
7
 
8
8
  // src/sap-ai-validation.ts
9
9
  function validateEscapeTemplatePlaceholders(api, escapeTemplatePlaceholders) {
@@ -54,6 +54,7 @@ function validateOrchestrationOnlyOptions(settings) {
54
54
  }
55
55
  }
56
56
  var ORCHESTRATION_ONLY_FEATURE_KEYS = [
57
+ "fallbackModuleConfigs",
57
58
  "filtering",
58
59
  "grounding",
59
60
  "masking",
@@ -65,6 +66,7 @@ var ORCHESTRATION_ONLY_FEATURE_KEYS = [
65
66
  "translation"
66
67
  ];
67
68
  var ORCHESTRATION_ONLY_FEATURES = {
69
+ fallbackModuleConfigs: "Fallback module configurations (fallbackModuleConfigs)",
68
70
  filtering: "Content filtering",
69
71
  grounding: "Document grounding",
70
72
  masking: "Data masking",
@@ -185,4 +187,4 @@ export {
185
187
  validateMaskingProvidersDeprecation,
186
188
  validateSettings
187
189
  };
188
- //# sourceMappingURL=chunk-WDUOKIKD.js.map
190
+ //# sourceMappingURL=chunk-HDOSHLV6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/sap-ai-validation.ts"],"sourcesContent":["/** Validation and resolution functions for SAP AI API-specific features. */\nimport type { SharedV3Warning } from \"@ai-sdk/provider\";\n\nimport type {\n FoundationModelsModelSettings,\n OrchestrationModelSettings,\n SAPAIApiType,\n SAPAIEmbeddingSettings,\n SAPAIModelSettings,\n SAPAISettings,\n} from \"./sap-ai-settings.js\";\n\nimport { deepMerge } from \"./deep-merge.js\";\nimport { ApiSwitchError, UnsupportedFeatureError } from \"./sap-ai-error.js\";\n\n/**\n * Type guard for Foundation Models API settings.\n * @param settings - Settings to check.\n * @returns True if settings are for Foundation Models API.\n */\nexport function isFoundationModelsSettings(\n settings: SAPAIModelSettings | SAPAISettings,\n): settings is FoundationModelsModelSettings {\n return settings.api === \"foundation-models\";\n}\n\n/**\n * Type guard for Orchestration API settings.\n * @param settings - Settings to check.\n * @returns True if settings are for Orchestration API.\n */\nexport function isOrchestrationSettings(\n settings: SAPAIModelSettings | SAPAISettings,\n): settings is OrchestrationModelSettings {\n return settings.api === undefined || settings.api === \"orchestration\";\n}\n\n/**\n * Validates escapeTemplatePlaceholders option based on API type.\n *\n * Jinja2 template escaping is only supported by the Orchestration API.\n * @param api - SAP AI API type.\n * @param escapeTemplatePlaceholders - Whether to escape template placeholders.\n * @throws {UnsupportedFeatureError} When escapeTemplatePlaceholders is true with Foundation Models API.\n * @internal\n */\nfunction validateEscapeTemplatePlaceholders(\n api: SAPAIApiType,\n escapeTemplatePlaceholders: boolean | undefined,\n): void {\n if (api === \"foundation-models\" && escapeTemplatePlaceholders === true) {\n throw new UnsupportedFeatureError(\n ESCAPE_TEMPLATE_PLACEHOLDERS_DESCRIPTION,\n \"foundation-models\",\n \"orchestration\",\n );\n }\n}\n\n/**\n * Validates that Foundation Models-only options are not used with Orchestration API.\n *\n * Foundation Models-only features:\n * - `dataSources` - Azure On Your Data configuration\n * @param settings - Settings to validate.\n * @throws {UnsupportedFeatureError} When dataSources is set with Orchestration API.\n * @internal\n */\nfunction validateFoundationModelsOnlyOptions(\n settings: SAPAIModelSettings | SAPAISettings | undefined,\n): void {\n if (!settings) return;\n\n const fmSettings = settings as FoundationModelsModelSettings;\n\n for (const feature of FOUNDATION_MODELS_ONLY_FEATURE_KEYS) {\n if (fmSettings[feature] !== undefined) {\n throw new UnsupportedFeatureError(\n FOUNDATION_MODELS_ONLY_FEATURES[feature],\n \"orchestration\",\n \"foundation-models\",\n );\n }\n }\n}\n\n/**\n * Validates that Orchestration-only embedding options are not used with Foundation Models API.\n *\n * Orchestration-only embedding features:\n * - `masking` - Data masking module\n * @param settings - Embedding settings to validate.\n * @throws {UnsupportedFeatureError} When masking is set with Foundation Models API.\n * @internal\n */\nfunction validateOrchestrationOnlyEmbeddingOptions(\n settings: SAPAIEmbeddingSettings | undefined,\n): void {\n if (!settings) return;\n\n for (const feature of ORCHESTRATION_ONLY_EMBEDDING_FEATURE_KEYS) {\n if (settings[feature] !== undefined) {\n throw new UnsupportedFeatureError(\n ORCHESTRATION_ONLY_EMBEDDING_FEATURES[feature],\n \"foundation-models\",\n \"orchestration\",\n );\n }\n }\n}\n\n/**\n * Validates that Orchestration-only options are not used with Foundation Models API.\n *\n * Orchestration-only features:\n * - `fallbackModuleConfigs` - Prompt module fallback configuration list\n * - `filtering` - Content filtering module\n * - `grounding` - Document grounding module\n * - `masking` - Data masking module\n * - `orchestrationConfigRef` - Prompt Registry configuration reference\n * - `placeholderValues` - Jinja2 template placeholder values\n * - `promptTemplateRef` - Prompt Registry template reference\n * - `tools` - SAP-format tool definitions (use AI SDK tools instead)\n * - `translation` - Translation module\n * @param settings - Settings to validate.\n * @throws {UnsupportedFeatureError} When any Orchestration-only feature is set with Foundation Models API.\n * @internal\n */\nfunction validateOrchestrationOnlyOptions(\n settings: SAPAIModelSettings | SAPAISettings | undefined,\n): void {\n if (!settings) return;\n\n const orchSettings = settings as OrchestrationModelSettings;\n\n for (const feature of ORCHESTRATION_ONLY_FEATURE_KEYS) {\n if (orchSettings[feature] !== undefined) {\n throw new UnsupportedFeatureError(\n ORCHESTRATION_ONLY_FEATURES[feature],\n \"foundation-models\",\n \"orchestration\",\n );\n }\n }\n}\n\n/**\n * Keys for Orchestration-only features.\n * @internal\n */\nconst ORCHESTRATION_ONLY_FEATURE_KEYS = [\n \"fallbackModuleConfigs\",\n \"filtering\",\n \"grounding\",\n \"masking\",\n \"orchestrationConfigRef\",\n \"placeholderValues\",\n \"promptTemplateRef\",\n \"streamOptions\",\n \"tools\",\n \"translation\",\n] as const;\n\n/**\n * Mapping of Orchestration-only feature keys to human-readable descriptions.\n * Used for generating consistent error messages.\n * @internal\n */\nconst ORCHESTRATION_ONLY_FEATURES: Readonly<\n Record<(typeof ORCHESTRATION_ONLY_FEATURE_KEYS)[number], string>\n> = {\n fallbackModuleConfigs: \"Fallback module configurations (fallbackModuleConfigs)\",\n filtering: \"Content filtering\",\n grounding: \"Document grounding\",\n masking: \"Data masking\",\n orchestrationConfigRef: \"Orchestration config reference (orchestrationConfigRef)\",\n placeholderValues: \"Placeholder values (placeholderValues)\",\n promptTemplateRef: \"Prompt template reference (promptTemplateRef)\",\n streamOptions: \"Stream options for post-LLM modules\",\n tools: \"SAP-format tool definitions (use AI SDK tools instead)\",\n translation: \"Translation\",\n} as const;\n\n/**\n * Keys for Foundation Models-only features.\n * @internal\n */\nconst FOUNDATION_MODELS_ONLY_FEATURE_KEYS = [\"dataSources\"] as const;\n\n/**\n * Mapping of Foundation Models-only feature keys to human-readable descriptions.\n * Used for generating consistent error messages.\n * @internal\n */\nconst FOUNDATION_MODELS_ONLY_FEATURES: Readonly<\n Record<(typeof FOUNDATION_MODELS_ONLY_FEATURE_KEYS)[number], string>\n> = {\n dataSources: \"Azure On Your Data (dataSources)\",\n} as const;\n\n/**\n * Subset of Orchestration-only features that can be set at invocation level.\n * @internal\n */\nconst ORCHESTRATION_ONLY_INVOCATION_FEATURE_KEYS = [\n \"orchestrationConfigRef\",\n \"placeholderValues\",\n \"promptTemplateRef\",\n] as const;\n\n/**\n * Keys for Orchestration-only embedding features.\n * @internal\n */\nconst ORCHESTRATION_ONLY_EMBEDDING_FEATURE_KEYS = [\"masking\"] as const;\n\n/**\n * Mapping of Orchestration-only embedding feature keys to human-readable descriptions.\n * Uses the same descriptions as the main ORCHESTRATION_ONLY_FEATURES for consistency.\n * @internal\n */\nconst ORCHESTRATION_ONLY_EMBEDDING_FEATURES: Readonly<\n Record<(typeof ORCHESTRATION_ONLY_EMBEDDING_FEATURE_KEYS)[number], string>\n> = {\n masking: ORCHESTRATION_ONLY_FEATURES.masking,\n} as const;\n\n/**\n * Human-readable description for escapeTemplatePlaceholders feature.\n * Used for generating consistent error messages.\n * @internal\n */\nconst ESCAPE_TEMPLATE_PLACEHOLDERS_DESCRIPTION =\n \"escapeTemplatePlaceholders (Jinja2 template escaping)\";\n\n/**\n * Validates that switching APIs at invocation time is allowed.\n *\n * API switching is blocked when the model was configured with features\n * that are specific to one API and incompatible with the target API.\n * @param fromApi - Source API type (configured at model creation).\n * @param toApi - Target API type (requested at invocation time).\n * @param modelSettings - Model settings to validate for conflicts.\n * @throws {ApiSwitchError} When the model has features incompatible with the target API.\n * @internal\n */\nfunction validateApiSwitch(\n fromApi: SAPAIApiType,\n toApi: SAPAIApiType,\n modelSettings: SAPAIModelSettings | SAPAISettings | undefined,\n): void {\n if (fromApi === toApi) return;\n if (!modelSettings) return;\n\n if (fromApi === \"orchestration\" && toApi === \"foundation-models\") {\n const orchSettings = modelSettings as OrchestrationModelSettings;\n\n for (const feature of ORCHESTRATION_ONLY_FEATURE_KEYS) {\n if (orchSettings[feature] !== undefined) {\n throw new ApiSwitchError(fromApi, toApi, feature);\n }\n }\n }\n\n if (fromApi === \"foundation-models\" && toApi === \"orchestration\") {\n const fmSettings = modelSettings as FoundationModelsModelSettings;\n\n for (const feature of FOUNDATION_MODELS_ONLY_FEATURE_KEYS) {\n if (fmSettings[feature] !== undefined) {\n throw new ApiSwitchError(fromApi, toApi, feature);\n }\n }\n }\n}\n\n/**\n * @internal\n */\nconst VALID_API_TYPES: readonly SAPAIApiType[] = [\"orchestration\", \"foundation-models\"];\n\n/** Options for the main validation function. */\nexport interface ValidateSettingsOptions {\n readonly api: SAPAIApiType;\n readonly embeddingSettings?: SAPAIEmbeddingSettings;\n readonly invocationSettings?: {\n readonly api?: SAPAIApiType;\n readonly escapeTemplatePlaceholders?: boolean;\n readonly orchestrationConfigRef?: unknown;\n readonly placeholderValues?: unknown;\n readonly promptTemplateRef?: unknown;\n };\n readonly modelApi?: SAPAIApiType;\n readonly modelSettings?: SAPAIModelSettings | SAPAISettings;\n}\n\n/**\n * Gets the effective escapeTemplatePlaceholders value based on API and settings.\n * @param api - SAP AI API type.\n * @param modelSettings - Model settings.\n * @param invocationEscape - Invocation-level escape setting.\n * @returns Effective escapeTemplatePlaceholders value.\n */\nexport function getEffectiveEscapeTemplatePlaceholders(\n api: SAPAIApiType,\n modelSettings: SAPAIModelSettings | SAPAISettings | undefined,\n invocationEscape: boolean | undefined,\n): boolean {\n if (api === \"foundation-models\") {\n return false;\n }\n\n if (invocationEscape !== undefined) {\n return invocationEscape;\n }\n\n const modelValue = (modelSettings as OrchestrationModelSettings | undefined)\n ?.escapeTemplatePlaceholders;\n if (modelValue !== undefined) {\n return modelValue;\n }\n\n return true;\n}\n\n/**\n * Merges settings with proper API precedence (callSettings > defaultSettings > fallbackApi).\n * @param defaultSettings - Provider-level default settings.\n * @param callSettings - Per-call settings that override defaults.\n * @param fallbackApi - Fallback API type when neither settings specify one.\n * @returns Merged settings with correct API precedence.\n * @internal\n */\nexport function mergeSettingsWithApi<T extends { api?: string }>(\n defaultSettings: Record<string, unknown> | undefined,\n callSettings: Partial<T>,\n fallbackApi: string,\n): T {\n return {\n ...deepMerge(defaultSettings, callSettings as Record<string, unknown>),\n api: callSettings.api ?? (defaultSettings?.api as string | undefined) ?? fallbackApi,\n } as T;\n}\n\n/**\n * Resolves the effective API type using the full precedence chain.\n * @param providerApi - Provider-level API type.\n * @param modelApi - Model-level API type.\n * @param invocationApi - Invocation-level API type.\n * @returns Resolved API type.\n */\nexport function resolveApi(\n providerApi: SAPAIApiType | undefined,\n modelApi: SAPAIApiType | undefined,\n invocationApi: SAPAIApiType | undefined,\n): SAPAIApiType {\n return invocationApi ?? modelApi ?? providerApi ?? \"orchestration\";\n}\n\n/**\n * Validates that the API value is a valid SAPAIApiType.\n * @param api - API value to validate.\n */\nexport function validateApiInput(api: unknown): void {\n if (api === undefined) return;\n\n if (typeof api !== \"string\" || !VALID_API_TYPES.includes(api as SAPAIApiType)) {\n throw new Error(\n `Invalid API type: ${JSON.stringify(api)}. ` +\n `Valid values are: ${VALID_API_TYPES.map((t) => `\"${t}\"`).join(\", \")}`,\n );\n }\n}\n\n/**\n * Pushes a deprecation warning when `settings.masking` carries `masking_providers`\n * without a `providers` block.\n * @param modelSettings - Resolved model settings (LM or embedding) that may carry a `masking` module.\n * @param warnings - Sink that collects the deprecation warning when it applies.\n * @internal\n */\nexport function validateMaskingProvidersDeprecation(\n modelSettings: undefined | { masking?: unknown },\n warnings: SharedV3Warning[],\n): void {\n const masking = modelSettings?.masking;\n if (!masking || typeof masking !== \"object\") {\n return;\n }\n const maskingRecord = masking as Record<string, unknown>;\n const hasDeprecated = maskingRecord.masking_providers !== undefined;\n const hasPreferred = maskingRecord.providers !== undefined;\n if (hasDeprecated && !hasPreferred) {\n warnings.push({\n message:\n \"settings.masking.masking_providers is deprecated and will be removed by SAP on 2027-03-20. \" +\n \"Migrate to settings.masking.providers.\",\n type: \"other\",\n });\n }\n}\n\n/**\n * Main validation function that performs all API-specific validations.\n *\n * This function orchestrates all validation checks:\n * 1. Validates API type inputs\n * 2. Checks for API switching conflicts\n * 3. Validates API-specific feature usage\n * 4. Validates template placeholder escaping\n * @param options - Validation options.\n * @throws {Error} When an invalid API type is provided.\n * @throws {ApiSwitchError} When attempting to switch APIs with incompatible settings.\n * @throws {UnsupportedFeatureError} When using features not supported by the current API.\n * @see {@link ApiSwitchError}\n * @see {@link UnsupportedFeatureError}\n */\nexport function validateSettings(options: ValidateSettingsOptions): void {\n const { api, embeddingSettings, invocationSettings, modelApi, modelSettings } = options;\n\n validateApiInput(api);\n if (invocationSettings?.api !== undefined) {\n validateApiInput(invocationSettings.api);\n }\n\n if (invocationSettings?.api !== undefined) {\n const effectiveModelApi = modelApi ?? \"orchestration\";\n if (effectiveModelApi !== invocationSettings.api) {\n validateApiSwitch(effectiveModelApi, invocationSettings.api, modelSettings);\n }\n }\n\n if (api === \"foundation-models\") {\n validateOrchestrationOnlyOptions(modelSettings);\n validateOrchestrationOnlyInvocationOptions(invocationSettings);\n validateOrchestrationOnlyEmbeddingOptions(embeddingSettings);\n } else {\n validateFoundationModelsOnlyOptions(modelSettings);\n }\n\n const modelEscape = (modelSettings as OrchestrationModelSettings | undefined)\n ?.escapeTemplatePlaceholders;\n const invocationEscape = invocationSettings?.escapeTemplatePlaceholders;\n const effectiveEscape = invocationEscape ?? modelEscape;\n validateEscapeTemplatePlaceholders(api, effectiveEscape);\n}\n\n/**\n * Validates that Orchestration-only options are not passed at invocation level with Foundation Models API.\n * @param invocationSettings - Invocation-level settings to validate.\n * @throws {UnsupportedFeatureError} When any Orchestration-only feature is set at invocation level.\n * @internal\n */\nfunction validateOrchestrationOnlyInvocationOptions(\n invocationSettings: ValidateSettingsOptions[\"invocationSettings\"],\n): void {\n if (!invocationSettings) return;\n\n for (const feature of ORCHESTRATION_ONLY_INVOCATION_FEATURE_KEYS) {\n if (invocationSettings[feature] !== undefined) {\n throw new UnsupportedFeatureError(\n ORCHESTRATION_ONLY_FEATURES[feature],\n \"foundation-models\",\n \"orchestration\",\n );\n }\n }\n}\n"],"mappings":";;;;;;;;AA8CA,SAAS,mCACP,KACA,4BACM;AACN,MAAI,QAAQ,uBAAuB,+BAA+B,MAAM;AACtE,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAWA,SAAS,oCACP,UACM;AACN,MAAI,CAAC,SAAU;AAEf,QAAM,aAAa;AAEnB,aAAW,WAAW,qCAAqC;AACzD,QAAI,WAAW,OAAO,MAAM,QAAW;AACrC,YAAM,IAAI;AAAA,QACR,gCAAgC,OAAO;AAAA,QACvC;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAWA,SAAS,0CACP,UACM;AACN,MAAI,CAAC,SAAU;AAEf,aAAW,WAAW,2CAA2C;AAC/D,QAAI,SAAS,OAAO,MAAM,QAAW;AACnC,YAAM,IAAI;AAAA,QACR,sCAAsC,OAAO;AAAA,QAC7C;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAmBA,SAAS,iCACP,UACM;AACN,MAAI,CAAC,SAAU;AAEf,QAAM,eAA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AC/B,qCAAiC,aAAa;AAC9C,+CAA2C,kBAAkB;AAC7D,8CAA0C,iBAAiB;AAAA,EAC7D,OAAO;AACL,wCAAoC,aAAa;AAAA,EACnD;AAEA,QAAM,cAAe,eACjB;AACJ,QAAM,mBAAmB,oBAAoB;AAC7C,QAAM,kBAAkB,oBAAoB;AAC5C,qCAAmC,KAAK,eAAe;AACzD;AAQA,SAAS,2CACP,oBACM;AACN,MAAI,CAAC,mBAAoB;AAEzB,aAAW,WAAW,4CAA4C;AAChE,QAAI,mBAAmB,OAAO,MAAM,QAAW;AAC7C,YAAM,IAAI;AAAA,QACR,4BAA4B,OAAO;AAAA,QACnC;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -2,12 +2,12 @@ import {createRequire as __createRequire} from 'module';var require=__createRequ
2
2
  import {
3
3
  buildEmbeddingResult,
4
4
  prepareEmbeddingCall
5
- } from "./chunk-36DFHUVQ.js";
5
+ } from "./chunk-BZWUUBX2.js";
6
6
  import {
7
7
  VERSION,
8
8
  convertToAISDKError,
9
9
  deepMerge
10
- } from "./chunk-TVXWNZQT.js";
10
+ } from "./chunk-XIWHF23D.js";
11
11
 
12
12
  // src/base-embedding-model-strategy.ts
13
13
  import { TooManyEmbeddingValuesForCallError } from "@ai-sdk/provider";
@@ -90,4 +90,4 @@ var BaseEmbeddingModelStrategy = class {
90
90
  export {
91
91
  BaseEmbeddingModelStrategy
92
92
  };
93
- //# sourceMappingURL=chunk-GMMX46AH.js.map
93
+ //# sourceMappingURL=chunk-OA6TJHD2.js.map
@@ -11,14 +11,14 @@ import {
11
11
  extractCompletionId,
12
12
  extractResponseMetadata,
13
13
  mapToolChoice
14
- } from "./chunk-36DFHUVQ.js";
14
+ } from "./chunk-BZWUUBX2.js";
15
15
  import {
16
16
  VERSION,
17
17
  convertToAISDKError,
18
18
  getProviderName,
19
19
  normalizeHeaders,
20
20
  sapAILanguageModelProviderOptions
21
- } from "./chunk-TVXWNZQT.js";
21
+ } from "./chunk-XIWHF23D.js";
22
22
 
23
23
  // src/base-language-model-strategy.ts
24
24
  import { parseProviderOptions } from "@ai-sdk/provider-utils";
@@ -241,4 +241,4 @@ var BaseLanguageModelStrategy = class {
241
241
  export {
242
242
  BaseLanguageModelStrategy
243
243
  };
244
- //# sourceMappingURL=chunk-BZZJKLDG.js.map
244
+ //# sourceMappingURL=chunk-RUCURXS7.js.map