Skip to content
Open
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
7 changes: 7 additions & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
### ✨ New Functionality

- [RPT] Introducing `RptClient` for Tabular AI backed by SAP RPT models `SAP_RPT_1_SMALL` and `SAP_RPT_1_LARGE`.
- [Orchestration] Deprecated `ALEPHALPHA_PHARIA_1_7B_CONTROL` model from `OrchestrationAiModel` with replacement model `MISTRAL_SMALL_INSTRUCT`.
- [Orchestration] Deprecated `GPT_4O_MINI` model from `OrchestrationAiModel` with replacement model `GPT_5_MINI`.
- [Orchestration] Deprecated `GEMINI_2_0_FLASH` model from `OrchestrationAiModel`.
- [Orchestration] Deprecated `GEMINI_2_0_FLASH_LITE` model from `OrchestrationAiModel`.
- [Orchestration] Deprecated `CLAUDE_3_7_SONNET` model from `OrchestrationAiModel`.
- [Orchestration] Deprecated `GPT_4O_MINI` model from `OpenAiModel` with replacement model `GPT_5_MINI`.
- [Orchestration] Deprecated `DALL_E_3` model from `OpenAiModel`.

### 📈 Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
*/
public record OpenAiModel(@Nonnull String name, @Nullable String version) implements AiModel {

/** internal [Azure OpenAI dall-e-3 model] */
public static final OpenAiModel DALL_E_3 = new OpenAiModel("dall-e-3", null);
/**
* internal [Azure OpenAI dall-e-3 model]
*
* @deprecated This model is deprecated on AI Core.
*/
@Deprecated public static final OpenAiModel DALL_E_3 = new OpenAiModel("dall-e-3", null);

/**
* Azure OpenAI GPT-3.5 Turbo model
Expand Down Expand Up @@ -63,8 +67,13 @@ public record OpenAiModel(@Nonnull String name, @Nullable String version) implem
/** Azure OpenAI GPT-4o model */
public static final OpenAiModel GPT_4O = new OpenAiModel("gpt-4o", null);

/** Azure OpenAI GPT-4o Mini model */
public static final OpenAiModel GPT_4O_MINI = new OpenAiModel("gpt-4o-mini", null);
/**
* Azure OpenAI GPT-4o Mini model
*
* @deprecated This model is deprecated on AI Core.The suggested replacement model is {@link
* OpenAiModel#GPT_5_MINI}.
*/
@Deprecated public static final OpenAiModel GPT_4O_MINI = new OpenAiModel("gpt-4o-mini", null);

/** Azure OpenAI GPT-o3 Mini model */
public static final OpenAiModel O3_MINI = new OpenAiModel("o3-mini", null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ public class OrchestrationAiModel {
public static final OrchestrationAiModel CLAUDE_3_5_SONNET =
new OrchestrationAiModel("anthropic--claude-3.5-sonnet");

/** Anthropic Claude 3.7 Sonnet model */
/**
* Anthropic Claude 3.7 Sonnet model
*
* @deprecated This model is deprecated on AI Core with a planned retirement on 2025-04-28.
*/
@Deprecated
public static final OrchestrationAiModel CLAUDE_3_7_SONNET =
new OrchestrationAiModel("anthropic--claude-3.7-sonnet");

Expand Down Expand Up @@ -259,7 +264,13 @@ public class OrchestrationAiModel {
/** Azure OpenAI GPT-4o model */
public static final OrchestrationAiModel GPT_4O = new OrchestrationAiModel("gpt-4o");

/** Azure OpenAI GPT-4o-mini model */
/**
* Azure OpenAI GPT-4o-mini model
*
* @deprecated This model is deprecated on AI Core.The suggested replacement model is {@link
* OrchestrationAiModel#GPT_5_MINI}.
*/
@Deprecated
public static final OrchestrationAiModel GPT_4O_MINI = new OrchestrationAiModel("gpt-4o-mini");

/** Azure OpenAI o1 model */
Expand Down Expand Up @@ -314,11 +325,21 @@ public class OrchestrationAiModel {
public static final OrchestrationAiModel GEMINI_1_5_FLASH =
new OrchestrationAiModel("gemini-1.5-flash");

/** Google Cloud Platform Gemini 2.0 Flash model */
/**
* Google Cloud Platform Gemini 2.0 Flash model
*
* @deprecated This model is deprecated on AI Core with a planned retirement on 2026-02-05.
*/
@Deprecated
public static final OrchestrationAiModel GEMINI_2_0_FLASH =
new OrchestrationAiModel("gemini-2.0-flash");

/** Google Cloud Platform Gemini 2.0 Flash-Lite model */
/**
* Google Cloud Platform Gemini 2.0 Flash-Lite model
*
* @deprecated This model is deprecated on AI Core with a planned retirement on 2026-02-25.
*/
@Deprecated
public static final OrchestrationAiModel GEMINI_2_0_FLASH_LITE =
new OrchestrationAiModel("gemini-2.0-flash-lite");

Expand All @@ -334,7 +355,13 @@ public class OrchestrationAiModel {
public static final OrchestrationAiModel GEMINI_2_5_PRO =
new OrchestrationAiModel("gemini-2.5-pro");

/** Alephalpha-pharia-1-7b-control model */
/**
* Alephalpha-pharia-1-7b-control model
*
* @deprecated This model is deprecated on AI Core with a planned retirement on 2025-10-31.The
* suggested replacement model is {@link OrchestrationAiModel#MISTRAL_SMALL_INSTRUCT}.
*/
@Deprecated
public static final OrchestrationAiModel ALEPHALPHA_PHARIA_1_7B_CONTROL =
new OrchestrationAiModel("alephalpha-pharia-1-7b-control");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ List<PromptTemplateDeleteResponse> deleteTemplate() {

@GetMapping("/promptRegistryToSpringAi")
Generation promptRegistryToSpringAi() {
val openAiClient = new OpenAiChatModel(OpenAiClient.forModel(OpenAiModel.GPT_4O_MINI));
val openAiClient = new OpenAiChatModel(OpenAiClient.forModel(OpenAiModel.GPT_5_MINI));
val repository = new InMemoryChatMemoryRepository();
val memory = MessageWindowChatMemory.builder().chatMemoryRepository(repository).build();
val advisor = MessageChatMemoryAdvisor.builder(memory).build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sap.ai.sdk.app.services;

import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.GPT_4O;
import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.GPT_4O_MINI;
import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.GPT_5_MINI;
import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.TEXT_EMBEDDING_3_SMALL;

import com.sap.ai.sdk.core.AiCoreService;
Expand Down Expand Up @@ -34,7 +34,7 @@ public class OpenAiService {
*/
@Nonnull
public OpenAiChatCompletionResponse chatCompletion(@Nonnull final String prompt) {
return OpenAiClient.forModel(GPT_4O_MINI)
return OpenAiClient.forModel(GPT_5_MINI)
.chatCompletion(new OpenAiChatCompletionRequest(prompt));
}

Expand All @@ -50,13 +50,13 @@ public OpenAiChatCompletionResponse messagesHistory(@Nonnull final String previo
messagesList.add(OpenAiMessage.user(previousMessage));

final OpenAiChatCompletionResponse result =
OpenAiClient.forModel(GPT_4O_MINI)
OpenAiClient.forModel(GPT_5_MINI)
.chatCompletion(new OpenAiChatCompletionRequest(messagesList));

messagesList.add(result.getMessage());
messagesList.add(OpenAiMessage.user("What is the typical food there?"));

return OpenAiClient.forModel(GPT_4O_MINI)
return OpenAiClient.forModel(GPT_5_MINI)
.chatCompletion(new OpenAiChatCompletionRequest(messagesList));
}

Expand All @@ -71,7 +71,7 @@ public Stream<OpenAiChatCompletionDelta> streamChatCompletionDeltas(
@Nonnull final String message) {
final var request = new OpenAiChatCompletionRequest(OpenAiMessage.user(message));

return OpenAiClient.forModel(GPT_4O_MINI).streamChatCompletionDeltas(request);
return OpenAiClient.forModel(GPT_5_MINI).streamChatCompletionDeltas(request);
}

/**
Expand All @@ -82,7 +82,7 @@ public Stream<OpenAiChatCompletionDelta> streamChatCompletionDeltas(
*/
@Nonnull
public Stream<String> streamChatCompletion(@Nonnull final String message) {
return OpenAiClient.forModel(GPT_4O_MINI)
return OpenAiClient.forModel(GPT_5_MINI)
.withSystemPrompt("Be a good, honest AI and answer the following question:")
.streamChatCompletion(message);
}
Expand Down Expand Up @@ -115,7 +115,7 @@ public OpenAiChatCompletionResponse chatCompletionImage(@Nonnull final String li
@Nonnull
public OpenAiChatCompletionResponse chatCompletionToolExecution(
@Nonnull final String location, @Nonnull final String unit) {
final OpenAiClient client = OpenAiClient.forModel(GPT_4O_MINI);
final OpenAiClient client = OpenAiClient.forModel(GPT_5_MINI);

final var messages = new ArrayList<OpenAiMessage>();
messages.add(OpenAiMessage.user("What's the weather in %s in %s?".formatted(location, unit)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SpringAiOpenAiService {
private final OpenAiSpringEmbeddingModel embeddingClient =
new OpenAiSpringEmbeddingModel(OpenAiClient.forModel(OpenAiModel.TEXT_EMBEDDING_3_SMALL));
private final ChatModel chatClient =
new OpenAiChatModel(OpenAiClient.forModel(OpenAiModel.GPT_4O_MINI));
new OpenAiChatModel(OpenAiClient.forModel(OpenAiModel.GPT_5_MINI));

/**
* Embeds a list of strings using the OpenAI embedding model.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sap.ai.sdk.app.controllers;

import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.GPT_4O_MINI;
import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.GPT_5_MINI;
import static com.sap.ai.sdk.foundationmodels.openai.generated.model.ChatCompletionResponseMessageRole.ASSISTANT;
import static org.assertj.core.api.Assertions.assertThat;

Expand Down Expand Up @@ -56,7 +56,7 @@ void streamChatCompletion() {
final var usageRef = new AtomicReference<CompletionUsage>();
final var filledDeltaCount = new AtomicInteger(0);

OpenAiClient.forModel(GPT_4O_MINI)
OpenAiClient.forModel(GPT_5_MINI)
.streamChatCompletionDeltas(prompt)
// foreach consumes all elements, closing the stream at the end
.forEach(
Expand Down