@jerome-benoit/sap-ai-provider-v2 5.0.1 → 5.0.3

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 (40) hide show
  1. package/README.md +39 -32
  2. package/dist/{chunk-JRUSQTKB.js → chunk-3H5C5U22.js} +19 -11
  3. package/dist/chunk-3H5C5U22.js.map +1 -0
  4. package/dist/{chunk-AFZC2DH2.js → chunk-4JLNWASF.js} +59 -387
  5. package/dist/chunk-4JLNWASF.js.map +1 -0
  6. package/dist/{chunk-U23M3VYO.js → chunk-E76ZDPIW.js} +17 -7
  7. package/dist/chunk-E76ZDPIW.js.map +1 -0
  8. package/dist/chunk-NF355OFT.js +635 -0
  9. package/dist/chunk-NF355OFT.js.map +1 -0
  10. package/dist/chunk-UIBQ5AFS.js +778 -0
  11. package/dist/chunk-UIBQ5AFS.js.map +1 -0
  12. package/dist/{chunk-MF3VO3ER.js → chunk-YP3AADWD.js} +47 -40
  13. package/dist/chunk-YP3AADWD.js.map +1 -0
  14. package/dist/{foundation-models-embedding-model-strategy-2GUADNXT.js → foundation-models-embedding-model-strategy-SAVQFBF4.js} +8 -9
  15. package/dist/foundation-models-embedding-model-strategy-SAVQFBF4.js.map +1 -0
  16. package/dist/{foundation-models-language-model-strategy-5AYZ5KHA.js → foundation-models-language-model-strategy-ZDOWVYTA.js} +19 -22
  17. package/dist/foundation-models-language-model-strategy-ZDOWVYTA.js.map +1 -0
  18. package/dist/index.cjs +1317 -31652
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +17 -32
  21. package/dist/index.d.ts +17 -32
  22. package/dist/index.js +48 -194
  23. package/dist/index.js.map +1 -1
  24. package/dist/{orchestration-embedding-model-strategy-F7WHDLX7.js → orchestration-embedding-model-strategy-GT27AFII.js} +7 -11
  25. package/dist/orchestration-embedding-model-strategy-GT27AFII.js.map +1 -0
  26. package/dist/{orchestration-language-model-strategy-Z72AFW62.js → orchestration-language-model-strategy-7QTPQHCC.js} +32 -27
  27. package/dist/orchestration-language-model-strategy-7QTPQHCC.js.map +1 -0
  28. package/package.json +16 -13
  29. package/dist/chunk-2KOXKYVT.js +0 -31083
  30. package/dist/chunk-2KOXKYVT.js.map +0 -1
  31. package/dist/chunk-643USI3B.js +0 -251
  32. package/dist/chunk-643USI3B.js.map +0 -1
  33. package/dist/chunk-AFZC2DH2.js.map +0 -1
  34. package/dist/chunk-JRUSQTKB.js.map +0 -1
  35. package/dist/chunk-MF3VO3ER.js.map +0 -1
  36. package/dist/chunk-U23M3VYO.js.map +0 -1
  37. package/dist/foundation-models-embedding-model-strategy-2GUADNXT.js.map +0 -1
  38. package/dist/foundation-models-language-model-strategy-5AYZ5KHA.js.map +0 -1
  39. package/dist/orchestration-embedding-model-strategy-F7WHDLX7.js.map +0 -1
  40. package/dist/orchestration-language-model-strategy-Z72AFW62.js.map +0 -1
@@ -3,7 +3,7 @@ import {
3
3
  ApiSwitchError,
4
4
  UnsupportedFeatureError,
5
5
  deepMerge
6
- } from "./chunk-2KOXKYVT.js";
6
+ } from "./chunk-UIBQ5AFS.js";
7
7
 
8
8
  // src/sap-ai-validation.ts
9
9
  function validateEscapeTemplatePlaceholders(api, escapeTemplatePlaceholders) {
@@ -91,13 +91,18 @@ var ORCHESTRATION_ONLY_EMBEDDING_FEATURES = {
91
91
  masking: ORCHESTRATION_ONLY_FEATURES.masking
92
92
  };
93
93
  var ESCAPE_TEMPLATE_PLACEHOLDERS_DESCRIPTION = "escapeTemplatePlaceholders (Jinja2 template escaping)";
94
- function validateApiSwitch(fromApi, toApi, modelSettings) {
94
+ function validateApiSwitch(fromApi, toApi, modelSettings, embeddingSettings) {
95
95
  if (fromApi === toApi) return;
96
- if (!modelSettings) return;
96
+ if (!modelSettings && !embeddingSettings) return;
97
97
  if (fromApi === "orchestration" && toApi === "foundation-models") {
98
98
  const orchSettings = modelSettings;
99
99
  for (const feature of ORCHESTRATION_ONLY_FEATURE_KEYS) {
100
- if (orchSettings[feature] !== void 0) {
100
+ if (orchSettings?.[feature] !== void 0) {
101
+ throw new ApiSwitchError(fromApi, toApi, feature);
102
+ }
103
+ }
104
+ for (const feature of ORCHESTRATION_ONLY_EMBEDDING_FEATURE_KEYS) {
105
+ if (embeddingSettings?.[feature] !== void 0) {
101
106
  throw new ApiSwitchError(fromApi, toApi, feature);
102
107
  }
103
108
  }
@@ -105,7 +110,7 @@ function validateApiSwitch(fromApi, toApi, modelSettings) {
105
110
  if (fromApi === "foundation-models" && toApi === "orchestration") {
106
111
  const fmSettings = modelSettings;
107
112
  for (const feature of FOUNDATION_MODELS_ONLY_FEATURE_KEYS) {
108
- if (fmSettings[feature] !== void 0) {
113
+ if (fmSettings?.[feature] !== void 0) {
109
114
  throw new ApiSwitchError(fromApi, toApi, feature);
110
115
  }
111
116
  }
@@ -153,7 +158,12 @@ function validateSettings(options) {
153
158
  if (invocationSettings?.api !== void 0) {
154
159
  const effectiveModelApi = modelApi ?? "orchestration";
155
160
  if (effectiveModelApi !== invocationSettings.api) {
156
- validateApiSwitch(effectiveModelApi, invocationSettings.api, modelSettings);
161
+ validateApiSwitch(
162
+ effectiveModelApi,
163
+ invocationSettings.api,
164
+ modelSettings,
165
+ embeddingSettings
166
+ );
157
167
  }
158
168
  }
159
169
  if (api === "foundation-models") {
@@ -187,4 +197,4 @@ export {
187
197
  validateMaskingProvidersDeprecation,
188
198
  validateSettings
189
199
  };
190
- //# sourceMappingURL=chunk-U23M3VYO.js.map
200
+ //# sourceMappingURL=chunk-E76ZDPIW.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 * - `streamOptions` - Post-LLM module streaming configuration\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 - Language model settings to validate for conflicts.\n * @param embeddingSettings - Embedding 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 embeddingSettings: SAPAIEmbeddingSettings | undefined,\n): void {\n if (fromApi === toApi) return;\n if (!modelSettings && !embeddingSettings) return;\n\n if (fromApi === \"orchestration\" && toApi === \"foundation-models\") {\n const orchSettings = modelSettings as OrchestrationModelSettings | undefined;\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 for (const feature of ORCHESTRATION_ONLY_EMBEDDING_FEATURE_KEYS) {\n if (embeddingSettings?.[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 | undefined;\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(\n effectiveModelApi,\n invocationSettings.api,\n modelSettings,\n embeddingSettings,\n );\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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