Skip to content

Commit 97bfe57

Browse files
authored
chore: [DevOps] Fix e2e tests (#619)
* fix e2e tests * codestyle
1 parent f42b195 commit 97bfe57

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,15 @@ public record Translation(
465465
@Nonnull
466466
public OrchestrationChatResponse responseFormatJsonSchema(
467467
@Nonnull final String word, @Nonnull final Class<?> targetType) {
468+
// Gemini cannot be used here. This is a known issue that should be resolved with AI Core
469+
// release 2510b. See https://jira.tools.sap/browse/AI-125770
470+
final var configWithGpt4 = new OrchestrationModuleConfig().withLlmConfig(GPT_4O_MINI);
468471
val schema =
469472
ResponseJsonSchema.fromType(targetType)
470473
.withDescription("Output schema for language translation.")
471474
.withStrict(true);
472475
val configWithResponseSchema =
473-
config.withTemplateConfig(TemplateConfig.create().withJsonSchemaResponse(schema));
476+
configWithGpt4.withTemplateConfig(TemplateConfig.create().withJsonSchemaResponse(schema));
474477

475478
val prompt =
476479
new OrchestrationPrompt(
@@ -586,8 +589,12 @@ public OrchestrationChatResponse templateFromPromptRegistryByScenario(
586589
@Nonnull
587590
public OrchestrationChatResponse localPromptTemplate(@Nonnull final String promptTemplate)
588591
throws IOException {
592+
// Gemini cannot be used here. This is a known issue that should be resolved with AI Core
593+
// release 2510b. See https://jira.tools.sap/browse/AI-125770
594+
final var configWithGpt4 = new OrchestrationModuleConfig().withLlmConfig(GPT_4O_MINI);
589595
val template = TemplateConfig.create().fromYaml(promptTemplate);
590-
val configWithTemplate = template != null ? config.withTemplateConfig(template) : config;
596+
val configWithTemplate =
597+
template != null ? configWithGpt4.withTemplateConfig(template) : configWithGpt4;
591598

592599
val inputParams = Map.of("language", "German");
593600
val prompt = new OrchestrationPrompt(inputParams);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.lang.reflect.Field;
1010
import java.util.HashMap;
1111
import java.util.Optional;
12+
import java.util.Set;
1213
import lombok.SneakyThrows;
1314
import org.assertj.core.api.SoftAssertions;
1415
import org.junit.jupiter.api.DisplayName;
@@ -70,13 +71,16 @@ void orchestrationAiModelAvailability() {
7071
// Gather AI Core's list of available Orchestration models
7172
final var aiModelList = new ScenarioController().getModels().getResources();
7273

74+
var internalOnlyModels = Set.of("abap-codestral");
75+
7376
final var availableOrchestrationModels =
7477
aiModelList.stream()
7578
.filter(
7679
model ->
7780
model.getAllowedScenarios().stream()
7881
.anyMatch(scenario -> scenario.getScenarioId().equals("orchestration")))
7982
.filter(model -> !model.getModel().contains("embed"))
83+
.filter(model -> !internalOnlyModels.contains(model.getModel()))
8084
.collect(
8185
() -> new HashMap<String, Boolean>(),
8286
(list, model) -> list.put(model.getModel(), isDeprecated(model)),

0 commit comments

Comments
 (0)