Skip to content

Commit acb0511

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add MultiLingual Support for Sanitize APIs
docs: Updated docs for Multi Language Detection Metadata PiperOrigin-RevId: 778377120
1 parent ed44195 commit acb0511

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

google/cloud/modelarmor/v1beta/service.proto

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,13 @@ message Template {
239239

240240
// Message describing TemplateMetadata
241241
message TemplateMetadata {
242+
// Metadata to enable multi language detection via template.
243+
message MultiLanguageDetection {
244+
// Required. If true, multi language detection will be enabled.
245+
bool enable_multi_language_detection = 1
246+
[(google.api.field_behavior) = REQUIRED];
247+
}
248+
242249
// Optional. If true, partial detector failures should be ignored.
243250
bool ignore_partial_invocation_failures = 1
244251
[(google.api.field_behavior) = OPTIONAL];
@@ -269,6 +276,10 @@ message Template {
269276

270277
// Optional. If true, log sanitize operations.
271278
bool log_sanitize_operations = 7 [(google.api.field_behavior) = OPTIONAL];
279+
280+
// Optional. Metadata for multi language detection.
281+
MultiLanguageDetection multi_language_detection = 9
282+
[(google.api.field_behavior) = OPTIONAL];
272283
}
273284

274285
// Identifier. name of resource
@@ -659,6 +670,10 @@ message SanitizeUserPromptRequest {
659670

660671
// Required. User prompt data to sanitize.
661672
DataItem user_prompt_data = 2 [(google.api.field_behavior) = REQUIRED];
673+
674+
// Optional. Metadata related to Multi Language Detection.
675+
MultiLanguageDetectionMetadata multi_language_detection_metadata = 6
676+
[(google.api.field_behavior) = OPTIONAL];
662677
}
663678

664679
// Sanitize Model Response request.
@@ -678,7 +693,7 @@ message SanitizeModelResponseRequest {
678693
// Optional. User Prompt associated with Model response.
679694
string user_prompt = 4 [(google.api.field_behavior) = OPTIONAL];
680695

681-
// Optional. Metadata related for Translations.
696+
// Optional. Metadata related for multi language detection.
682697
MultiLanguageDetectionMetadata multi_language_detection_metadata = 7
683698
[(google.api.field_behavior) = OPTIONAL];
684699
}
@@ -740,8 +755,18 @@ message SanitizationResult {
740755
[(google.api.field_behavior) = OUTPUT_ONLY];
741756
}
742757

743-
// Message for Translation Support.
744-
message MultiLanguageDetectionMetadata {}
758+
// Message for Enabling Multi Language Detection.
759+
message MultiLanguageDetectionMetadata {
760+
// Optional. Optional Source language of the user prompt.
761+
//
762+
// If multi-language detection is enabled but language is not set in that case
763+
// we would automatically detect the source language.
764+
string source_language = 1 [(google.api.field_behavior) = OPTIONAL];
765+
766+
// Optional. Enable detection of multi-language prompts and responses.
767+
bool enable_multi_language_detection = 2
768+
[(google.api.field_behavior) = OPTIONAL];
769+
}
745770

746771
// Filter Result obtained after Sanitization operations.
747772
message FilterResult {

0 commit comments

Comments
 (0)