diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java index 1e9e0a096..85943bcd0 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java @@ -465,12 +465,15 @@ public record Translation( @Nonnull public OrchestrationChatResponse responseFormatJsonSchema( @Nonnull final String word, @Nonnull final Class targetType) { + // Gemini cannot be used here. This is a known issue that should be resolved with AI Core + // release 2510b. See https://jira.tools.sap/browse/AI-125770 + final var configWithGpt4 = new OrchestrationModuleConfig().withLlmConfig(GPT_4O_MINI); val schema = ResponseJsonSchema.fromType(targetType) .withDescription("Output schema for language translation.") .withStrict(true); val configWithResponseSchema = - config.withTemplateConfig(TemplateConfig.create().withJsonSchemaResponse(schema)); + configWithGpt4.withTemplateConfig(TemplateConfig.create().withJsonSchemaResponse(schema)); val prompt = new OrchestrationPrompt( @@ -586,8 +589,12 @@ public OrchestrationChatResponse templateFromPromptRegistryByScenario( @Nonnull public OrchestrationChatResponse localPromptTemplate(@Nonnull final String promptTemplate) throws IOException { + // Gemini cannot be used here. This is a known issue that should be resolved with AI Core + // release 2510b. See https://jira.tools.sap/browse/AI-125770 + final var configWithGpt4 = new OrchestrationModuleConfig().withLlmConfig(GPT_4O_MINI); val template = TemplateConfig.create().fromYaml(promptTemplate); - val configWithTemplate = template != null ? config.withTemplateConfig(template) : config; + val configWithTemplate = + template != null ? configWithGpt4.withTemplateConfig(template) : configWithGpt4; val inputParams = Map.of("language", "German"); val prompt = new OrchestrationPrompt(inputParams); diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/ScenarioTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/ScenarioTest.java index a2085e412..767c88f28 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/ScenarioTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/ScenarioTest.java @@ -9,6 +9,7 @@ import java.lang.reflect.Field; import java.util.HashMap; import java.util.Optional; +import java.util.Set; import lombok.SneakyThrows; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.DisplayName; @@ -70,6 +71,8 @@ void orchestrationAiModelAvailability() { // Gather AI Core's list of available Orchestration models final var aiModelList = new ScenarioController().getModels().getResources(); + var internalOnlyModels = Set.of("abap-codestral"); + final var availableOrchestrationModels = aiModelList.stream() .filter( @@ -77,6 +80,7 @@ void orchestrationAiModelAvailability() { model.getAllowedScenarios().stream() .anyMatch(scenario -> scenario.getScenarioId().equals("orchestration"))) .filter(model -> !model.getModel().contains("embed")) + .filter(model -> !internalOnlyModels.contains(model.getModel())) .collect( () -> new HashMap(), (list, model) -> list.put(model.getModel(), isDeprecated(model)),