Skip to content

Commit 1ab37f3

Browse files
authored
Merge branch 'main' into dependabot/maven/main/production-minor-patch-acf14b5b36
2 parents 19f77c6 + 44d1229 commit 1ab37f3

File tree

7 files changed

+111
-25
lines changed

7 files changed

+111
-25
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class OrchestrationConfig
2929
// CHECKSTYLE:ON
3030
{
3131
@JsonProperty("modules")
32-
private ModuleConfigs modules;
32+
private OrchestrationConfigModules modules;
3333

3434
@JsonProperty("stream")
3535
private GlobalStreamOptions stream;
@@ -47,7 +47,7 @@ protected OrchestrationConfig() {}
4747
* @return The same instance of this {@link OrchestrationConfig} class
4848
*/
4949
@Nonnull
50-
public OrchestrationConfig modules(@Nonnull final ModuleConfigs modules) {
50+
public OrchestrationConfig modules(@Nonnull final OrchestrationConfigModules modules) {
5151
this.modules = modules;
5252
return this;
5353
}
@@ -58,7 +58,7 @@ public OrchestrationConfig modules(@Nonnull final ModuleConfigs modules) {
5858
* @return modules The modules of this {@link OrchestrationConfig} instance.
5959
*/
6060
@Nonnull
61-
public ModuleConfigs getModules() {
61+
public OrchestrationConfigModules getModules() {
6262
return modules;
6363
}
6464

@@ -67,7 +67,7 @@ public ModuleConfigs getModules() {
6767
*
6868
* @param modules The modules of this {@link OrchestrationConfig}
6969
*/
70-
public void setModules(@Nonnull final ModuleConfigs modules) {
70+
public void setModules(@Nonnull final OrchestrationConfigModules modules) {
7171
this.modules = modules;
7272
}
7373

@@ -217,6 +217,6 @@ public interface Builder {
217217
* @param modules The modules of this {@link OrchestrationConfig}
218218
* @return The OrchestrationConfig instance.
219219
*/
220-
OrchestrationConfig modules(@Nonnull final ModuleConfigs modules);
220+
OrchestrationConfig modules(@Nonnull final OrchestrationConfigModules modules);
221221
}
222222
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Prompt Registry API
3+
* Prompt Storage service for Design time & Runtime prompt templates.
4+
*
5+
*
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
package com.sap.ai.sdk.prompt.registry.model;
13+
14+
import java.util.List;
15+
import javax.annotation.Nonnull;
16+
17+
/** OrchestrationConfigModules */
18+
public interface OrchestrationConfigModules {
19+
/**
20+
* Helper class to create {@code ModuleConfigs } that implements {@link
21+
* OrchestrationConfigModules}.
22+
*/
23+
record InnerModuleConfigs(
24+
@com.fasterxml.jackson.annotation.JsonValue @Nonnull ModuleConfigs value)
25+
implements OrchestrationConfigModules {}
26+
27+
/**
28+
* Creator to enable deserialization of {@code ModuleConfigs }.
29+
*
30+
* @param val the value to use
31+
* @return a new instance of {@link InnerModuleConfigs}.
32+
*/
33+
@com.fasterxml.jackson.annotation.JsonCreator
34+
@Nonnull
35+
static InnerModuleConfigs createInnerModuleConfigs(@Nonnull final ModuleConfigs val) {
36+
return new InnerModuleConfigs(val);
37+
}
38+
39+
/**
40+
* Helper class to create {@code List<ModuleConfigs> } that implements {@link
41+
* OrchestrationConfigModules}.
42+
*/
43+
record ListOfModuleConfigss(
44+
@com.fasterxml.jackson.annotation.JsonValue @Nonnull List<ModuleConfigs> values)
45+
implements OrchestrationConfigModules {}
46+
47+
/**
48+
* Creator to enable deserialization of {@code List<ModuleConfigs> }.
49+
*
50+
* @param val the value to use
51+
* @return a new instance of {@link ListOfModuleConfigss}.
52+
*/
53+
@com.fasterxml.jackson.annotation.JsonCreator
54+
@Nonnull
55+
static ListOfModuleConfigss createListOfModuleConfigss(@Nonnull final List<ModuleConfigs> val) {
56+
return new ListOfModuleConfigss(val);
57+
}
58+
}

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

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected PromptTemplateSubstitutionRequest() {}
4545
* @return The same instance of this {@link PromptTemplateSubstitutionRequest} class
4646
*/
4747
@Nonnull
48-
public PromptTemplateSubstitutionRequest inputParams(@Nullable final Object inputParams) {
48+
public PromptTemplateSubstitutionRequest inputParams(@Nonnull final Object inputParams) {
4949
this.inputParams = inputParams;
5050
return this;
5151
}
@@ -65,7 +65,7 @@ public Object getInputParams() {
6565
*
6666
* @param inputParams The inputParams of this {@link PromptTemplateSubstitutionRequest}
6767
*/
68-
public void setInputParams(@Nullable final Object inputParams) {
68+
public void setInputParams(@Nonnull final Object inputParams) {
6969
this.inputParams = inputParams;
7070
}
7171

@@ -170,8 +170,22 @@ private String toIndentedString(final java.lang.Object o) {
170170
return o.toString().replace("\n", "\n ");
171171
}
172172

173-
/** Create a new {@link PromptTemplateSubstitutionRequest} instance. No arguments are required. */
174-
public static PromptTemplateSubstitutionRequest create() {
175-
return new PromptTemplateSubstitutionRequest();
173+
/**
174+
* Create a type-safe, fluent-api builder object to construct a new {@link
175+
* PromptTemplateSubstitutionRequest} instance with all required arguments.
176+
*/
177+
public static Builder create() {
178+
return (inputParams) -> new PromptTemplateSubstitutionRequest().inputParams(inputParams);
179+
}
180+
181+
/** Builder helper class. */
182+
public interface Builder {
183+
/**
184+
* Set the inputParams of this {@link PromptTemplateSubstitutionRequest} instance.
185+
*
186+
* @param inputParams The inputParams of this {@link PromptTemplateSubstitutionRequest}
187+
* @return The PromptTemplateSubstitutionRequest instance.
188+
*/
189+
PromptTemplateSubstitutionRequest inputParams(@Nonnull final Object inputParams);
176190
}
177191
}

core-services/prompt-registry/src/main/resources/spec/prompt-registry.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,8 @@ components:
867867
$ref: '#/components/schemas/PromptTemplateSpec'
868868
PromptTemplateSubstitutionRequest:
869869
type: object
870+
required:
871+
- inputParams
870872
properties:
871873
inputParams:
872874
type: object
@@ -1283,7 +1285,7 @@ components:
12831285
description: Additional parameters for the model. Default values are used for mandatory parameters.
12841286
additionalProperties: true
12851287
example:
1286-
max_tokens: 300
1288+
max_completion_tokens: 300
12871289
temperature: 0.1
12881290
frequency_penalty: 0
12891291
presence_penalty: 0
@@ -1942,6 +1944,13 @@ components:
19421944
$ref: '#/components/schemas/GroundingModuleConfig'
19431945
translation:
19441946
$ref: '#/components/schemas/TranslationModuleConfig'
1947+
ModuleConfigsList:
1948+
type: array
1949+
items:
1950+
$ref: '#/components/schemas/ModuleConfigs'
1951+
minItems: 1
1952+
description: |
1953+
A list of module configurations. The first configuration in the list that succeeds will be used.
19451954
GlobalStreamOptions:
19461955
description: Options for streaming. Will be ignored if enabled is false.
19471956
type: object
@@ -1976,7 +1985,9 @@ components:
19761985
additionalProperties: false
19771986
properties:
19781987
modules:
1979-
$ref: '#/components/schemas/ModuleConfigs'
1988+
oneOf:
1989+
- $ref: '#/components/schemas/ModuleConfigs'
1990+
- $ref: '#/components/schemas/ModuleConfigsList'
19801991
stream:
19811992
$ref: '#/components/schemas/GlobalStreamOptions'
19821993
responses:

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ private static Generation toGeneration(
196196
@Nonnull
197197
protected static OpenAiChatCompletionRequest extractOptions(
198198
@Nonnull OpenAiChatCompletionRequest request, @Nonnull final ChatOptions options) {
199-
request = request.withStop(options.getStopSequences()).withMaxTokens(options.getMaxTokens());
199+
request =
200+
request
201+
.withStop(options.getStopSequences())
202+
.withMaxCompletionTokens(options.getMaxTokens());
200203
if (options.getTemperature() != null) {
201204
request = request.withTemperature(BigDecimal.valueOf(options.getTemperature()));
202205
}

orchestration/src/main/resources/spec/orchestration.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ components:
112112
$ref: "#/components/schemas/EmbeddingsInputText"
113113
type:
114114
type: string
115-
enum: [ "text", "document", "query" ]
115+
enum: ["text", "document", "query"]
116116
EmbeddingsInputText:
117117
oneOf:
118118
- type: string
@@ -124,9 +124,9 @@ components:
124124
items:
125125
type: string
126126
minLength: 1
127-
example: [ "Hello", "World", "!" ]
127+
example: ["Hello", "World", "!"]
128128
description: Text input for which embeddings need to be generated
129-
example: [ "This is an input string.", "This is another input string." ]
129+
example: ["This is an input string.", "This is another input string."]
130130
EmbeddingsModuleConfigs:
131131
type: object
132132
required:
@@ -181,7 +181,7 @@ components:
181181
The number of dimensions the resulting output embeddings should have.
182182
encoding_format:
183183
type: string
184-
enum: [ float, base64, binary ]
184+
enum: [float, base64, binary]
185185
description: >
186186
OpenAI's spec allows for 'float' and 'base64' encoding formats.
187187
normalize:
@@ -466,7 +466,7 @@ components:
466466
properties:
467467
type:
468468
type: string
469-
enum: [ "text" ]
469+
enum: ["text"]
470470
text:
471471
type: string
472472
ChatDelta:
@@ -659,7 +659,7 @@ components:
659659
description: List of delimiters to split the input text into chunks.Please note, this is a required parameter when `input_translation_module_config` or `output_translation_module_config` are configured.
660660
items:
661661
type: string
662-
example: [ "\n", ".", "?", "!" ]
662+
example: ["\n", ".", "?", "!"]
663663

664664
GenericModuleResult:
665665
type: object
@@ -702,8 +702,8 @@ components:
702702
type: string
703703
example:
704704
user:
705-
[ "translated user content", "another translated user content" ]
706-
system: [ "translated system message" ]
705+
["translated user content", "another translated user content"]
706+
system: ["translated system message"]
707707
translated_placeholders:
708708
type: object
709709
additionalProperties:
@@ -1380,7 +1380,7 @@ components:
13801380
allowlist:
13811381
description: List of strings that should not be masked
13821382
type: array
1383-
example: [ "SAP", "Joule" ]
1383+
example: ["SAP", "Joule"]
13841384
items:
13851385
type: string
13861386
mask_grounding_input:
@@ -1499,7 +1499,7 @@ components:
14991499
anyOf:
15001500
- enum:
15011501
- document_grounding_service
1502-
- { }
1502+
- {}
15031503
example: document_grounding_service
15041504
config:
15051505
type: object

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@
539539
<plugin>
540540
<groupId>org.apache.maven.plugins</groupId>
541541
<artifactId>maven-resources-plugin</artifactId>
542-
<version>3.3.1</version>
542+
<version>3.4.0</version>
543543
</plugin>
544544
<!-- phase: test-compile -->
545545
<plugin>
@@ -815,7 +815,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma
815815
<plugin>
816816
<groupId>org.apache.maven.plugins</groupId>
817817
<artifactId>maven-source-plugin</artifactId>
818-
<version>3.3.1</version>
818+
<version>3.4.0</version>
819819
<executions>
820820
<execution>
821821
<id>attach-sources</id>

0 commit comments

Comments
 (0)