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
17 changes: 10 additions & 7 deletions docs/release-notes/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@

### 🔧 Compatibility Notes

- `ChatMessage`, as well as new `MultiChatMessage`, are now subtypes of new interface `ChatMessagesInner`.
Most variables or methods previously typed as `ChatMessage` in `model` package are now typed as `ChatMessagesInner`.
- `SingleChatMessage`, as well as new `MultiChatMessage`, are now subtypes of new interface `ChatMessage`.
Most variables or methods previously typed as `ChatMessage` in `model` package are now typed as `SingleChatMessage`.
- Add missing `@Beta` annotations to all `com.sap.ai.sdk.core.client` and `com.sap.ai.sdk.core.model` classes.

### ✨ New Functionality

- Orchestration supports images as input in newly introduced `MultiChatMessage`.
- `MultiChatMessage` also allows for multiple content items (text or image) in one object.
- Grounding input can be masked with `DPIConfig`.
- [Integrate the Orchestration client in Spring AI.](../guides/ORCHESTRATION_CHAT_COMPLETION.md#spring-ai-integration)
- New Orchestration features:
- [Spring AI integration](../guides/ORCHESTRATION_CHAT_COMPLETION.md#spring-ai-integration)
- Images are now supported as input in newly introduced `MultiChatMessage`.
- `MultiChatMessage` also allows for multiple content items (text or image) in one object.
- Grounding input can be masked with `DPIConfig`.
- LLama Guard can now be used for content filtering.
- Support for tool calling and response format

### 📈 Improvements

- Update Orchestration client to version 0.43.0 (2412a)
- Update Orchestration client to version 0.48.2 (2501a)

### 🐛 Fixed Issues

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sap.ai.sdk.orchestration;

import com.sap.ai.sdk.orchestration.model.ChatMessagesInner;
import com.sap.ai.sdk.orchestration.model.ChatMessage;
import com.sap.ai.sdk.orchestration.model.CompletionPostRequest;
import com.sap.ai.sdk.orchestration.model.ModuleConfigs;
import com.sap.ai.sdk.orchestration.model.OrchestrationConfig;
Expand Down Expand Up @@ -34,7 +34,7 @@ static CompletionPostRequest toCompletionPostRequest(
.messagesHistory(
prompt.getMessagesHistory().stream()
.map(Message::createChatMessage)
.map(ChatMessagesInner.class::cast)
.map(ChatMessage.class::cast)
.toList());
}

Expand All @@ -48,7 +48,7 @@ static TemplatingModuleConfig toTemplateModuleConfig(
* In this case, the request will fail, since the templating module will try to resolve the parameter.
* To be fixed with https://github.tools.sap/AI/llm-orchestration/issues/662
*/
val messages = template instanceof Template t ? t.getTemplate() : List.<ChatMessagesInner>of();
val messages = template instanceof Template t ? t.getTemplate() : List.<ChatMessage>of();
val messagesWithPrompt = new ArrayList<>(messages);
messagesWithPrompt.addAll(
prompt.getMessages().stream().map(Message::createChatMessage).toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.annotations.Beta;
import com.sap.ai.sdk.orchestration.model.ChatMessage;
import com.sap.ai.sdk.orchestration.model.SingleChatMessage;
import javax.annotation.Nonnull;

/** Interface representing convenience wrappers of chat message to the orchestration service. */
Expand Down Expand Up @@ -47,7 +48,7 @@ static SystemMessage system(@Nonnull final String msg) {
*/
@Nonnull
default ChatMessage createChatMessage() {
return ChatMessage.create().role(role()).content(content());
return SingleChatMessage.create().role(role()).content(content());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import static lombok.AccessLevel.PACKAGE;

import com.sap.ai.sdk.orchestration.model.ChatMessage;
import com.sap.ai.sdk.orchestration.model.ChatMessagesInner;
import com.sap.ai.sdk.orchestration.model.CompletionPostResponse;
import com.sap.ai.sdk.orchestration.model.LLMChoice;
import com.sap.ai.sdk.orchestration.model.LLMModuleResultSynchronous;
import com.sap.ai.sdk.orchestration.model.SingleChatMessage;
import com.sap.ai.sdk.orchestration.model.TokenUsage;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -58,9 +58,8 @@ public TokenUsage getTokenUsage() {
public List<Message> getAllMessages() throws UnsupportedOperationException {
final var messages = new ArrayList<Message>();

for (final ChatMessagesInner chatMessage :
originalResponse.getModuleResults().getTemplating()) {
if (chatMessage instanceof ChatMessage simpleMsg) {
for (final ChatMessage chatMessage : originalResponse.getModuleResults().getTemplating()) {
if (chatMessage instanceof SingleChatMessage simpleMsg) {
final var message =
switch (simpleMsg.getRole()) {
case "user" -> new UserMessage(simpleMsg.getContent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.common.annotations.Beta;
import com.sap.ai.sdk.orchestration.model.ChatMessagesInner;
import com.sap.ai.sdk.orchestration.model.ChatMessage;
import com.sap.ai.sdk.orchestration.model.LLMModuleResult;
import com.sap.ai.sdk.orchestration.model.ModuleResultsOutputUnmaskingInner;
import javax.annotation.Nonnull;
Expand Down Expand Up @@ -45,9 +45,9 @@ public static ObjectMapper getOrchestrationObjectMapper() {
final var module =
new SimpleModule()
.addDeserializer(
ChatMessagesInner.class,
PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessagesInner.class))
.setMixInAnnotation(ChatMessagesInner.class, JacksonMixins.NoneTypeInfoMixin.class);
ChatMessage.class,
PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessage.class))
.setMixInAnnotation(ChatMessage.class, JacksonMixins.NoneTypeInfoMixin.class);
jackson.registerModule(module);
return jackson;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Orchestration
* Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services.
*
* The version of the OpenAPI document: 0.43.0
* The version of the OpenAPI document: 0.48.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Orchestration
* Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services.
*
* The version of the OpenAPI document: 0.43.0
* The version of the OpenAPI document: 0.48.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -32,7 +32,7 @@
public class AzureContentSafetyFilterConfig implements FilterConfig
// CHECKSTYLE:ON
{
/** String represents name of the filter provider */
/** Name of the filter provider type */
public enum TypeEnum {
/** The AZURE_CONTENT_SAFETY option of this AzureContentSafetyFilterConfig */
AZURE_CONTENT_SAFETY("azure_content_safety"),
Expand Down Expand Up @@ -102,7 +102,7 @@ protected AzureContentSafetyFilterConfig() {}
* Set the type of this {@link AzureContentSafetyFilterConfig} instance and return the same
* instance.
*
* @param type String represents name of the filter provider
* @param type Name of the filter provider type
* @return The same instance of this {@link AzureContentSafetyFilterConfig} class
*/
@Nonnull
Expand All @@ -112,7 +112,7 @@ public AzureContentSafetyFilterConfig type(@Nonnull final TypeEnum type) {
}

/**
* String represents name of the filter provider
* Name of the filter provider type
*
* @return type The type of this {@link AzureContentSafetyFilterConfig} instance.
*/
Expand All @@ -124,7 +124,7 @@ public TypeEnum getType() {
/**
* Set the type of this {@link AzureContentSafetyFilterConfig} instance.
*
* @param type String represents name of the filter provider
* @param type Name of the filter provider type
*/
public void setType(@Nonnull final TypeEnum type) {
this.type = type;
Expand Down Expand Up @@ -261,7 +261,7 @@ public interface Builder {
/**
* Set the type of this {@link AzureContentSafetyFilterConfig} instance.
*
* @param type String represents name of the filter provider
* @param type Name of the filter provider type
* @return The AzureContentSafetyFilterConfig instance.
*/
AzureContentSafetyFilterConfig type(@Nonnull final TypeEnum type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Orchestration
* Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services.
*
* The version of the OpenAPI document: 0.43.0
* The version of the OpenAPI document: 0.48.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading
Loading