@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**.
20 lines • 919 B
JavaScript
/**
* Convenience function to build a document translation configuration for orchestration service.
* @param config - Config for SAP Document Translation service.
* The target language is mandatory, while source language will be auto-detected if not provided.
* See https://help.sap.com/docs/translation-hub/sap-translation-hub/supported-languages-6854bbb1bd824ffebc3a097a7c0fd45d for list of supported languages.
* @returns A `SAPDocumentTranslation` configuration object.
* @example "buildTranslationConfig({ sourceLanguage: 'de-DE', targetLanguage: 'en-US' })"
*/
export function buildTranslationConfig(config) {
return {
type: 'sap_document_translation',
config: {
...(config.sourceLanguage && {
source_language: config.sourceLanguage
}),
target_language: config.targetLanguage
}
};
}
//# sourceMappingURL=translation.js.map