Skip to content

Commit fc474a0

Browse files
authored
chore: [DevOps] Update Cloud SDK version and regenerate models (#616)
* Generate new model classes for float[] * Regenerate for all modules * Add release notes
1 parent 2b4e668 commit fc474a0

File tree

39 files changed

+324
-289
lines changed

39 files changed

+324
-289
lines changed

core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CreatePipeline.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@
2222
@JsonSubTypes.Type(value = SDMPipelineCreateRequest.class, name = "SDM"),
2323
@JsonSubTypes.Type(value = SFTPPipelineCreateRequest.class, name = "SFTP"),
2424
@JsonSubTypes.Type(value = WorkZonePipelineCreateRequest.class, name = "WorkZone"),
25-
@JsonSubTypes.Type(
26-
value = MSSharePointPipelineCreateRequest.class,
27-
name = "MSSharePointPipelineCreateRequest"),
28-
@JsonSubTypes.Type(value = S3PipelineCreateRequest.class, name = "S3PipelineCreateRequest"),
29-
@JsonSubTypes.Type(value = SDMPipelineCreateRequest.class, name = "SDMPipelineCreateRequest"),
30-
@JsonSubTypes.Type(value = SFTPPipelineCreateRequest.class, name = "SFTPPipelineCreateRequest"),
31-
@JsonSubTypes.Type(
32-
value = WorkZonePipelineCreateRequest.class,
33-
name = "WorkZonePipelineCreateRequest"),
3425
})
3526
public interface CreatePipeline {
3627
Object getType();

core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipeline.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@
2222
@JsonSubTypes.Type(value = SDMPipelineGetResponse.class, name = "SDM"),
2323
@JsonSubTypes.Type(value = SFTPPipelineGetResponse.class, name = "SFTP"),
2424
@JsonSubTypes.Type(value = WorkZonePipelineGetResponse.class, name = "WorkZone"),
25-
@JsonSubTypes.Type(
26-
value = MSSharePointPipelineGetResponse.class,
27-
name = "MSSharePointPipelineGetResponse"),
28-
@JsonSubTypes.Type(value = S3PipelineGetResponse.class, name = "S3PipelineGetResponse"),
29-
@JsonSubTypes.Type(value = SDMPipelineGetResponse.class, name = "SDMPipelineGetResponse"),
30-
@JsonSubTypes.Type(value = SFTPPipelineGetResponse.class, name = "SFTPPipelineGetResponse"),
31-
@JsonSubTypes.Type(
32-
value = WorkZonePipelineGetResponse.class,
33-
name = "WorkZonePipelineGetResponse"),
3425
})
3526
public interface GetPipeline {
3627
Object getType();

core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineMinimalResponse.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@
2222
@JsonSubTypes.Type(value = SDMPipelineMinimalResponse.class, name = "SDM"),
2323
@JsonSubTypes.Type(value = SFTPPipelineMinimalResponse.class, name = "SFTP"),
2424
@JsonSubTypes.Type(value = WorkZonePipelineMinimalResponse.class, name = "WorkZone"),
25-
@JsonSubTypes.Type(
26-
value = MSSharePointPipelineMinimalResponse.class,
27-
name = "MSSharePointPipelineMinimalResponse"),
28-
@JsonSubTypes.Type(value = S3PipelineMinimalResponse.class, name = "S3PipelineMinimalResponse"),
29-
@JsonSubTypes.Type(value = SDMPipelineMinimalResponse.class, name = "SDMPipelineMinimalResponse"),
30-
@JsonSubTypes.Type(
31-
value = SFTPPipelineMinimalResponse.class,
32-
name = "SFTPPipelineMinimalResponse"),
33-
@JsonSubTypes.Type(
34-
value = WorkZonePipelineMinimalResponse.class,
35-
name = "WorkZonePipelineMinimalResponse"),
3625
})
3726
public interface PipelineMinimalResponse {
3827
Object getType();

core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/ChatMessageContent.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,38 @@
1616

1717
/** ChatMessageContent */
1818
public interface ChatMessageContent {
19-
/** Helper class to create a String that implements {@link ChatMessageContent}. */
20-
record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value)
19+
/**
20+
* Helper class to create {@code List<TextContent> } that implements {@link ChatMessageContent}.
21+
*/
22+
record ListOfTextContents(
23+
@com.fasterxml.jackson.annotation.JsonValue @Nonnull List<TextContent> values)
2124
implements ChatMessageContent {}
2225

2326
/**
24-
* Creator to enable deserialization of a String.
27+
* Creator to enable deserialization of {@code List<TextContent> }.
2528
*
2629
* @param val the value to use
27-
* @return a new instance of {@link InnerString}.
30+
* @return a new instance of {@link ListOfTextContents}.
2831
*/
2932
@com.fasterxml.jackson.annotation.JsonCreator
3033
@Nonnull
31-
static InnerString create(@Nonnull final String val) {
32-
return new InnerString(val);
34+
static ListOfTextContents createListOfTextContents(@Nonnull final List<TextContent> val) {
35+
return new ListOfTextContents(val);
3336
}
3437

35-
/** Helper class to create a list of TextContent that implements {@link ChatMessageContent}. */
36-
record InnerTextContents(
37-
@com.fasterxml.jackson.annotation.JsonValue @Nonnull List<TextContent> values)
38+
/** Helper class to create {@code String } that implements {@link ChatMessageContent}. */
39+
record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value)
3840
implements ChatMessageContent {}
3941

4042
/**
41-
* Creator to enable deserialization of a list of TextContent.
43+
* Creator to enable deserialization of {@code String }.
4244
*
4345
* @param val the value to use
44-
* @return a new instance of {@link InnerTextContents}.
46+
* @return a new instance of {@link InnerString}.
4547
*/
4648
@com.fasterxml.jackson.annotation.JsonCreator
4749
@Nonnull
48-
static InnerTextContents create(@Nonnull final List<TextContent> val) {
49-
return new InnerTextContents(val);
50+
static InnerString create(@Nonnull final String val) {
51+
return new InnerString(val);
5052
}
5153
}

core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/UserChatMessageContent.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,40 @@
1616

1717
/** UserChatMessageContent */
1818
public interface UserChatMessageContent {
19-
/** Helper class to create a String that implements {@link UserChatMessageContent}. */
20-
record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value)
19+
/**
20+
* Helper class to create {@code List<UserChatMessageContentItem> } that implements {@link
21+
* UserChatMessageContent}.
22+
*/
23+
record ListOfUserChatMessageContentItems(
24+
@com.fasterxml.jackson.annotation.JsonValue @Nonnull List<UserChatMessageContentItem> values)
2125
implements UserChatMessageContent {}
2226

2327
/**
24-
* Creator to enable deserialization of a String.
28+
* Creator to enable deserialization of {@code List<UserChatMessageContentItem> }.
2529
*
2630
* @param val the value to use
27-
* @return a new instance of {@link InnerString}.
31+
* @return a new instance of {@link ListOfUserChatMessageContentItems}.
2832
*/
2933
@com.fasterxml.jackson.annotation.JsonCreator
3034
@Nonnull
31-
static InnerString create(@Nonnull final String val) {
32-
return new InnerString(val);
35+
static ListOfUserChatMessageContentItems createListOfUserChatMessageContentItems(
36+
@Nonnull final List<UserChatMessageContentItem> val) {
37+
return new ListOfUserChatMessageContentItems(val);
3338
}
3439

35-
/**
36-
* Helper class to create a list of UserChatMessageContentItem that implements {@link
37-
* UserChatMessageContent}.
38-
*/
39-
record InnerUserChatMessageContentItems(
40-
@com.fasterxml.jackson.annotation.JsonValue @Nonnull List<UserChatMessageContentItem> values)
40+
/** Helper class to create {@code String } that implements {@link UserChatMessageContent}. */
41+
record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value)
4142
implements UserChatMessageContent {}
4243

4344
/**
44-
* Creator to enable deserialization of a list of UserChatMessageContentItem.
45+
* Creator to enable deserialization of {@code String }.
4546
*
4647
* @param val the value to use
47-
* @return a new instance of {@link InnerUserChatMessageContentItems}.
48+
* @return a new instance of {@link InnerString}.
4849
*/
4950
@com.fasterxml.jackson.annotation.JsonCreator
5051
@Nonnull
51-
static InnerUserChatMessageContentItems create(
52-
@Nonnull final List<UserChatMessageContentItem> val) {
53-
return new InnerUserChatMessageContentItems(val);
52+
static InnerString create(@Nonnull final String val) {
53+
return new InnerString(val);
5454
}
5555
}

core/src/main/java/com/sap/ai/sdk/core/model/KpiResultRowItem.java

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,39 @@
1111

1212
package com.sap.ai.sdk.core.model;
1313

14+
import javax.annotation.Nonnull;
15+
1416
/** KpiResultRowItem */
15-
public interface KpiResultRowItem {}
17+
public interface KpiResultRowItem {
18+
/** Helper class to create {@code Long } that implements {@link KpiResultRowItem}. */
19+
record InnerLong(@com.fasterxml.jackson.annotation.JsonValue @Nonnull Long value)
20+
implements KpiResultRowItem {}
21+
22+
/**
23+
* Creator to enable deserialization of {@code Long }.
24+
*
25+
* @param val the value to use
26+
* @return a new instance of {@link InnerLong}.
27+
*/
28+
@com.fasterxml.jackson.annotation.JsonCreator
29+
@Nonnull
30+
static InnerLong create(@Nonnull final Long val) {
31+
return new InnerLong(val);
32+
}
33+
34+
/** Helper class to create {@code String } that implements {@link KpiResultRowItem}. */
35+
record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value)
36+
implements KpiResultRowItem {}
37+
38+
/**
39+
* Creator to enable deserialization of {@code String }.
40+
*
41+
* @param val the value to use
42+
* @return a new instance of {@link InnerString}.
43+
*/
44+
@com.fasterxml.jackson.annotation.JsonCreator
45+
@Nonnull
46+
static InnerString create(@Nonnull final String val) {
47+
return new InnerString(val);
48+
}
49+
}

