UNPKG

@sap-ai-sdk/orchestration

Version:

SAP Cloud SDK for AI is the official Software Development Kit (SDK) for **SAP AI Core**, **SAP Generative AI Hub**, and **Orchestration Service**.

29 lines 1.02 kB
/** * Convenience function to create masking provider SAP Data Privacy Integration. * @param dpiMaskingConfig - Configuration for the masking provider SAP Data Privacy Integration. * @returns An object with the masking provider configuration. */ export function buildDpiMaskingProvider(dpiMaskingConfig) { const { method, mask_grounding_input, entities, allowlist } = dpiMaskingConfig; return { type: 'sap_data_privacy_integration', method, entities: entities.map(entity => { if (typeof entity === 'string') { return { type: entity }; } return entity.type === 'custom' ? (({ type: _, ...rest }) => rest)(entity) : entity; }), ...(mask_grounding_input !== undefined && { mask_grounding_input: { enabled: mask_grounding_input } }), ...(allowlist && { allowlist }) }; } //# sourceMappingURL=masking.js.map