Skip to content

Commit 8de3c59

Browse files
committed
Update orchestration based on main
1 parent 3954c4c commit 8de3c59

File tree

5 files changed

+497
-221
lines changed

5 files changed

+497
-221
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
import javax.annotation.Nonnull;
2525
import javax.annotation.Nullable;
2626

27-
/** LLMModelDetails */
27+
/**
28+
* The model and parameters to be used for the prompt templating. This is the model that will be
29+
* used to generate the response.
30+
*/
2831
// CHECKSTYLE:OFF
2932
public class LLMModelDetails
3033
// CHECKSTYLE:ON

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

Lines changed: 8 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -11,205 +11,13 @@
1111

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

14-
import com.fasterxml.jackson.annotation.JsonAnyGetter;
15-
import com.fasterxml.jackson.annotation.JsonAnySetter;
16-
import com.fasterxml.jackson.annotation.JsonIgnore;
17-
import com.fasterxml.jackson.annotation.JsonProperty;
18-
import java.util.ArrayList;
19-
import java.util.Arrays;
20-
import java.util.LinkedHashMap;
21-
import java.util.List;
22-
import java.util.Map;
23-
import java.util.NoSuchElementException;
24-
import java.util.Objects;
25-
import java.util.Set;
26-
import javax.annotation.Nonnull;
27-
import javax.annotation.Nullable;
14+
import com.fasterxml.jackson.annotation.JsonSubTypes;
15+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
2816

