Skip to content

Commit d60505e

Browse files
committed
Fix compilation
1 parent 5e915ba commit d60505e

File tree

75 files changed

+220
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+220
-396
lines changed

.github/workflows/continuous-integration.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
jobs:
1515

1616
continuous-integration:
17+
# https://wiki.one.int.sap/wiki/display/DevFw/SUGAR
1718
runs-on: ubuntu-latest
1819
steps:
1920

.github/workflows/spec-update.yaml

Lines changed: 0 additions & 177 deletions
This file was deleted.

orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.sap.ai.sdk.orchestration;
22

3-
import com.sap.ai.sdk.orchestration.model.ChatMessagesInner;
3+
import com.sap.ai.sdk.orchestration.model.ChatMessage;
44
import com.sap.ai.sdk.orchestration.model.CompletionPostRequest;
55
import com.sap.ai.sdk.orchestration.model.ModuleConfigs;
66
import com.sap.ai.sdk.orchestration.model.OrchestrationConfig;
@@ -34,7 +34,7 @@ static CompletionPostRequest toCompletionPostRequest(
3434
.messagesHistory(
3535
prompt.getMessagesHistory().stream()
3636
.map(Message::createChatMessage)
37-
.map(ChatMessagesInner.class::cast)
37+
.map(ChatMessage.class::cast)
3838
.toList());
3939
}
4040

@@ -48,7 +48,7 @@ static TemplatingModuleConfig toTemplateModuleConfig(
4848
* In this case, the request will fail, since the templating module will try to resolve the parameter.
4949
* To be fixed with https://github.tools.sap/AI/llm-orchestration/issues/662
5050
*/
51-
val messages = template instanceof Template t ? t.getTemplate() : List.<ChatMessagesInner>of();
51+
val messages = template instanceof Template t ? t.getTemplate() : List.<ChatMessage>of();
5252
val messagesWithPrompt = new ArrayList<>(messages);
5353
messagesWithPrompt.addAll(
5454
prompt.getMessages().stream().map(Message::createChatMessage).toList());

orchestration/src/main/java/com/sap/ai/sdk/orchestration/Message.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.annotations.Beta;
44
import com.sap.ai.sdk.orchestration.model.ChatMessage;
5+
import com.sap.ai.sdk.orchestration.model.SingleChatMessage;
56
import javax.annotation.Nonnull;
67

78
/** Interface representing convenience wrappers of chat message to the orchestration service. */
@@ -47,7 +48,7 @@ static SystemMessage system(@Nonnull final String msg) {
4748
*/
4849
@Nonnull
4950
default ChatMessage createChatMessage() {
50-
return ChatMessage.create().role(role()).content(content());
51+
return SingleChatMessage.create().role(role()).content(content());
5152
}
5253

5354
/**

orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationChatResponse.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import static lombok.AccessLevel.PACKAGE;
44

55
import com.sap.ai.sdk.orchestration.model.ChatMessage;
6-
import com.sap.ai.sdk.orchestration.model.ChatMessagesInner;
76
import com.sap.ai.sdk.orchestration.model.CompletionPostResponse;
87
import com.sap.ai.sdk.orchestration.model.LLMChoice;
98
import com.sap.ai.sdk.orchestration.model.LLMModuleResultSynchronous;
9+
import com.sap.ai.sdk.orchestration.model.SingleChatMessage;
1010
import com.sap.ai.sdk.orchestration.model.TokenUsage;
1111
import java.util.ArrayList;
1212
import java.util.List;
@@ -58,9 +58,8 @@ public TokenUsage getTokenUsage() {
5858
public List<Message> getAllMessages() throws UnsupportedOperationException {
5959
final var messages = new ArrayList<Message>();
6060

61-
for (final ChatMessagesInner chatMessage :
62-
originalResponse.getModuleResults().getTemplating()) {
63-
if (chatMessage instanceof ChatMessage simpleMsg) {
61+
for (final ChatMessage chatMessage : originalResponse.getModuleResults().getTemplating()) {
62+
if (chatMessage instanceof SingleChatMessage simpleMsg) {
6463
final var message =
6564
switch (simpleMsg.getRole()) {
6665
case "user" -> new UserMessage(simpleMsg.getContent());

orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import com.sap.ai.sdk.core.common.ClientResponseHandler;
1414
import com.sap.ai.sdk.core.common.ClientStreamingHandler;
1515
import com.sap.ai.sdk.core.common.StreamedDelta;
16-
import com.sap.ai.sdk.orchestration.model.ChatMessagesInner;
16+
import com.sap.ai.sdk.orchestration.model.ChatMessage;
1717
import com.sap.ai.sdk.orchestration.model.CompletionPostRequest;
1818
import com.sap.ai.sdk.orchestration.model.CompletionPostResponse;
1919
import com.sap.ai.sdk.orchestration.model.LLMModuleResult;
@@ -55,9 +55,9 @@ public class OrchestrationClient {
5555
final var module =
5656
new SimpleModule()
5757
.addDeserializer(
58-
ChatMessagesInner.class,
59-
PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessagesInner.class))
60-
.setMixInAnnotation(ChatMessagesInner.class, JacksonMixins.NoneTypeInfoMixin.class);
58+
ChatMessage.class,
59+
PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessage.class))
60+
.setMixInAnnotation(ChatMessage.class, JacksonMixins.NoneTypeInfoMixin.class);
6161
JACKSON.registerModule(module);
6262
}
6363

orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* Internal Orchestration Service API
3-
* SAP AI Core - Orchestration Service API
2+
* Orchestration
3+
* 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.
44
*
5-
* The version of the OpenAPI document: 0.0.1
5+
* The version of the OpenAPI document: 0.48.2
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* Internal Orchestration Service API
3-
* SAP AI Core - Orchestration Service API
2+
* Orchestration
3+
* 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.
44
*
5-
* The version of the OpenAPI document: 0.0.1
5+
* The version of the OpenAPI document: 0.48.2
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* Internal Orchestration Service API
3-
* SAP AI Core - Orchestration Service API
2+
* Orchestration
3+
* 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.
44
*
5-
* The version of the OpenAPI document: 0.0.1
5+
* The version of the OpenAPI document: 0.48.2
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatCompletionTool.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* Internal Orchestration Service API
3-
* SAP AI Core - Orchestration Service API
2+
* Orchestration
3+
* 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.
44
*
5-
* The version of the OpenAPI document: 0.0.1
5+
* The version of the OpenAPI document: 0.48.2
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

0 commit comments

Comments
 (0)