Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,66 @@ public static MethodEnum fromValue(@Nonnull final String value) {
@JsonProperty("mask_grounding_input")
private DPIConfigMaskGroundingInput maskGroundingInput;

/** Type of masking method to be used for file inputs. Required if file inputs are provided. */
public enum MaskFileInputMethodEnum {
/** The ANONYMIZATION option of this DPIConfig */
ANONYMIZATION("anonymization"),

/** The SKIP option of this DPIConfig */
SKIP("skip"),

/** The UNKNOWN_DEFAULT_OPEN_API option of this DPIConfig */
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

private String value;

MaskFileInputMethodEnum(String value) {
this.value = value;
}

/**
* Get the value of the enum
*
* @return The enum value
*/
@JsonValue
@Nonnull
public String getValue() {
return value;
}

/**
* Get the String value of the enum value.
*
* @return The enum value as String
*/
@Override
@Nonnull
public String toString() {
return String.valueOf(value);
}

/**
* Get the enum value from a String value
*
* @param value The String value
* @return The enum value of type DPIConfig
*/
@JsonCreator
@Nonnull
public static MaskFileInputMethodEnum fromValue(@Nonnull final String value) {
for (MaskFileInputMethodEnum b : MaskFileInputMethodEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return UNKNOWN_DEFAULT_OPEN_API;
}
}

@JsonProperty("mask_file_input_method")
private MaskFileInputMethodEnum maskFileInputMethod;

@JsonAnySetter @JsonAnyGetter
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();

Expand Down Expand Up @@ -352,6 +412,40 @@ public void setMaskGroundingInput(
this.maskGroundingInput = maskGroundingInput;
}

/**
* Set the maskFileInputMethod of this {@link DPIConfig} instance and return the same instance.
*
* @param maskFileInputMethod Type of masking method to be used for file inputs. Required if file
* inputs are provided.
* @return The same instance of this {@link DPIConfig} class
*/
@Nonnull
public DPIConfig maskFileInputMethod(
@Nullable final MaskFileInputMethodEnum maskFileInputMethod) {
this.maskFileInputMethod = maskFileInputMethod;
return this;
}

/**
* Type of masking method to be used for file inputs. Required if file inputs are provided.
*
* @return maskFileInputMethod The maskFileInputMethod of this {@link DPIConfig} instance.
*/
@Nonnull
public MaskFileInputMethodEnum getMaskFileInputMethod() {
return maskFileInputMethod;
}

/**
* Set the maskFileInputMethod of this {@link DPIConfig} instance.
*
* @param maskFileInputMethod Type of masking method to be used for file inputs. Required if file
* inputs are provided.
*/
public void setMaskFileInputMethod(@Nullable final MaskFileInputMethodEnum maskFileInputMethod) {
this.maskFileInputMethod = maskFileInputMethod;
}

/**
* Get the names of the unrecognizable properties of the {@link DPIConfig}.
*
Expand Down Expand Up @@ -395,6 +489,7 @@ public Map<String, Object> toMap() {
if (entities != null) declaredFields.put("entities", entities);
if (allowlist != null) declaredFields.put("allowlist", allowlist);
if (maskGroundingInput != null) declaredFields.put("maskGroundingInput", maskGroundingInput);
if (maskFileInputMethod != null) declaredFields.put("maskFileInputMethod", maskFileInputMethod);
return declaredFields;
}

Expand Down Expand Up @@ -424,13 +519,20 @@ public boolean equals(@Nullable final java.lang.Object o) {
&& Objects.equals(this.method, dpIConfig.method)
&& Objects.equals(this.entities, dpIConfig.entities)
&& Objects.equals(this.allowlist, dpIConfig.allowlist)
&& Objects.equals(this.maskGroundingInput, dpIConfig.maskGroundingInput);
&& Objects.equals(this.maskGroundingInput, dpIConfig.maskGroundingInput)
&& Objects.equals(this.maskFileInputMethod, dpIConfig.maskFileInputMethod);
}

@Override
public int hashCode() {
return Objects.hash(
type, method, entities, allowlist, maskGroundingInput, cloudSdkCustomFields);
type,
method,
entities,
allowlist,
maskGroundingInput,
maskFileInputMethod,
cloudSdkCustomFields);
}

@Override
Expand All @@ -443,6 +545,9 @@ public String toString() {
sb.append(" entities: ").append(toIndentedString(entities)).append("\n");
sb.append(" allowlist: ").append(toIndentedString(allowlist)).append("\n");
sb.append(" maskGroundingInput: ").append(toIndentedString(maskGroundingInput)).append("\n");
sb.append(" maskFileInputMethod: ")
.append(toIndentedString(maskFileInputMethod))
.append("\n");
cloudSdkCustomFields.forEach(
(k, v) ->
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
Expand Down
30 changes: 30 additions & 0 deletions orchestration/src/main/resources/spec/orchestration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ paths:
summary: orchestrated completion inference
description: Run an orchestrated completion inference request
operationId: orchestration.v2.endpoints.create
parameters:
- $ref: "#/components/parameters/AIResourceGroup"
- $ref: "#/components/parameters/AIObjectStoreSecretName"
requestBody:
required: true
content:
Expand Down Expand Up @@ -89,6 +92,27 @@ paths:


components:
parameters:
AIResourceGroup:
in: header
name: AI-Resource-Group
description: "Feedback specific - resource group of the feedback service object store secret."
required: false
schema:
maxLength: 253
minLength: 3
pattern: ^[a-zA-Z0-9][a-zA-Z0-9.-]{1,251}[a-zA-Z0-9]$
type: string
AIObjectStoreSecretName:
in: header
name: AI-Object-Store-Secret-Name
description: "Feedback specific - name of the feedback service object store secret."
required: false
schema:
maxLength: 233
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
securitySchemes:
Oauth2:
type: oauth2
Expand Down Expand Up @@ -1492,6 +1516,12 @@ components:
type: boolean
default: false
description: controls whether the input to the grounding module will be masked with the configuration supplied in the masking module
mask_file_input_method:
description: Type of masking method to be used for file inputs. Required if file inputs are provided.
type: string
enum:
- anonymization
- skip

DPIEntityConfig:
oneOf:
Expand Down