Skip to content

Commit 8e1a629

Browse files
authored
Merge branch 'main' into dependabot/maven/main/plugins-0d17c4d850
2 parents 4fc779b + 44d1229 commit 8e1a629

File tree

12 files changed

+122
-33
lines changed

12 files changed

+122
-33
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:

docs/release_notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
### ✨ New Functionality
1414

15-
- [Orchestration] Added new models for `OrchestrationAiModel`: `SONAR`,`SONAR_PRO`, `GEMINI_2_5_FLASH_LITE`, `CLAUDE_4_5_HAIKU`.
15+
- [Orchestration] Added new models for `OrchestrationAiModel`: `SONAR`,`SONAR_PRO`, `GEMINI_2_5_FLASH_LITE`, `CLAUDE_4_5_HAIKU`, `GPT_REALTIME`.
1616
- [Orchestration] Convenience for adding the `metadata_params` option to grounding calls.
1717
- [Orchestration] Added new models for `OrchestrationAiModel`: `COHERE_COMMAND_A_REASONING`, `NOVA_PREMIER`, `COHERE_RERANKER`.
1818
- [Orchestration] Deprecated `DEEPSEEK_R1` model from `OrchestrationAiModel` with no replacement.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ public record OpenAiModel(@Nonnull String name, @Nullable String version) implem
104104
/** Azure OpenAI GPT-5-nano model */
105105
public static final OpenAiModel GPT_5_NANO = new OpenAiModel("gpt-5-nano", null);
106106

107+
/** Azure OpenAI GPT-5-nano model */
108+
public static final OpenAiModel GPT_REALTIME = new OpenAiModel("gpt-realtime", null);
109+
107110
/**
108111
* Azure OpenAI Text Embedding ADA 002 model
109112
*

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
@@ -187,7 +187,10 @@ private static Generation toGeneration(
187187
@Nonnull
188188
protected static OpenAiChatCompletionRequest extractOptions(
189189
@Nonnull OpenAiChatCompletionRequest request, @Nonnull final ChatOptions options) {
190-
request = request.withStop(options.getStopSequences()).withMaxTokens(options.getMaxTokens());
190+
request =
191+
request
192+
.withStop(options.getStopSequences())
193+
.withMaxCompletionTokens(options.getMaxTokens());
191194
if (options.getTemperature() != null) {
192195
request = request.withTemperature(BigDecimal.valueOf(options.getTemperature()));
193196
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static Map<String, Object> extractInputFilterDetails(@Nullable final Orchestrati
4343
.flatMap(OrchestrationClientException::lastError)
4444
.map(Error::getIntermediateResults)
4545
.map(ModuleResults::getInputFiltering)
46-
.filter(filter -> !filter.getMessage().equals("Input Filter passed successfully."))
46+
.filter(filter -> !filter.getMessage().equals("Filtering passed successfully. "))
4747
.map(GenericModuleResult::getData)
4848
.map(map -> (Map<String, Object>) map)
4949
.orElseGet(Collections::emptyMap);
@@ -53,7 +53,7 @@ static Map<String, Object> extractInputFilterDetails(@Nullable final Orchestrati
5353
.flatMap(OrchestrationClientException::lastErrorStreaming)
5454
.map(ErrorStreaming::getIntermediateResults)
5555
.map(ModuleResultsStreaming::getInputFiltering)
56-
.filter(filter -> !filter.getMessage().equals("Input Filter passed successfully."))
56+
.filter(filter -> !filter.getMessage().equals("Filtering passed successfully. "))
5757
.map(GenericModuleResult::getData)
5858
.filter(Map.class::isInstance)
5959
.map(map -> (Map<String, Object>) map)

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

orchestration/src/test/resources/__files/errorResponse.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"location": "request body",
77
"intermediate_results": {
88
"input_filtering": {
9-
"message": "Input Filter passed successfully.",
9+
"message": "Filtering passed successfully. ",
1010
"data": {
1111
"azure_content_safety": {
1212
"userPromptAnalysis": {

0 commit comments

Comments
 (0)