Skip to content

Commit 93ac0cc

Browse files
authored
chore: [Orchestration] Re-enable tests (#623)
* re-enable tests * add comment in release notes
1 parent 961c93d commit 93ac0cc

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

docs/release_notes.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- Two fields in `OrchestrationModuleConfig` changed:
1717
- `inputTranslationConfig` is now of type `SAPDocumentTranslationInput`
1818
- `outputTranslationConfig` is now of type `SAPDocumentTranslationOutput`
19-
- When using `OrchestrationModuleConfig.withInputTranslationConfig()` and `OrchestrationModuleConfig.withOutputTranslationConfig()` consider the following diff:
19+
- When using `OrchestrationModuleConfig.withInputTranslationConfig()` and `OrchestrationModuleConfig.withOutputTranslationConfig()` consider the following diff (note, especially, that setting `.applyTo()` to either `null` or to an actual value is necessary):
2020
```diff
2121
var config = new OrchestrationModuleConfig("some prompt");
2222
config
@@ -26,7 +26,10 @@
2626
- .config(SAPDocumentTranslationConfig.create().targetLanguage("en-US")))
2727
+ SAPDocumentTranslationInput.create()
2828
+ .type(SAPDocumentTranslationInput.TypeEnum.SAP_DOCUMENT_TRANSLATION)
29-
+ .config(SAPDocumentTranslationInputConfig.create().targetLanguage("en-US")))
29+
+ .config(
30+
+ SAPDocumentTranslationInputConfig.create()
31+
+ .targetLanguage("en-US")
32+
+ .applyTo(null)))
3033
.withOutputTranslationConfig(
3134
- SAPDocumentTranslation.create()
3235
- .type(SAP_DOCUMENT_TRANSLATION)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,10 @@ public OrchestrationChatResponse translation() {
619619
.withInputTranslationConfig(
620620
SAPDocumentTranslationInput.create()
621621
.type(SAPDocumentTranslationInput.TypeEnum.SAP_DOCUMENT_TRANSLATION)
622-
.config(SAPDocumentTranslationInputConfig.create().targetLanguage("en-US")))
622+
.config(
623+
SAPDocumentTranslationInputConfig.create()
624+
.targetLanguage("en-US")
625+
.applyTo(null)))
623626
.withOutputTranslationConfig(
624627
SAPDocumentTranslationOutput.create()
625628
.type(SAPDocumentTranslationOutput.TypeEnum.SAP_DOCUMENT_TRANSLATION)

sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import lombok.extern.slf4j.Slf4j;
3939
import lombok.val;
4040
import org.junit.jupiter.api.BeforeEach;
41-
import org.junit.jupiter.api.Disabled;
4241
import org.junit.jupiter.api.Test;
4342
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
4443

@@ -399,15 +398,13 @@ void testResponseFormatText() {
399398
}
400399

401400
@Test
402-
@Disabled("This behaviour is not released to canary yet.")
403401
void testTemplateFromPromptRegistryById() {
404402
val result = service.templateFromPromptRegistryById("Cloud ERP systems").getOriginalResponse();
405403
val choices = (result.getFinalResult()).getChoices();
406404
assertThat(choices.get(0).getMessage().getContent()).isNotEmpty();
407405
}
408406

409407
@Test
410-
@Disabled("This behaviour is not released to canary yet.")
411408
void testTemplateFromPromptRegistryByScenario() {
412409
val result =
413410
service.templateFromPromptRegistryByScenario("Cloud ERP systems").getOriginalResponse();
@@ -466,7 +463,6 @@ void testStreamingErrorHandlingMasking() {
466463
}
467464

468465
@Test
469-
@Disabled("This behaviour is not released to canary yet.")
470466
void testTranslation() {
471467
val result = service.translation();
472468
val content = result.getContent();
@@ -480,7 +476,8 @@ void testTranslation() {
480476
result.getOriginalResponse().getIntermediateResults().getOutputTranslation();
481477
assertThat(inputTranslation).isNotNull();
482478
assertThat(outputTranslation).isNotNull();
483-
assertThat(inputTranslation.getMessage()).isEqualTo("Input to LLM is translated successfully.");
479+
assertThat(inputTranslation.getMessage())
480+
.isEqualTo("Translated messages with roles: ['user']. ");
484481
assertThat(outputTranslation.getMessage()).isEqualTo("Output Translation successful");
485482
}
486483

0 commit comments

Comments
 (0)