Skip to content

Commit daaa9ba

Browse files
committed
Changing method name
1 parent d602b23 commit daaa9ba

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

orchestration/src/main/java/com/sap/ai/sdk/orchestration/TranslationConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfigTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)