google-genai 1.59.0__py3-none-any.whl → 1.60.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,7 +96,7 @@ class InteractionsResource(SyncAPIResource):
96
96
 
97
97
  model: The name of the `Model` used for generating the interaction.
98
98
 
99
- background: Whether to run the model interaction in the background.
99
+ background: Input only. Whether to run the model interaction in the background.
100
100
 
101
101
  generation_config: Input only. Configuration parameters for the model interaction.
102
102
 
@@ -161,7 +161,7 @@ class InteractionsResource(SyncAPIResource):
161
161
 
162
162
  stream: Input only. Whether the interaction will be streamed.
163
163
 
164
- background: Whether to run the model interaction in the background.
164
+ background: Input only. Whether to run the model interaction in the background.
165
165
 
166
166
  generation_config: Input only. Configuration parameters for the model interaction.
167
167
 
@@ -224,7 +224,7 @@ class InteractionsResource(SyncAPIResource):
224
224
 
225
225
  agent_config: Configuration for the agent.
226
226
 
227
- background: Whether to run the model interaction in the background.
227
+ background: Input only. Whether to run the model interaction in the background.
228
228
 
229
229
  previous_interaction_id: The ID of the previous interaction, if any.
230
230
 
@@ -289,7 +289,7 @@ class InteractionsResource(SyncAPIResource):
289
289
 
290
290
  agent_config: Configuration for the agent.
291
291
 
292
- background: Whether to run the model interaction in the background.
292
+ background: Input only. Whether to run the model interaction in the background.
293
293
 
294
294
  previous_interaction_id: The ID of the previous interaction, if any.
295
295
 
@@ -350,7 +350,7 @@ class InteractionsResource(SyncAPIResource):
350
350
 
351
351
  stream: Input only. Whether the interaction will be streamed.
352
352
 
353
- background: Whether to run the model interaction in the background.
353
+ background: Input only. Whether to run the model interaction in the background.
354
354
 
355
355
  generation_config: Input only. Configuration parameters for the model interaction.
356
356
 
@@ -713,7 +713,7 @@ class AsyncInteractionsResource(AsyncAPIResource):
713
713
 
714
714
  model: The name of the `Model` used for generating the interaction.
715
715
 
716
- background: Whether to run the model interaction in the background.
716
+ background: Input only. Whether to run the model interaction in the background.
717
717
 
718
718
  generation_config: Input only. Configuration parameters for the model interaction.
719
719
 
@@ -778,7 +778,7 @@ class AsyncInteractionsResource(AsyncAPIResource):
778
778
 
779
779
  stream: Input only. Whether the interaction will be streamed.
780
780
 
781
- background: Whether to run the model interaction in the background.
781
+ background: Input only. Whether to run the model interaction in the background.
782
782
 
783
783
  generation_config: Input only. Configuration parameters for the model interaction.
784
784
 
@@ -841,7 +841,7 @@ class AsyncInteractionsResource(AsyncAPIResource):
841
841
 
842
842
  agent_config: Configuration for the agent.
843
843
 
844
- background: Whether to run the model interaction in the background.
844
+ background: Input only. Whether to run the model interaction in the background.
845
845
 
846
846
  previous_interaction_id: The ID of the previous interaction, if any.
847
847
 
@@ -906,7 +906,7 @@ class AsyncInteractionsResource(AsyncAPIResource):
906
906
 
907
907
  agent_config: Configuration for the agent.
908
908
 
909
- background: Whether to run the model interaction in the background.
909
+ background: Input only. Whether to run the model interaction in the background.
910
910
 
911
911
  previous_interaction_id: The ID of the previous interaction, if any.
912
912
 
@@ -967,7 +967,7 @@ class AsyncInteractionsResource(AsyncAPIResource):
967
967
 
968
968
  stream: Input only. Whether the interaction will be streamed.
969
969
 
970
- background: Whether to run the model interaction in the background.
970
+ background: Input only. Whether to run the model interaction in the background.
971
971
 
