Skip to content

Commit bc2022d

Browse files
Google APIscopybara-github
authored andcommitted
feat: add a FooBar API
PiperOrigin-RevId: 788269006
1 parent 11ee637 commit bc2022d

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

google/cloud/aiplatform/v1beta1/content.proto

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ option java_outer_classname = "ContentProto";
3232
option java_package = "com.google.cloud.aiplatform.v1beta1";
3333
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
3434
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
35+
option (google.api.resource_definition) = {
36+
type: "modelarmor.googleapis.com/Template"
37+
pattern: "projects/{project}/locations/{location}/templates/{template}"
38+
};
3539

3640
// Harm categories that will block the content.
3741
enum HarmCategory {
@@ -596,6 +600,9 @@ message Candidate {
596600

597601
// The function call generated by the model is invalid.
598602
MALFORMED_FUNCTION_CALL = 9;
603+
604+
// The model response was blocked by Model Armor.
605+
MODEL_ARMOR = 10;
599606
}
600607

601608
// Output only. Index of the candidate.
@@ -819,6 +826,27 @@ message RetrievalMetadata {
819826
[(google.api.field_behavior) = OPTIONAL];
820827
}
821828

829+
// Configuration for Model Armor integrations of prompt and responses.
830+
message ModelArmorConfig {
831+
// Optional. The name of the Model Armor template to use for prompt
832+
// sanitization.
833+
string prompt_template_name = 1 [
834+
(google.api.field_behavior) = OPTIONAL,
835+
(google.api.resource_reference) = {
836+
type: "modelarmor.googleapis.com/Template"
837+
}
838+
];
839+
840+
// Optional. The name of the Model Armor template to use for response
841+
// sanitization.
842+
string response_template_name = 2 [
843+
(google.api.field_behavior) = OPTIONAL,
844+
(google.api.resource_reference) = {
845+
type: "modelarmor.googleapis.com/Template"
846+
}
847+
];
848+
}
849+
822850
// Represents token counting info for a single modality.
823851
message ModalityTokenCount {
824852
// The modality associated with this token count.

google/cloud/aiplatform/v1beta1/prediction_service.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,11 @@ message GenerateContentRequest {
800800
repeated SafetySetting safety_settings = 3
801801
[(google.api.field_behavior) = OPTIONAL];
802802

803+
// Optional. Settings for prompt and response sanitization using the Model
804+
// Armor service. If supplied, safety_settings must not be supplied.
805+
ModelArmorConfig model_armor_config = 11
806+
[(google.api.field_behavior) = OPTIONAL];
807+
803808
// Optional. Generation config.
804809
GenerationConfig generation_config = 4
805810
[(google.api.field_behavior) = OPTIONAL];
@@ -826,6 +831,9 @@ message GenerateContentResponse {
826831

827832
// Candidates blocked due to prohibited content.
828833
PROHIBITED_CONTENT = 4;
834+
835+
// The user prompt was blocked by Model Armor.
836+
MODEL_ARMOR = 5;
829837
}
830838

831839
// Output only. Blocked reason.

0 commit comments

Comments
 (0)