Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,13 +71,16 @@ 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(
model ->
model.getAllowedScenarios().stream()
.anyMatch(scenario -> scenario.getScenarioId().equals("orchestration")))
.filter(model -> !model.getModel().contains("embed"))
.filter(model -> !internalOnlyModels.contains(model.getModel()))
.collect(
() -> new HashMap<String, Boolean>(),
(list, model) -> list.put(model.getModel(), isDeprecated(model)),
Expand Down
Loading