#[non_exhaustive]pub struct TemplateMetadata {
pub ignore_partial_invocation_failures: bool,
pub custom_prompt_safety_error_code: i32,
pub custom_prompt_safety_error_message: String,
pub custom_llm_response_safety_error_code: i32,
pub custom_llm_response_safety_error_message: String,
pub log_template_operations: bool,
pub log_sanitize_operations: bool,
pub enforcement_type: EnforcementType,
pub multi_language_detection: Option<MultiLanguageDetection>,
/* private fields */
}Expand description
Message describing TemplateMetadata
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ignore_partial_invocation_failures: boolOptional. If true, partial detector failures should be ignored.
custom_prompt_safety_error_code: i32Optional. Indicates the custom error code set by the user to be returned to the end user by the service extension if the prompt trips Model Armor filters.
custom_prompt_safety_error_message: StringOptional. Indicates the custom error message set by the user to be returned to the end user if the prompt trips Model Armor filters.
custom_llm_response_safety_error_code: i32Optional. Indicates the custom error code set by the user to be returned to the end user if the LLM response trips Model Armor filters.
custom_llm_response_safety_error_message: StringOptional. Indicates the custom error message set by the user to be returned to the end user if the LLM response trips Model Armor filters.
log_template_operations: boolOptional. If true, log template crud operations.
log_sanitize_operations: boolOptional. If true, log sanitize operations.
enforcement_type: EnforcementTypeOptional. Enforcement type for Model Armor filters.
multi_language_detection: Option<MultiLanguageDetection>Optional. Metadata for multi language detection.
Implementations§
Source§impl TemplateMetadata
impl TemplateMetadata
pub fn new() -> Self
Sourcepub fn set_ignore_partial_invocation_failures<T: Into<bool>>(self, v: T) -> Self
pub fn set_ignore_partial_invocation_failures<T: Into<bool>>(self, v: T) -> Self
Sets the value of ignore_partial_invocation_failures.
§Example
let x = TemplateMetadata::new().set_ignore_partial_invocation_failures(true);Sourcepub fn set_custom_prompt_safety_error_code<T: Into<i32>>(self, v: T) -> Self
pub fn set_custom_prompt_safety_error_code<T: Into<i32>>(self, v: T) -> Self
Sets the value of custom_prompt_safety_error_code.
§Example
let x = TemplateMetadata::new().set_custom_prompt_safety_error_code(42);Sourcepub fn set_custom_prompt_safety_error_message<T: Into<String>>(
self,
v: T,
) -> Self
pub fn set_custom_prompt_safety_error_message<T: Into<String>>( self, v: T, ) -> Self
Sets the value of custom_prompt_safety_error_message.
§Example
let x = TemplateMetadata::new().set_custom_prompt_safety_error_message("example");Sourcepub fn set_custom_llm_response_safety_error_code<T: Into<i32>>(
self,
v: T,
) -> Self
pub fn set_custom_llm_response_safety_error_code<T: Into<i32>>( self, v: T, ) -> Self
Sets the value of custom_llm_response_safety_error_code.
§Example
let x = TemplateMetadata::new().set_custom_llm_response_safety_error_code(42);Sourcepub fn set_custom_llm_response_safety_error_message<T: Into<String>>(
self,
v: T,
) -> Self
pub fn set_custom_llm_response_safety_error_message<T: Into<String>>( self, v: T, ) -> Self
Sets the value of custom_llm_response_safety_error_message.
§Example
let x = TemplateMetadata::new().set_custom_llm_response_safety_error_message("example");Sourcepub fn set_log_template_operations<T: Into<bool>>(self, v: T) -> Self
pub fn set_log_template_operations<T: Into<bool>>(self, v: T) -> Self
Sets the value of log_template_operations.
§Example
let x = TemplateMetadata::new().set_log_template_operations(true);Sourcepub fn set_log_sanitize_operations<T: Into<bool>>(self, v: T) -> Self
pub fn set_log_sanitize_operations<T: Into<bool>>(self, v: T) -> Self
Sets the value of log_sanitize_operations.
§Example
let x = TemplateMetadata::new().set_log_sanitize_operations(true);Sourcepub fn set_enforcement_type<T: Into<EnforcementType>>(self, v: T) -> Self
pub fn set_enforcement_type<T: Into<EnforcementType>>(self, v: T) -> Self
Sets the value of enforcement_type.
§Example
use google_cloud_modelarmor_v1::model::template::template_metadata::EnforcementType;
let x0 = TemplateMetadata::new().set_enforcement_type(EnforcementType::InspectOnly);
let x1 = TemplateMetadata::new().set_enforcement_type(EnforcementType::InspectAndBlock);Sourcepub fn set_multi_language_detection<T>(self, v: T) -> Selfwhere
T: Into<MultiLanguageDetection>,
pub fn set_multi_language_detection<T>(self, v: T) -> Selfwhere
T: Into<MultiLanguageDetection>,
Sets the value of multi_language_detection.
§Example
use google_cloud_modelarmor_v1::model::template::template_metadata::MultiLanguageDetection;
let x = TemplateMetadata::new().set_multi_language_detection(MultiLanguageDetection::default()/* use setters */);Sourcepub fn set_or_clear_multi_language_detection<T>(self, v: Option<T>) -> Selfwhere
T: Into<MultiLanguageDetection>,
pub fn set_or_clear_multi_language_detection<T>(self, v: Option<T>) -> Selfwhere
T: Into<MultiLanguageDetection>,
Sets or clears the value of multi_language_detection.
§Example
use google_cloud_modelarmor_v1::model::template::template_metadata::MultiLanguageDetection;
let x = TemplateMetadata::new().set_or_clear_multi_language_detection(Some(MultiLanguageDetection::default()/* use setters */));
let x = TemplateMetadata::new().set_or_clear_multi_language_detection(None::<MultiLanguageDetection>);Trait Implementations§
Source§impl Clone for TemplateMetadata
impl Clone for TemplateMetadata
Source§fn clone(&self) -> TemplateMetadata
fn clone(&self) -> TemplateMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more