2917
/** MaskingModuleConfig */
30-
// CHECKSTYLE:OFF
31-
public class MaskingModuleConfig
32-
// CHECKSTYLE:ON
33-
{
34-
@JsonProperty("masking_providers")
35-
private List<DPIConfig> maskingProviders = new ArrayList<>();
36-
37-
@JsonAnySetter @JsonAnyGetter
38-
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();
39-
40-
/** Default constructor for MaskingModuleConfig. */
41-
protected MaskingModuleConfig() {}
42-
43-
/**
44-
* Set the maskingProviders of this {@link MaskingModuleConfig} instance and return the same
45-
* instance.
46-
*
47-
* @param maskingProviders List of masking service providers
48-
* @return The same instance of this {@link MaskingModuleConfig} class
49-
*/
50-
@Nonnull
51-
public MaskingModuleConfig maskingProviders(@Nonnull final List<DPIConfig> maskingProviders) {
52-
this.maskingProviders = maskingProviders;
53-
return this;
54-
}
55-
56-
/**
57-
* Add one maskingProviders instance to this {@link MaskingModuleConfig}.
58-
*
59-
* @param maskingProvidersItem The maskingProviders that should be added
60-
* @return The same instance of type {@link MaskingModuleConfig}
61-
*/
62-
@Nonnull
63-
public MaskingModuleConfig addMaskingProvidersItem(
64-
@Nonnull final DPIConfig maskingProvidersItem) {
65-
if (this.maskingProviders == null) {
66-
this.maskingProviders = new ArrayList<>();
67-
}
68-
this.maskingProviders.add(maskingProvidersItem);
69-
return this;
70-
}
71-
72-
/**
73-
* List of masking service providers
74-
*
75-
* @return maskingProviders The maskingProviders of this {@link MaskingModuleConfig} instance.
76-
*/
77-
@Nonnull
78-
public List<DPIConfig> getMaskingProviders() {
79-
return maskingProviders;
80-
}
81-
82-
/**
83-
* Set the maskingProviders of this {@link MaskingModuleConfig} instance.
84-
*
85-
* @param maskingProviders List of masking service providers
86-
*/
87-
public void setMaskingProviders(@Nonnull final List<DPIConfig> maskingProviders) {
88-
this.maskingProviders = maskingProviders;
89-
}
90-
91-
/**
92-
* Get the names of the unrecognizable properties of the {@link MaskingModuleConfig}.
93-
*
94-
* @return The set of properties names
95-
*/
96-
@JsonIgnore
97-
@Nonnull
98-
public Set<String> getCustomFieldNames() {
99-
return cloudSdkCustomFields.keySet();
100-
}
101-
102-
/**
103-
* Get the value of an unrecognizable property of this {@link MaskingModuleConfig} instance.
104-
*
105-
* @deprecated Use {@link #toMap()} instead.
106-
* @param name The name of the property
107-
* @return The value of the property
108-
* @throws NoSuchElementException If no property with the given name could be found.
109-
*/
110-
@Nullable
111-
@Deprecated
112-
public Object getCustomField(@Nonnull final String name) throws NoSuchElementException {
113-
if (!cloudSdkCustomFields.containsKey(name)) {
114-
throw new NoSuchElementException(
115-
"MaskingModuleConfig has no field with name '" + name + "'.");
116-
}
117-
return cloudSdkCustomFields.get(name);
118-
}
119-
120-
/**
121-
* Get the value of all properties of this {@link MaskingModuleConfig} instance including
122-
* unrecognized properties.
123-
*
124-
* @return The map of all properties
125-
*/
126-
@JsonIgnore
127-
@Nonnull
128-
public Map<String, Object> toMap() {
129-
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
130-
if (maskingProviders != null) declaredFields.put("maskingProviders", maskingProviders);
131-
return declaredFields;
132-
}
133-
134-
/**
135-
* Set an unrecognizable property of this {@link MaskingModuleConfig} instance. If the map
136-
* previously contained a mapping for the key, the old value is replaced by the specified value.
137-
*
138-
* @param customFieldName The name of the property
139-
* @param customFieldValue The value of the property
140-
*/
141-
@JsonIgnore
142-
public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) {
143-
cloudSdkCustomFields.put(customFieldName, customFieldValue);
144-
}
145-
146-
@Override
147-
public boolean equals(@Nullable final java.lang.Object o) {
148-
if (this == o) {
149-
return true;
150-
}
151-
if (o == null || getClass() != o.getClass()) {
152-
return false;
153-
}
154-
final MaskingModuleConfig maskingModuleConfig = (MaskingModuleConfig) o;
155-
return Objects.equals(this.cloudSdkCustomFields, maskingModuleConfig.cloudSdkCustomFields)
156-
&& Objects.equals(this.maskingProviders, maskingModuleConfig.maskingProviders);
157-
}
158-
159-
@Override
160-
public int hashCode() {
161-
return Objects.hash(maskingProviders, cloudSdkCustomFields);
162-
}
163-
164-
@Override
165-
@Nonnull
166-
public String toString() {
167-
final StringBuilder sb = new StringBuilder();
168-
sb.append("class MaskingModuleConfig {\n");
169-
sb.append(" maskingProviders: ").append(toIndentedString(maskingProviders)).append("\n");
170-
cloudSdkCustomFields.forEach(
171-
(k, v) ->
172-
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
173-
sb.append("}");
174-
return sb.toString();
175-
}
176-
177-
/**
178-
* Convert the given object to string with each line indented by 4 spaces (except the first line).
179-
*/
180-
private String toIndentedString(final java.lang.Object o) {
181-
if (o == null) {
182-
return "null";
183-
}
184-
return o.toString().replace("\n", "\n ");
185-
}
186-
187-
/**
188-
* Create a type-safe, fluent-api builder object to construct a new {@link MaskingModuleConfig}
189-
* instance with all required arguments.
190-
*/
191-
public static Builder create() {
192-
return (maskingProviders) -> new MaskingModuleConfig().maskingProviders(maskingProviders);
193-
}
194-
195-
/** Builder helper class. */
196-
public interface Builder {
197-
/**
198-
* Set the maskingProviders of this {@link MaskingModuleConfig} instance.
199-
*
200-
* @param maskingProviders List of masking service providers
201-
* @return The MaskingModuleConfig instance.
202-
*/
203-
MaskingModuleConfig maskingProviders(@Nonnull final List<DPIConfig> maskingProviders);
204-
205-
/**
206-
* Set the maskingProviders of this {@link MaskingModuleConfig} instance.
207-
*
208-
* @param maskingProviders List of masking service providers
209-
* @return The MaskingModuleConfig instance.
210-
*/
211-
default MaskingModuleConfig maskingProviders(@Nonnull final DPIConfig... maskingProviders) {
212-
return maskingProviders(Arrays.asList(maskingProviders));
213-
}
214-
}
215-
}
18+
@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)
19+
@JsonSubTypes({
20+
@JsonSubTypes.Type(value = MaskingModuleConfigMaskingProviders.class),
21+
@JsonSubTypes.Type(value = MaskingModuleConfigProviders.class),
22+
})
23+
public interface MaskingModuleConfig {}

0 commit comments

Comments
 (0)