972
972
  generation_config: Input only. Configuration parameters for the model interaction.
973
973
 
@@ -68,7 +68,7 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):
68
68
  api_version: str
69
69
 
70
70
  background: bool
71
- """Whether to run the model interaction in the background."""
71
+ """Input only. Whether to run the model interaction in the background."""
72
72
 
73
73
  generation_config: GenerationConfigParam
74
74
  """Input only. Configuration parameters for the model interaction."""
@@ -136,7 +136,7 @@ class BaseCreateAgentInteractionParams(TypedDict, total=False):
136
136
  """Configuration for the agent."""
137
137
 
138
138
  background: bool
139
- """Whether to run the model interaction in the background."""
139
+ """Input only. Whether to run the model interaction in the background."""
140
140
 
141
141
  previous_interaction_id: str
142
142
  """The ID of the previous interaction, if any."""
google/genai/batches.py CHANGED
@@ -1013,6 +1013,11 @@ def _GenerateContentConfig_to_mldev(
1013
1013
  getv(from_object, ['enable_enhanced_civic_answers']),
1014
1014
  )
1015
1015
 
1016
+ if getv(from_object, ['model_armor_config']) is not None:
1017
+ raise ValueError(
1018
+ 'model_armor_config parameter is not supported in Gemini API.'
1019
+ )
1020
+
1016
1021
  return to_object
1017
1022
 
1018
1023
 
google/genai/models.py CHANGED
@@ -1117,6 +1117,11 @@ def _GenerateContentConfig_to_mldev(
1117
1117
  getv(from_object, ['enable_enhanced_civic_answers']),
1118
1118
  )
1119
1119
 
1120
+ if getv(from_object, ['model_armor_config']) is not None:
1121
+ raise ValueError(
1122
+ 'model_armor_config parameter is not supported in Gemini API.'
1123
+ )
1124
+
1120
1125
  return to_object
1121
1126
 
1122
1127
 
@@ -1279,6 +1284,13 @@ def _GenerateContentConfig_to_vertex(
1279
1284
  'enable_enhanced_civic_answers parameter is not supported in Vertex AI.'
1280
1285
  )
1281
1286
 
1287
+ if getv(from_object, ['model_armor_config']) is not None:
1288
+ setv(
1289
+ parent_object,
1290
+ ['modelArmorConfig'],
1291
+ getv(from_object, ['model_armor_config']),
1292
+ )
1293
+
1282
1294
  return to_object
1283
1295
 
1284
1296
 
@@ -546,6 +546,22 @@ test_table: list[pytest_helper.TestTableItem] = [
546
546
  ),
547
547
  exception_if_vertex='not supported',
548
548
  ),
549
+ pytest_helper.TestTableItem(
550
+ name='test_model_armor_config',
551
+ parameters=types._GenerateContentParameters(
552
+ model=GEMINI_FLASH_LATEST,
553
+ contents=t.t_contents('What is your name?'),
554
+ config={
555
+ 'model_armor_config': {
556
+ 'prompt_template_name': '',
557
+ 'response_template_name': '',
558
+ # Intentionally left blank just to test that the SDK doesn't
559
+ # throw an exception.
560
+ },
561
+ },
562
+ ),
563
+ exception_if_mldev='not supported',
564
+ ),
549
565
  ]
550
566
 
551
567
  pytestmark = pytest_helper.setup(
google/genai/types.py CHANGED
@@ -5003,6 +5003,38 @@ SpeechConfigUnion = Union[str, SpeechConfig]
5003
5003
  SpeechConfigUnionDict = Union[str, SpeechConfig, SpeechConfigDict]
5004
5004
 
5005
5005
 
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
+
5006
5038
  class GenerateContentConfig(_common.BaseModel):
5007
5039
  """Optional model configuration parameters.
5008
5040
 
@@ -5219,6 +5251,12 @@ class GenerateContentConfig(_common.BaseModel):
5219
5251
  models. This field is not supported in Vertex AI.
5220
5252
  """,
5221
5253
  )
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
+ )
5222
5260
 
