Skip to content

Commit 45a07cb

Browse files
committed
Update orchestration based on main
1 parent ab4c8d5 commit 45a07cb

32 files changed

+3742
-626
lines changed
Lines changed: 320 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,320 @@
1+
/*
2+
* Internal Orchestration Service API
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.
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.orchestration.model;
13+
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.LinkedHashMap;
19+
import java.util.Map;
20+
import java.util.NoSuchElementException;
21+
import java.util.Objects;
22+
import java.util.Set;
23+
import javax.annotation.Nonnull;
24+
import javax.annotation.Nullable;
25+
26+
/** Filter configuration for Azure Content Safety */
27+
// CHECKSTYLE:OFF
28+
public class AzureContentSafetyInput
29+
// CHECKSTYLE:ON
30+
{
31+
@JsonProperty("Hate")
32+
private AzureThreshold hate;
33+
34+
@JsonProperty("SelfHarm")
35+
private AzureThreshold selfHarm;
36+
37+
@JsonProperty("Sexual")
38+
private AzureThreshold sexual;
39+
40+
@JsonProperty("Violence")
41+
private AzureThreshold violence;
42+
43+
@JsonProperty("PromptShield")
44+
private Boolean promptShield = false;
45+
46+
@JsonAnySetter @JsonAnyGetter
47+
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();
48+
49+
/** Default constructor for AzureContentSafetyInput. */
50+
protected AzureContentSafetyInput() {}
51+
52+
/**
53+
* Set the hate of this {@link AzureContentSafetyInput} instance and return the same instance.
54+
*
55+
* @param hate The hate of this {@link AzureContentSafetyInput}
56+
* @return The same instance of this {@link AzureContentSafetyInput} class
57+
*/
58+
@Nonnull
59+
public AzureContentSafetyInput hate(@Nullable final AzureThreshold hate) {
60+
this.hate = hate;
61+
return this;
62+
}
63+
64+
/**
65+
* Get hate
66+
*
67+
* @return hate The hate of this {@link AzureContentSafetyInput} instance.
68+
*/
69+
@Nonnull
70+
public AzureThreshold getHate() {
71+
return hate;
72+
}
73+
74+
/**
75+
* Set the hate of this {@link AzureContentSafetyInput} instance.
76+
*
77+
* @param hate The hate of this {@link AzureContentSafetyInput}
78+
*/
79+
public void setHate(@Nullable final AzureThreshold hate) {
80+
this.hate = hate;
81+
}
82+
83+
/**
84+
* Set the selfHarm of this {@link AzureContentSafetyInput} instance and return the same instance.
85+
*
86+
* @param selfHarm The selfHarm of this {@link AzureContentSafetyInput}
87+
* @return The same instance of this {@link AzureContentSafetyInput} class
88+
*/
89+
@Nonnull
90+
public AzureContentSafetyInput selfHarm(@Nullable final AzureThreshold selfHarm) {
91+
this.selfHarm = selfHarm;
92+
return this;
93+
}
94+
95+
/**
96+
* Get selfHarm
97+
*
98+
* @return selfHarm The selfHarm of this {@link AzureContentSafetyInput} instance.
99+
*/
100+
@Nonnull
101+
public AzureThreshold getSelfHarm() {
102+
return selfHarm;
103+
}
104+
105+
/**
106+
* Set the selfHarm of this {@link AzureContentSafetyInput} instance.
107+
*
108+
* @param selfHarm The selfHarm of this {@link AzureContentSafetyInput}
109+
*/
110+
public void setSelfHarm(@Nullable final AzureThreshold selfHarm) {
111+
this.selfHarm = selfHarm;
112+
}
113+
114+
/**
115+
* Set the sexual of this {@link AzureContentSafetyInput} instance and return the same instance.
116+
*
117+
* @param sexual The sexual of this {@link AzureContentSafetyInput}
118+
* @return The same instance of this {@link AzureContentSafetyInput} class
119+
*/
120+
@Nonnull
121+
public AzureContentSafetyInput sexual(@Nullable final AzureThreshold sexual) {
122+
this.sexual = sexual;
123+
return this;
124+
}
125+
126+
/**
127+
* Get sexual
128+
*
129+
* @return sexual The sexual of this {@link AzureContentSafetyInput} instance.
130+
*/
131+
@Nonnull
132+
public AzureThreshold getSexual() {
133+
return sexual;
134+
}
135+
136+
/**
137+
* Set the sexual of this {@link AzureContentSafetyInput} instance.
138+
*
139+
* @param sexual The sexual of this {@link AzureContentSafetyInput}
140+
*/
141+
public void setSexual(@Nullable final AzureThreshold sexual) {
142+
this.sexual = sexual;
143+
}
144+
145+
/**
146+
* Set the violence of this {@link AzureContentSafetyInput} instance and return the same instance.
147+
*
148+
* @param violence The violence of this {@link AzureContentSafetyInput}
149+
* @return The same instance of this {@link AzureContentSafetyInput} class
150+
*/
151+
@Nonnull
152+
public AzureContentSafetyInput violence(@Nullable final AzureThreshold violence) {
153+
this.violence = violence;
154+
return this;
155+
}
156+
157+
/**
158+
* Get violence
159+
*
160+
* @return violence The violence of this {@link AzureContentSafetyInput} instance.
161+
*/
162+
@Nonnull
163+
public AzureThreshold getViolence() {
164+
return violence;
165+
}
166+
167+
/**
168+
* Set the violence of this {@link AzureContentSafetyInput} instance.
169+
*
170+
* @param violence The violence of this {@link AzureContentSafetyInput}
171+
*/
172+
public void setViolence(@Nullable final AzureThreshold violence) {
173+
this.violence = violence;
174+
}
175+
176+
/**
177+
* Set the promptShield of this {@link AzureContentSafetyInput} instance and return the same
178+
* instance.
179+
*
180+
* @param promptShield A flag to use prompt shield
181+
* @return The same instance of this {@link AzureContentSafetyInput} class
182+
*/
183+
@Nonnull
184+
public AzureContentSafetyInput promptShield(@Nullable final Boolean promptShield) {
185+
this.promptShield = promptShield;
186+
return this;
187+
}
188+
189+
/**
190+
* A flag to use prompt shield
191+
*
192+
* @return promptShield The promptShield of this {@link AzureContentSafetyInput} instance.
193+
*/
194+
@Nonnull
195+
public Boolean isPromptShield() {
196+
return promptShield;
197+
}
198+
199+
/**
200+
* Set the promptShield of this {@link AzureContentSafetyInput} instance.
201+
*
202+
* @param promptShield A flag to use prompt shield
203+
*/
204+
public void setPromptShield(@Nullable final Boolean promptShield) {
205+
this.promptShield = promptShield;
206+
}
207+
208+
/**
209+
* Get the names of the unrecognizable properties of the {@link AzureContentSafetyInput}.
210+
*
211+
* @return The set of properties names
212+
*/
213+
@JsonIgnore
214+
@Nonnull
215+
public Set<String> getCustomFieldNames() {
216+
return cloudSdkCustomFields.keySet();
217+
}
218+
219+
/**
220+
* Get the value of an unrecognizable property of this {@link AzureContentSafetyInput} instance.
221+
*
222+
* @deprecated Use {@link #toMap()} instead.
223+
* @param name The name of the property
224+
* @return The value of the property
225+
* @throws NoSuchElementException If no property with the given name could be found.
226+
*/
227+
@Nullable
228+
@Deprecated
229+
public Object getCustomField(@Nonnull final String name) throws NoSuchElementException {
230+
if (!cloudSdkCustomFields.containsKey(name)) {
231+
throw new NoSuchElementException(
232+
"AzureContentSafetyInput has no field with name '" + name + "'.");
233+
}
234+
return cloudSdkCustomFields.get(name);
235+
}
236+
237+
/**
238+
* Get the value of all properties of this {@link AzureContentSafetyInput} instance including
239+
* unrecognized properties.
240+
*
241+
* @return The map of all properties
242+
*/
243+
@JsonIgnore
244+
@Nonnull
245+
public Map<String, Object> toMap() {
246+
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
247+
if (hate != null) declaredFields.put("hate", hate);
248+
if (selfHarm != null) declaredFields.put("selfHarm", selfHarm);
249+
if (sexual != null) declaredFields.put("sexual", sexual);
250+
if (violence != null) declaredFields.put("violence", violence);
251+
if (promptShield != null) declaredFields.put("promptShield", promptShield);
252+
return declaredFields;
253+
}
254+
255+
/**
256+
* Set an unrecognizable property of this {@link AzureContentSafetyInput} instance. If the map
257+
* previously contained a mapping for the key, the old value is replaced by the specified value.
258+
*
259+
* @param customFieldName The name of the property
260+
* @param customFieldValue The value of the property
261+
*/
262+
@JsonIgnore
263+
public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) {
264+
cloudSdkCustomFields.put(customFieldName, customFieldValue);
265+
}
266+
267+
@Override
268+
public boolean equals(@Nullable final java.lang.Object o) {
269+
if (this == o) {
270+
return true;
271+
}
272+
if (o == null || getClass() != o.getClass()) {
273+
return false;
274+
}
275+
final AzureContentSafetyInput azureContentSafetyInput = (AzureContentSafetyInput) o;
276+
return Objects.equals(this.cloudSdkCustomFields, azureContentSafetyInput.cloudSdkCustomFields)
277+
&& Objects.equals(this.hate, azureContentSafetyInput.hate)
278+
&& Objects.equals(this.selfHarm, azureContentSafetyInput.selfHarm)
279+
&& Objects.equals(this.sexual, azureContentSafetyInput.sexual)
280+
&& Objects.equals(this.violence, azureContentSafetyInput.violence)
281+
&& Objects.equals(this.promptShield, azureContentSafetyInput.promptShield);
282+
}
283+
284+
@Override
285+
public int hashCode() {
286+
return Objects.hash(hate, selfHarm, sexual, violence, promptShield, cloudSdkCustomFields);
287+
}
288+
289+
@Override
290+
@Nonnull
291+
public String toString() {
292+
final StringBuilder sb = new StringBuilder();
293+
sb.append("class AzureContentSafetyInput {\n");
294+
sb.append(" hate: ").append(toIndentedString(hate)).append("\n");
295+
sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n");
296+
sb.append(" sexual: ").append(toIndentedString(sexual)).append("\n");
297+
sb.append(" violence: ").append(toIndentedString(violence)).append("\n");
298+
sb.append(" promptShield: ").append(toIndentedString(promptShield)).append("\n");
299+
cloudSdkCustomFields.forEach(
300+
(k, v) ->
301+
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
302+
sb.append("}");
303+
return sb.toString();
304+
}
305+
306+
/**
307+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
308+
*/
309+
private String toIndentedString(final java.lang.Object o) {
310+
if (o == null) {
311+
return "null";
312+
}
313+
return o.toString().replace("\n", "\n ");
314+
}
315+
316+
/** Create a new {@link AzureContentSafetyInput} instance. No arguments are required. */
317+
public static AzureContentSafetyInput create() {
318+
return new AzureContentSafetyInput();
319+
}
320+
}

0 commit comments

Comments
 (0)