@@ -5003,6 +5003,38 @@ class SafetySettingDict(TypedDict, total=False):
50035003SpeechConfigUnionDict = Union[str, SpeechConfig, SpeechConfigDict]
50045004
50055005
5006+ class ModelArmorConfig(_common.BaseModel):
5007+ """Configuration for Model Armor integrations of prompt and responses.
5008+
5009+ This data type is not supported in Gemini API.
5010+ """
5011+
5012+ prompt_template_name: Optional[str] = Field(
5013+ default=None,
5014+ description="""Optional. The name of the Model Armor template to use for prompt sanitization.""",
5015+ )
5016+ response_template_name: Optional[str] = Field(
5017+ default=None,
5018+ description="""Optional. The name of the Model Armor template to use for response sanitization.""",
5019+ )
5020+
5021+
5022+ class ModelArmorConfigDict(TypedDict, total=False):
5023+ """Configuration for Model Armor integrations of prompt and responses.
5024+
5025+ This data type is not supported in Gemini API.
5026+ """
5027+
5028+ prompt_template_name: Optional[str]
5029+ """Optional. The name of the Model Armor template to use for prompt sanitization."""
5030+
5031+ response_template_name: Optional[str]
5032+ """Optional. The name of the Model Armor template to use for response sanitization."""
5033+
5034+
5035+ ModelArmorConfigOrDict = Union[ModelArmorConfig, ModelArmorConfigDict]
5036+
5037+
50065038class GenerateContentConfig(_common.BaseModel):
50075039 """Optional model configuration parameters.
50085040
@@ -5219,6 +5251,12 @@ class GenerateContentConfig(_common.BaseModel):
52195251 models. This field is not supported in Vertex AI.
52205252 """,
52215253 )
5254+ model_armor_config: Optional[ModelArmorConfig] = Field(
5255+ default=None,
5256+ description="""Settings for prompt and response sanitization using the Model Armor
5257+ service. If supplied, safety_settings must not be supplied.
5258+ """,
5259+ )
52225260
52235261 @pydantic.field_validator('response_schema', mode='before')
52245262 @classmethod
@@ -5429,6 +5467,11 @@ class GenerateContentConfigDict(TypedDict, total=False):
54295467 models. This field is not supported in Vertex AI.
54305468 """
54315469
5470+ model_armor_config: Optional[ModelArmorConfigDict]
5471+ """Settings for prompt and response sanitization using the Model Armor
5472+ service. If supplied, safety_settings must not be supplied.
5473+ """
5474+
54325475
54335476GenerateContentConfigOrDict = Union[
54345477 GenerateContentConfig, GenerateContentConfigDict
0 commit comments