docs/release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
```
4343
- [Orchestration] Deprecated models `OrchestrationAiModel.CLAUDE_3_OPUS` and `OrchestrationAiModel.CLAUDE_3_5_SONNET`.
4444
- Replacement are respectively `OrchestrationAiModel.CLAUDE_4_OPUS` and `OrchestrationAiModel.CLAUDE_4_SONNET`.
45+
- Inner record classes and their creator methods in model interfaces are renamed to be more descriptive and type-specific.
46+
- eg: `InnerString` -> `ListOfStrings`, `create()` -> `createListOfStrings()`
4547

4648
### ✨ New Functionality
4749

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAiChatCompletionRequest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ CreateChatCompletionRequest createCreateChatCompletionRequest() {
309309
message ->
310310
request.addMessagesItem(OpenAiUtils.createChatCompletionRequestMessage(message)));
311311

312-
request.stop(this.stop != null ? CreateChatCompletionRequestAllOfStop.create(this.stop) : null);
312+
if (stop != null) {
313+
request.stop(CreateChatCompletionRequestAllOfStop.createListOfStrings(this.stop));
314+
}
313315

314316
request.temperature(this.temperature);
315317
request.topP(this.topP);

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAiEmbeddingRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ EmbeddingsCreateRequest createEmbeddingsCreateRequest() {
4141
.input(EmbeddingsCreateRequestInput.create(tokens.get(0)));
4242
}
4343

44-
return new EmbeddingsCreateRequest().input(EmbeddingsCreateRequestInput.create(tokens));
44+
return new EmbeddingsCreateRequest()
45+
.input(EmbeddingsCreateRequestInput.createListOfStrings(tokens));
4546
}
4647
}

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAiSystemMessage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ ChatCompletionRequestSystemMessage createChatCompletionRequestMessage()
8383
}
8484
return new ChatCompletionRequestSystemMessage()
8585
.role(ChatCompletionRequestSystemMessage.RoleEnum.fromValue(role()))
86-
.content(ChatCompletionRequestSystemMessageContent.create(contentList));
86+
.content(
87+
ChatCompletionRequestSystemMessageContent
88+
.createListOfChatCompletionRequestMessageContentPartTexts(contentList));
8789
}
8890
}

0 commit comments

Comments
 (0)