5223
5261
  @pydantic.field_validator('response_schema', mode='before')
5224
5262
  @classmethod
@@ -5429,6 +5467,11 @@ class GenerateContentConfigDict(TypedDict, total=False):
5429
5467
  models. This field is not supported in Vertex AI.
5430
5468
  """
5431
5469
 
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
+
5432
5475
 
5433
5476
  GenerateContentConfigOrDict = Union[
5434
5477
  GenerateContentConfig, GenerateContentConfigDict
google/genai/version.py CHANGED
@@ -13,4 +13,4 @@
13
13
  # limitations under the License.
14
14
  #
15
15
 
16
- __version__ = '1.59.0' # x-release-please-version
16
+ __version__ = '1.60.0' # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-genai
3
- Version: 1.59.0
3
+ Version: 1.60.0
4
4
  Summary: GenAI Python SDK
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License-Expression: Apache-2.0
@@ -15,7 +15,7 @@ google/genai/_replay_api_client.py,sha256=-sZY8pM8JulqTfuqIKaKHCy9MNXF7HJnX6fCzy
15
15
  google/genai/_test_api_client.py,sha256=4ruFIy5_1qcbKqqIBu3HSQbpSOBrxiecBtDZaTGFR1s,4797
16
16
  google/genai/_tokens_converters.py,sha256=ILPWqhCU1MP2xi0Zg_Zz3fmZ37Yr-hGyg6iey9c4u_E,15593
17
17
  google/genai/_transformers.py,sha256=rVhKCz9Xi8PTMVOj4F5ITqQWMzUYeNLYacSIFlDjZwc,43191
18
- google/genai/batches.py,sha256=DzCiHli8ncxRbsey3x6xAvwFOxjrvh4_S5uD8mwDtl4,78786
18
+ google/genai/batches.py,sha256=LVnPsGb5Xjy6SYXmlvvW0ooIwAGs3DZ5-lfkDOHJqYU,78946
19
19
  google/genai/caches.py,sha256=24GhR6Nj-1Bdaey6ff6NNmP5pIjvlO0S1Dv_-CrCtyI,48118
20
20
  google/genai/chats.py,sha256=q3_iONHx8l-Y7EG29_f45yjFDdL2VFefUDLMdJtw0sE,16583
21
21
  google/genai/client.py,sha256=odJ3erYMO1tkvn_9AOyfLawNX2tZf71fbVzqmmLEjOY,21327
@@ -27,14 +27,14 @@ google/genai/interactions.py,sha256=GLpo-rTdxb1JfL3LXE0c52JWaEGloLnPeCI9hoO_M2g,
27
27
  google/genai/live.py,sha256=aBa_JndziEQjxhdpqChmGHaG4m9npOp9Z0HTXnoZdl8,41804
28
28
  google/genai/live_music.py,sha256=Y7I7jh5SAKgyjBIMLboH0oTnZJ18uOT2SpRDKURvp94,6783
29
29
  google/genai/local_tokenizer.py,sha256=EKZ72cV2Zfutlo_efMOPnLRNZN4WQe57rD3G80cF340,14109
30
- google/genai/models.py,sha256=9TfxuOxJwfMqjL435D7vdgf9Gwn77gqRf_8_5aGdnN8,238719
30
+ google/genai/models.py,sha256=jiQF2S3P5dwQXTNBhG0sxO3yotftpTz60kpu1sxYyA0,239060
31
31
  google/genai/operations.py,sha256=FXJOnYp2HA5Xqa5mHW67mSa9p1D_EaGGyUoKc09xFPQ,16384
32
32
  google/genai/pagers.py,sha256=1i8NXDuKuQznFin5H5-I0hmj6H5YMTYsEJP7S0ITSbY,7158
33
33
  google/genai/py.typed,sha256=RsMFoLwBkAvY05t6izop4UHZtqOPLiKp3GkIEizzmQY,40
34
34
  google/genai/tokens.py,sha256=4BPW0gGWFeFVk3INkuY2tfREnsrvzQDhouvRI6_F9Q8,12235
35
35
  google/genai/tunings.py,sha256=HNC3c_9MFwXDp-hcChvmDqkFinrD4kyLkNZPFiW72Tw,75536
36
- google/genai/types.py,sha256=3QImav8ZsdiDTIJ0WXD3Zdt9lGFOa3QM1b8btB3IS0Y,654139
37
- google/genai/version.py,sha256=H3kn3PFLP6OtMUhb44ZpK3GoCu4DYa2iZwmtsLpWtWI,627
36
+ google/genai/types.py,sha256=9VGATlIl4lVQqPlxaxxPnZ6fo5Wwz_A3LlaX9vEpRuU,655631
37
+ google/genai/version.py,sha256=NrUrMC5oUj0Akkrt589uYawRh_EXZlW2d02A-AC26x0,627
38
38
  google/genai/_interactions/__init__.py,sha256=Zl5wlyZ1be3a1ENIERjj9ocpELL89RdZkHF3MnCkB3M,3571
39
39
  google/genai/_interactions/_base_client.py,sha256=9U2GjsnrAEmFEIEWIDylGX9P-c038S9TqzcK2FKoKTw,74460
40
40
  google/genai/_interactions/_client.py,sha256=VkBifJIA0IchcNRUUb4E8w02udzmJMedYPXYnqX1iKc,21234
@@ -63,7 +63,7 @@ google/genai/_interactions/_utils/_transform.py,sha256=TjAN4LumRdzvMD0rcrFQhrlC3
63
63
  google/genai/_interactions/_utils/_typing.py,sha256=Z5S4PcLWBL5GEhqU6j_XKaoh9ANrTSDyMDDTlMB0KJ8,5385
64
64
  google/genai/_interactions/_utils/_utils.py,sha256=qWdNSrAUkn_wYeK5YFSeHyZWtEYJQkbh_Sg2t7impKQ,12851
65
65
  google/genai/_interactions/resources/__init__.py,sha256=TNMFv_-Zv9ayAgjkecVIBOnIK-goQIIvkvR3WiQl_DA,1207
66
- google/genai/_interactions/resources/interactions.py,sha256=6D94_eI2VQfxse4X3qfVInAw6SesxknOLtu917xFBMs,56663
66
+ google/genai/_interactions/resources/interactions.py,sha256=kldMEhXJnMpnLWDTFfAKiymOrTexfgufN0w6mwix8aE,56783
67
67
  google/genai/_interactions/types/__init__.py,sha256=saQGU4fshC1Oa5JsjjEEjXM_sJSlld3hnvHc8iiZAdQ,7970
68
68
  google/genai/_interactions/types/allowed_tools.py,sha256=Hke2IEAT_lc51MCt0_tGZGx3yvE7HTSawIlm-prCCGg,1047
69
69
  google/genai/_interactions/types/allowed_tools_param.py,sha256=PAAFKM2qX_Pj_pTxqcc0IQvii9soKLW_scMud2nUwMc,1092
@@ -120,7 +120,7 @@ google/genai/_interactions/types/image_content_param.py,sha256=Qof1jfT9Ey83hI-l6
120
120
  google/genai/_interactions/types/image_mime_type.py,sha256=JSM0MElIy62mLFjKiuheHeV0px02I-Nrh8H2yZTDU3I,884
121
121
  google/genai/_interactions/types/image_mime_type_param.py,sha256=syGoPn7nm3LoxqFbJhg3q9Bno68ywKU9hzoufbOm8xQ,930
122
122
  google/genai/_interactions/types/interaction.py,sha256=awI9GIgg8SHNDq7E-UGi4dQgSJY_uD_hzOP46HzR8oU,4096
123
- google/genai/_interactions/types/interaction_create_params.py,sha256=DL2huAy_rXYFWGveakzYel_zh7HE5_fA60nha8wPswk,6894
123
+ google/genai/_interactions/types/interaction_create_params.py,sha256=g8uIldqCWOvdICxR6_iRjGiHvikL2xgSvENnNSk-xMY,6918
124
124
  google/genai/_interactions/types/interaction_event.py,sha256=JkLyt1ikUZrDmQ9SZKc3WxJ9cVytEwu8X70vo3SrcNQ,1175
125
125
  google/genai/_interactions/types/interaction_get_params.py,sha256=kJnLjBS-uX6K4JeDdp1gaezb-I58aWtHBl3w8TNn3Os,1628
126
126
  google/genai/_interactions/types/interaction_sse_event.py,sha256=v59HGzqpW0ywuytcXYoCoSBnK7IxO1fnArbC6upCugc,1275
@@ -265,7 +265,7 @@ google/genai/tests/models/test_delete.py,sha256=OBl8mfHychtjWy6v19Das3ikYtBwN3po
265
265
  google/genai/tests/models/test_edit_image.py,sha256=2QG3ufsRGqryk9jSgyiTgMnuT8VuSZJvghatwEA3NXo,9369
266
266
  google/genai/tests/models/test_embed_content.py,sha256=RncjpLuaRO4sjTzTsiXVK5TJQ3poX2aApbZdqsOuh_0,2933
267
267
  google/genai/tests/models/test_function_call_streaming.py,sha256=8R6upyqnrBkajl_OH8V1lYepuMD9KV2oTTIbMfQoX9A,14787
268
- google/genai/tests/models/test_generate_content.py,sha256=JKKEabFaRP7eG84nA60WwxsUP5-tIG3DGDicXCCiTTk,79158
268
+ google/genai/tests/models/test_generate_content.py,sha256=lGOOjqzgiSqlcr8ZXYmQEiixC2eskfjYyyzNo5w3M3M,79758
269
269
  google/genai/tests/models/test_generate_content_cached_content.py,sha256=gwZTuvvjtavtYKHZMM6_qOikWSh08LWWZ6z-qGhk9DE,4754
270
270
  google/genai/tests/models/test_generate_content_config_zero_value.py,sha256=TNBTFFA9HLidwEF3tV1FV413kilLZWhrnN8MAulxqcc,3335
271
271
  google/genai/tests/models/test_generate_content_from_apikey.py,sha256=i-cqsmyfBfkP_Xu-x3l3lO9aUhBLViU4fNuNiDik2JU,1452
@@ -351,8 +351,8 @@ google/genai/tests/types/test_part_type.py,sha256=a_0eE2CgE7Ju6ePmu3DrupsZZCFiyD
351
351
  google/genai/tests/types/test_schema_from_json_schema.py,sha256=WiraJx5mRLW8lKHiWsyHTBYge4jVpeCYklbqGd4BkZQ,13894
352
352
  google/genai/tests/types/test_schema_json_schema.py,sha256=zn1gjsXcHTztzmajr8YX3Yb6rWnchjgjw6Yj1NZnG-0,15536
353
353
  google/genai/tests/types/test_types.py,sha256=Tqc_PpGo9-XH1xfkAjTCM9xngan_4w__hgpA0BkyA8g,84416
354
- google_genai-1.59.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
355
- google_genai-1.59.0.dist-info/METADATA,sha256=v31Jclwt0khI19C_kozO_-tckmdfzoEQD_IG6mruQxU,53135
356
- google_genai-1.59.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
357
- google_genai-1.59.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
358
- google_genai-1.59.0.dist-info/RECORD,,
354
+ google_genai-1.60.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
355
+ google_genai-1.60.0.dist-info/METADATA,sha256=4rcfkSYtjZJOIFcdtuYUrmAgON5CaQ6LPNl5geBLzA0,53135
356
+ google_genai-1.60.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
357
+ google_genai-1.60.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
358
+ google_genai-1.60.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5