File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
main/java/com/sap/ai/sdk/orchestration
test/java/com/sap/ai/sdk/orchestration
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ SAPDocumentTranslationOutput createSAPDocumentTranslationOutput() {
7070 * @return A TranslationConfig configured for input translation
7171 */
7272 @ Nonnull
73- static TranslationConfig .Input createInput (@ Nonnull final String targetLanguage ) {
73+ static TranslationConfig .Input translateInputTo (@ Nonnull final String targetLanguage ) {
7474
7575 return new TranslationConfig .Input (targetLanguage , null , null );
7676 }
@@ -85,7 +85,7 @@ static TranslationConfig.Input createInput(@Nonnull final String targetLanguage)
8585 * @return A TranslationConfig configured for output translation
8686 */
8787 @ Nonnull
88- static TranslationConfig .Output createOutput (@ Nonnull final String targetLanguage ) {
88+ static TranslationConfig .Output translateOutputTo (@ Nonnull final String targetLanguage ) {
8989
9090 return new TranslationConfig .Output (targetLanguage , null );
9191 }
Original file line number Diff line number Diff line change @@ -140,9 +140,10 @@ void testDpiMaskingRegex() {
140140
141141 @ Test
142142 void testTranslationConfig () {
143- var inputTranslationConfig = TranslationConfig .createInput ("en-US" ).withSourceLanguage ("de-DE" );
143+ var inputTranslationConfig =
144+ TranslationConfig .translateInputTo ("en-US" ).withSourceLanguage ("de-DE" );
144145 var outputTranslationConfig =
145- TranslationConfig .createOutput ("de-DE" ).withSourceLanguage ("en-US" );
146+ TranslationConfig .translateOutputTo ("de-DE" ).withSourceLanguage ("en-US" );
146147 var config =
147148 new OrchestrationModuleConfig ()
148149 .withLlmConfig (GPT_4O )
Original file line number Diff line number Diff line change @@ -616,9 +616,9 @@ public OrchestrationChatResponse translation() {
616616 // https://help.sap.com/docs/translation-hub/sap-translation-hub/supported-languages?version=Cloud#translation-provider-sap-machine-translation
617617 val configWithTranslation =
618618 config
619- .withInputTranslationConfig (TranslationConfig .createInput ("en-US" ))
619+ .withInputTranslationConfig (TranslationConfig .translateInputTo ("en-US" ))
620620 .withOutputTranslationConfig (
621- TranslationConfig .createOutput ("de-DE" )
621+ TranslationConfig .translateOutputTo ("de-DE" )
622622 .withSourceLanguage ("en-US" )); // optional source language
623623
624624 return client .chatCompletion (prompt , configWithTranslation );
You can’t perform that action at this time.
0 commit comments