google-cloud-modelarmor 0.7.0__tar.gz → 0.7.1__tar.gz
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.
- {google_cloud_modelarmor-0.7.0/google_cloud_modelarmor.egg-info → google_cloud_modelarmor-0.7.1}/PKG-INFO +4 -5
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor/__init__.py +8 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor/gapic_version.py +1 -1
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/__init__.py +12 -4
- {google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1beta → google_cloud_modelarmor-0.7.1/google/cloud/modelarmor_v1}/gapic_version.py +1 -1
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/types/__init__.py +8 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/types/service.py +219 -2
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/__init__.py +4 -4
- {google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1 → google_cloud_modelarmor-0.7.1/google/cloud/modelarmor_v1beta}/gapic_version.py +1 -1
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1/google_cloud_modelarmor.egg-info}/PKG-INFO +4 -5
- google_cloud_modelarmor-0.7.1/google_cloud_modelarmor.egg-info/requires.txt +8 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/setup.py +7 -5
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/unit/gapic/modelarmor_v1/test_model_armor.py +2 -0
- google_cloud_modelarmor-0.7.0/google_cloud_modelarmor.egg-info/requires.txt +0 -11
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/LICENSE +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/MANIFEST.in +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/README.rst +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor/py.typed +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/gapic_metadata.json +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/py.typed +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/async_client.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/client.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/pagers.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/transports/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/transports/base.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/transports/grpc.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/transports/grpc_asyncio.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/transports/rest.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/services/model_armor/transports/rest_base.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/gapic_metadata.json +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/py.typed +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/async_client.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/client.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/pagers.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/transports/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/transports/base.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/transports/grpc.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/transports/grpc_asyncio.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/transports/rest.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/services/model_armor/transports/rest_base.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/types/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1beta/types/service.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google_cloud_modelarmor.egg-info/SOURCES.txt +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google_cloud_modelarmor.egg-info/dependency_links.txt +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google_cloud_modelarmor.egg-info/not-zip-safe +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google_cloud_modelarmor.egg-info/top_level.txt +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/setup.cfg +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/unit/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/unit/gapic/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/unit/gapic/modelarmor_v1/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/unit/gapic/modelarmor_v1beta/__init__.py +0 -0
- {google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/unit/gapic/modelarmor_v1beta/test_model_armor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-modelarmor
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Google Cloud Modelarmor API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-modelarmor
|
|
6
6
|
Author: Google LLC
|
|
@@ -21,13 +21,12 @@ Classifier: Operating System :: OS Independent
|
|
|
21
21
|
Classifier: Topic :: Internet
|
|
22
22
|
Requires-Python: >=3.10
|
|
23
23
|
License-File: LICENSE
|
|
24
|
-
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.
|
|
24
|
+
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.24.2
|
|
25
25
|
Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
26
26
|
Requires-Dist: grpcio<2.0.0,>=1.59.0
|
|
27
27
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
|
|
28
|
-
Requires-Dist: proto-plus<2.0.0,>=1.
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist: protobuf<8.0.0,>=4.25.8
|
|
28
|
+
Requires-Dist: proto-plus<2.0.0,>=1.26.1
|
|
29
|
+
Requires-Dist: protobuf<8.0.0,>=6.33.5
|
|
31
30
|
Dynamic: author
|
|
32
31
|
Dynamic: author-email
|
|
33
32
|
Dynamic: classifier
|
{google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor/__init__.py
RENAMED
|
@@ -43,6 +43,7 @@ from google.cloud.modelarmor_v1.types.service import (
|
|
|
43
43
|
MaliciousUriFilterResult,
|
|
44
44
|
MaliciousUriFilterSettings,
|
|
45
45
|
MessageItem,
|
|
46
|
+
Modality,
|
|
46
47
|
MultiLanguageDetectionMetadata,
|
|
47
48
|
PiAndJailbreakFilterResult,
|
|
48
49
|
PiAndJailbreakFilterSettings,
|
|
@@ -57,12 +58,15 @@ from google.cloud.modelarmor_v1.types.service import (
|
|
|
57
58
|
SanitizeUserPromptResponse,
|
|
58
59
|
SdpAdvancedConfig,
|
|
59
60
|
SdpBasicConfig,
|
|
61
|
+
SdpContentLocation,
|
|
60
62
|
SdpDeidentifyResult,
|
|
61
63
|
SdpFilterResult,
|
|
62
64
|
SdpFilterSettings,
|
|
63
65
|
SdpFinding,
|
|
64
66
|
SdpFindingLikelihood,
|
|
67
|
+
SdpImageFindingLocation,
|
|
65
68
|
SdpInspectResult,
|
|
69
|
+
SdpRedactResult,
|
|
66
70
|
StreamingMode,
|
|
67
71
|
Template,
|
|
68
72
|
UpdateFloorSettingRequest,
|
|
@@ -103,11 +107,14 @@ __all__ = (
|
|
|
103
107
|
"SanitizeUserPromptResponse",
|
|
104
108
|
"SdpAdvancedConfig",
|
|
105
109
|
"SdpBasicConfig",
|
|
110
|
+
"SdpContentLocation",
|
|
106
111
|
"SdpDeidentifyResult",
|
|
107
112
|
"SdpFilterResult",
|
|
108
113
|
"SdpFilterSettings",
|
|
109
114
|
"SdpFinding",
|
|
115
|
+
"SdpImageFindingLocation",
|
|
110
116
|
"SdpInspectResult",
|
|
117
|
+
"SdpRedactResult",
|
|
111
118
|
"Template",
|
|
112
119
|
"UpdateFloorSettingRequest",
|
|
113
120
|
"UpdateTemplateRequest",
|
|
@@ -117,6 +124,7 @@ __all__ = (
|
|
|
117
124
|
"FilterExecutionState",
|
|
118
125
|
"FilterMatchState",
|
|
119
126
|
"InvocationResult",
|
|
127
|
+
"Modality",
|
|
120
128
|
"RaiFilterType",
|
|
121
129
|
"SdpFindingLikelihood",
|
|
122
130
|
"StreamingMode",
|
|
@@ -45,6 +45,7 @@ from .types.service import (
|
|
|
45
45
|
MaliciousUriFilterResult,
|
|
46
46
|
MaliciousUriFilterSettings,
|
|
47
47
|
MessageItem,
|
|
48
|
+
Modality,
|
|
48
49
|
MultiLanguageDetectionMetadata,
|
|
49
50
|
PiAndJailbreakFilterResult,
|
|
50
51
|
PiAndJailbreakFilterSettings,
|
|
@@ -59,12 +60,15 @@ from .types.service import (
|
|
|
59
60
|
SanitizeUserPromptResponse,
|
|
60
61
|
SdpAdvancedConfig,
|
|
61
62
|
SdpBasicConfig,
|
|
63
|
+
SdpContentLocation,
|
|
62
64
|
SdpDeidentifyResult,
|
|
63
65
|
SdpFilterResult,
|
|
64
66
|
SdpFilterSettings,
|
|
65
67
|
SdpFinding,
|
|
66
68
|
SdpFindingLikelihood,
|
|
69
|
+
SdpImageFindingLocation,
|
|
67
70
|
SdpInspectResult,
|
|
71
|
+
SdpRedactResult,
|
|
68
72
|
StreamingMode,
|
|
69
73
|
Template,
|
|
70
74
|
UpdateFloorSettingRequest,
|
|
@@ -98,7 +102,7 @@ else: # pragma: NO COVER
|
|
|
98
102
|
|
|
99
103
|
def parse_version_to_tuple(version_string: str):
|
|
100
104
|
"""Safely converts a semantic version string to a comparable tuple of integers.
|
|
101
|
-
Example: "
|
|
105
|
+
Example: "6.33.5" -> (6, 33, 5)
|
|
102
106
|
Ignores non-numeric parts and handles common version formats.
|
|
103
107
|
Args:
|
|
104
108
|
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
|
|
@@ -127,9 +131,9 @@ else: # pragma: NO COVER
|
|
|
127
131
|
return (None, "--")
|
|
128
132
|
|
|
129
133
|
_dependency_package = "google.protobuf"
|
|
130
|
-
_next_supported_version = "
|
|
131
|
-
_next_supported_version_tuple = (
|
|
132
|
-
_recommendation = " (we recommend
|
|
134
|
+
_next_supported_version = "6.33.5"
|
|
135
|
+
_next_supported_version_tuple = (6, 33, 5)
|
|
136
|
+
_recommendation = " (we recommend 7.x)"
|
|
133
137
|
(_version_used, _version_used_string) = _get_version(_dependency_package)
|
|
134
138
|
if _version_used and _version_used < _next_supported_version_tuple:
|
|
135
139
|
warnings.warn(
|
|
@@ -178,6 +182,7 @@ __all__ = (
|
|
|
178
182
|
"MaliciousUriFilterResult",
|
|
179
183
|
"MaliciousUriFilterSettings",
|
|
180
184
|
"MessageItem",
|
|
185
|
+
"Modality",
|
|
181
186
|
"ModelArmorClient",
|
|
182
187
|
"MultiLanguageDetectionMetadata",
|
|
183
188
|
"PiAndJailbreakFilterResult",
|
|
@@ -193,12 +198,15 @@ __all__ = (
|
|
|
193
198
|
"SanitizeUserPromptResponse",
|
|
194
199
|
"SdpAdvancedConfig",
|
|
195
200
|
"SdpBasicConfig",
|
|
201
|
+
"SdpContentLocation",
|
|
196
202
|
"SdpDeidentifyResult",
|
|
197
203
|
"SdpFilterResult",
|
|
198
204
|
"SdpFilterSettings",
|
|
199
205
|
"SdpFinding",
|
|
200
206
|
"SdpFindingLikelihood",
|
|
207
|
+
"SdpImageFindingLocation",
|
|
201
208
|
"SdpInspectResult",
|
|
209
|
+
"SdpRedactResult",
|
|
202
210
|
"StreamingMode",
|
|
203
211
|
"Template",
|
|
204
212
|
"UpdateFloorSettingRequest",
|
|
@@ -34,6 +34,7 @@ from .service import (
|
|
|
34
34
|
MaliciousUriFilterResult,
|
|
35
35
|
MaliciousUriFilterSettings,
|
|
36
36
|
MessageItem,
|
|
37
|
+
Modality,
|
|
37
38
|
MultiLanguageDetectionMetadata,
|
|
38
39
|
PiAndJailbreakFilterResult,
|
|
39
40
|
PiAndJailbreakFilterSettings,
|
|
@@ -48,12 +49,15 @@ from .service import (
|
|
|
48
49
|
SanitizeUserPromptResponse,
|
|
49
50
|
SdpAdvancedConfig,
|
|
50
51
|
SdpBasicConfig,
|
|
52
|
+
SdpContentLocation,
|
|
51
53
|
SdpDeidentifyResult,
|
|
52
54
|
SdpFilterResult,
|
|
53
55
|
SdpFilterSettings,
|
|
54
56
|
SdpFinding,
|
|
55
57
|
SdpFindingLikelihood,
|
|
58
|
+
SdpImageFindingLocation,
|
|
56
59
|
SdpInspectResult,
|
|
60
|
+
SdpRedactResult,
|
|
57
61
|
StreamingMode,
|
|
58
62
|
Template,
|
|
59
63
|
UpdateFloorSettingRequest,
|
|
@@ -92,11 +96,14 @@ __all__ = (
|
|
|
92
96
|
"SanitizeUserPromptResponse",
|
|
93
97
|
"SdpAdvancedConfig",
|
|
94
98
|
"SdpBasicConfig",
|
|
99
|
+
"SdpContentLocation",
|
|
95
100
|
"SdpDeidentifyResult",
|
|
96
101
|
"SdpFilterResult",
|
|
97
102
|
"SdpFilterSettings",
|
|
98
103
|
"SdpFinding",
|
|
104
|
+
"SdpImageFindingLocation",
|
|
99
105
|
"SdpInspectResult",
|
|
106
|
+
"SdpRedactResult",
|
|
100
107
|
"Template",
|
|
101
108
|
"UpdateFloorSettingRequest",
|
|
102
109
|
"UpdateTemplateRequest",
|
|
@@ -106,6 +113,7 @@ __all__ = (
|
|
|
106
113
|
"FilterExecutionState",
|
|
107
114
|
"FilterMatchState",
|
|
108
115
|
"InvocationResult",
|
|
116
|
+
"Modality",
|
|
109
117
|
"RaiFilterType",
|
|
110
118
|
"SdpFindingLikelihood",
|
|
111
119
|
"StreamingMode",
|
|
@@ -31,6 +31,7 @@ __protobuf__ = proto.module(
|
|
|
31
31
|
"SdpFindingLikelihood",
|
|
32
32
|
"InvocationResult",
|
|
33
33
|
"StreamingMode",
|
|
34
|
+
"Modality",
|
|
34
35
|
"Template",
|
|
35
36
|
"FloorSetting",
|
|
36
37
|
"AiPlatformFloorSetting",
|
|
@@ -62,7 +63,10 @@ __protobuf__ = proto.module(
|
|
|
62
63
|
"DataItem",
|
|
63
64
|
"ByteDataItem",
|
|
64
65
|
"SdpDeidentifyResult",
|
|
66
|
+
"SdpImageFindingLocation",
|
|
67
|
+
"SdpContentLocation",
|
|
65
68
|
"SdpFinding",
|
|
69
|
+
"SdpRedactResult",
|
|
66
70
|
"PiAndJailbreakFilterResult",
|
|
67
71
|
"MaliciousUriFilterResult",
|
|
68
72
|
"VirusScanFilterResult",
|
|
@@ -223,6 +227,31 @@ class StreamingMode(proto.Enum):
|
|
|
223
227
|
STREAMING_MODE_REALTIME = 2
|
|
224
228
|
|
|
225
229
|
|
|
230
|
+
class Modality(proto.Enum):
|
|
231
|
+
r"""This enum is used in the TemplateMetadata message to indicate
|
|
232
|
+
the modality supported for sanitize API calls.
|
|
233
|
+
|
|
234
|
+
Values:
|
|
235
|
+
MODALITY_UNSPECIFIED (0):
|
|
236
|
+
Unspecified modality. If specified, all
|
|
237
|
+
modalities will be sanitized.
|
|
238
|
+
MODALITY_TEXT (1):
|
|
239
|
+
Represents text modality. If specified, it
|
|
240
|
+
will sanitize text fields, and text extracted
|
|
241
|
+
from rich text files (like PDFs, DOCs) and plain
|
|
242
|
+
text files (like TXT).
|
|
243
|
+
MODALITY_IMAGE (2):
|
|
244
|
+
Represents image modality. If specified, it
|
|
245
|
+
will sanitize image files. The visual content
|
|
246
|
+
and the text content in the image will be
|
|
247
|
+
sanitized depending on the filter configuration.
|
|
248
|
+
"""
|
|
249
|
+
|
|
250
|
+
MODALITY_UNSPECIFIED = 0
|
|
251
|
+
MODALITY_TEXT = 1
|
|
252
|
+
MODALITY_IMAGE = 2
|
|
253
|
+
|
|
254
|
+
|
|
226
255
|
class Template(proto.Message):
|
|
227
256
|
r"""Message describing Template resource
|
|
228
257
|
|
|
@@ -277,6 +306,9 @@ class Template(proto.Message):
|
|
|
277
306
|
multi_language_detection (google.cloud.modelarmor_v1.types.Template.TemplateMetadata.MultiLanguageDetection):
|
|
278
307
|
Optional. Metadata for multi language
|
|
279
308
|
detection.
|
|
309
|
+
modalities (MutableSequence[google.cloud.modelarmor_v1.types.Modality]):
|
|
310
|
+
Optional. Specifies the modalities to scan.
|
|
311
|
+
If empty, only text modality will be scanned.
|
|
280
312
|
"""
|
|
281
313
|
|
|
282
314
|
class EnforcementType(proto.Enum):
|
|
@@ -352,6 +384,11 @@ class Template(proto.Message):
|
|
|
352
384
|
message="Template.TemplateMetadata.MultiLanguageDetection",
|
|
353
385
|
)
|
|
354
386
|
)
|
|
387
|
+
modalities: MutableSequence["Modality"] = proto.RepeatedField(
|
|
388
|
+
proto.ENUM,
|
|
389
|
+
number=11,
|
|
390
|
+
enum="Modality",
|
|
391
|
+
)
|
|
355
392
|
|
|
356
393
|
name: str = proto.Field(
|
|
357
394
|
proto.STRING,
|
|
@@ -879,7 +916,7 @@ class PiAndJailbreakFilterSettings(proto.Message):
|
|
|
879
916
|
ENABLED (1):
|
|
880
917
|
Enabled
|
|
881
918
|
DISABLED (2):
|
|
882
|
-
|
|
919
|
+
Disabled
|
|
883
920
|
"""
|
|
884
921
|
|
|
885
922
|
PI_AND_JAILBREAK_FILTER_ENFORCEMENT_UNSPECIFIED = 0
|
|
@@ -1427,7 +1464,7 @@ class RaiFilterResult(proto.Message):
|
|
|
1427
1464
|
rai_filter_type_results (MutableMapping[str, google.cloud.modelarmor_v1.types.RaiFilterResult.RaiFilterTypeResult]):
|
|
1428
1465
|
The map of RAI filter results where key is RAI filter type -
|
|
1429
1466
|
either of "sexually_explicit", "hate_speech", "harassment",
|
|
1430
|
-
"dangerous".
|
|
1467
|
+
"dangerous", "violence", "sexually_suggestive".
|
|
1431
1468
|
"""
|
|
1432
1469
|
|
|
1433
1470
|
class RaiFilterTypeResult(proto.Message):
|
|
@@ -1503,6 +1540,12 @@ class SdpFilterResult(proto.Message):
|
|
|
1503
1540
|
Sensitive Data Protection Deidentification
|
|
1504
1541
|
result if deidentification is performed.
|
|
1505
1542
|
|
|
1543
|
+
This field is a member of `oneof`_ ``result``.
|
|
1544
|
+
redact_result (google.cloud.modelarmor_v1.types.SdpRedactResult):
|
|
1545
|
+
Sensitive Data Protection Redaction result if
|
|
1546
|
+
redaction is performed. This is primarily used
|
|
1547
|
+
for image redaction.
|
|
1548
|
+
|
|
1506
1549
|
This field is a member of `oneof`_ ``result``.
|
|
1507
1550
|
"""
|
|
1508
1551
|
|
|
@@ -1518,6 +1561,12 @@ class SdpFilterResult(proto.Message):
|
|
|
1518
1561
|
oneof="result",
|
|
1519
1562
|
message="SdpDeidentifyResult",
|
|
1520
1563
|
)
|
|
1564
|
+
redact_result: "SdpRedactResult" = proto.Field(
|
|
1565
|
+
proto.MESSAGE,
|
|
1566
|
+
number=3,
|
|
1567
|
+
oneof="result",
|
|
1568
|
+
message="SdpRedactResult",
|
|
1569
|
+
)
|
|
1521
1570
|
|
|
1522
1571
|
|
|
1523
1572
|
class SdpInspectResult(proto.Message):
|
|
@@ -1548,6 +1597,9 @@ class SdpInspectResult(proto.Message):
|
|
|
1548
1597
|
input items were too large, or because the
|
|
1549
1598
|
server reached the maximum amount of resources
|
|
1550
1599
|
allowed for a single API call.
|
|
1600
|
+
extracted_image_text (str):
|
|
1601
|
+
Contains text extracted from the image, if
|
|
1602
|
+
applicable.
|
|
1551
1603
|
"""
|
|
1552
1604
|
|
|
1553
1605
|
execution_state: "FilterExecutionState" = proto.Field(
|
|
@@ -1574,6 +1626,10 @@ class SdpInspectResult(proto.Message):
|
|
|
1574
1626
|
proto.BOOL,
|
|
1575
1627
|
number=5,
|
|
1576
1628
|
)
|
|
1629
|
+
extracted_image_text: str = proto.Field(
|
|
1630
|
+
proto.STRING,
|
|
1631
|
+
number=6,
|
|
1632
|
+
)
|
|
1577
1633
|
|
|
1578
1634
|
|
|
1579
1635
|
class DataItem(proto.Message):
|
|
@@ -1640,6 +1696,8 @@ class ByteDataItem(proto.Message):
|
|
|
1640
1696
|
TXT
|
|
1641
1697
|
CSV (7):
|
|
1642
1698
|
CSV
|
|
1699
|
+
IMAGE (8):
|
|
1700
|
+
IMAGE
|
|
1643
1701
|
"""
|
|
1644
1702
|
|
|
1645
1703
|
BYTE_ITEM_TYPE_UNSPECIFIED = 0
|
|
@@ -1650,6 +1708,7 @@ class ByteDataItem(proto.Message):
|
|
|
1650
1708
|
POWERPOINT_DOCUMENT = 5
|
|
1651
1709
|
TXT = 6
|
|
1652
1710
|
CSV = 7
|
|
1711
|
+
IMAGE = 8
|
|
1653
1712
|
|
|
1654
1713
|
byte_data_type: ByteItemType = proto.Field(
|
|
1655
1714
|
proto.ENUM,
|
|
@@ -1720,6 +1779,89 @@ class SdpDeidentifyResult(proto.Message):
|
|
|
1720
1779
|
)
|
|
1721
1780
|
|
|
1722
1781
|
|
|
1782
|
+
class SdpImageFindingLocation(proto.Message):
|
|
1783
|
+
r"""Location of the finding within an image.
|
|
1784
|
+
|
|
1785
|
+
Attributes:
|
|
1786
|
+
bounding_boxes (MutableSequence[google.cloud.modelarmor_v1.types.SdpImageFindingLocation.SdpBoundingBox]):
|
|
1787
|
+
Bounding boxes locating the pixels within the
|
|
1788
|
+
image containing the finding.
|
|
1789
|
+
"""
|
|
1790
|
+
|
|
1791
|
+
class SdpBoundingBox(proto.Message):
|
|
1792
|
+
r"""Bounding box encompassing a finding within an image.
|
|
1793
|
+
|
|
1794
|
+
Attributes:
|
|
1795
|
+
top (int):
|
|
1796
|
+
Top coordinate of the bounding box. (0,0) is
|
|
1797
|
+
upper left.
|
|
1798
|
+
left (int):
|
|
1799
|
+
Left coordinate of the bounding box. (0,0) is
|
|
1800
|
+
upper left.
|
|
1801
|
+
width (int):
|
|
1802
|
+
Width of the bounding box in pixels.
|
|
1803
|
+
height (int):
|
|
1804
|
+
Height of the bounding box in pixels.
|
|
1805
|
+
"""
|
|
1806
|
+
|
|
1807
|
+
top: int = proto.Field(
|
|
1808
|
+
proto.INT32,
|
|
1809
|
+
number=1,
|
|
1810
|
+
)
|
|
1811
|
+
left: int = proto.Field(
|
|
1812
|
+
proto.INT32,
|
|
1813
|
+
number=2,
|
|
1814
|
+
)
|
|
1815
|
+
width: int = proto.Field(
|
|
1816
|
+
proto.INT32,
|
|
1817
|
+
number=3,
|
|
1818
|
+
)
|
|
1819
|
+
height: int = proto.Field(
|
|
1820
|
+
proto.INT32,
|
|
1821
|
+
number=4,
|
|
1822
|
+
)
|
|
1823
|
+
|
|
1824
|
+
bounding_boxes: MutableSequence[SdpBoundingBox] = proto.RepeatedField(
|
|
1825
|
+
proto.MESSAGE,
|
|
1826
|
+
number=1,
|
|
1827
|
+
message=SdpBoundingBox,
|
|
1828
|
+
)
|
|
1829
|
+
|
|
1830
|
+
|
|
1831
|
+
class SdpContentLocation(proto.Message):
|
|
1832
|
+
r"""Precise location of the finding within a document, record,
|
|
1833
|
+
image, or metadata container.
|
|
1834
|
+
|
|
1835
|
+
|
|
1836
|
+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
|
|
1837
|
+
|
|
1838
|
+
Attributes:
|
|
1839
|
+
image_finding_location (google.cloud.modelarmor_v1.types.SdpImageFindingLocation):
|
|
1840
|
+
Location within an image's pixels.
|
|
1841
|
+
|
|
1842
|
+
This field is a member of `oneof`_ ``location``.
|
|
1843
|
+
container_name (str):
|
|
1844
|
+
Name of the container where the finding is
|
|
1845
|
+
located. The top level name is the source file
|
|
1846
|
+
name or table name.
|
|
1847
|
+
|
|
1848
|
+
Nested names could be absent if the embedded
|
|
1849
|
+
object has no string identifier (for example, an
|
|
1850
|
+
image contained within a document).
|
|
1851
|
+
"""
|
|
1852
|
+
|
|
1853
|
+
image_finding_location: "SdpImageFindingLocation" = proto.Field(
|
|
1854
|
+
proto.MESSAGE,
|
|
1855
|
+
number=2,
|
|
1856
|
+
oneof="location",
|
|
1857
|
+
message="SdpImageFindingLocation",
|
|
1858
|
+
)
|
|
1859
|
+
container_name: str = proto.Field(
|
|
1860
|
+
proto.STRING,
|
|
1861
|
+
number=1,
|
|
1862
|
+
)
|
|
1863
|
+
|
|
1864
|
+
|
|
1723
1865
|
class SdpFinding(proto.Message):
|
|
1724
1866
|
r"""Finding corresponding to Sensitive Data Protection filter.
|
|
1725
1867
|
|
|
@@ -1744,11 +1886,23 @@ class SdpFinding(proto.Message):
|
|
|
1744
1886
|
containing element. Note that when the content
|
|
1745
1887
|
is not textual, this references the UTF-8
|
|
1746
1888
|
encoded textual representation of the content.
|
|
1889
|
+
Note: Omitted if content is an image.
|
|
1747
1890
|
codepoint_range (google.cloud.modelarmor_v1.types.RangeInfo):
|
|
1748
1891
|
Unicode character offsets delimiting the
|
|
1749
1892
|
finding. These are relative to the finding's
|
|
1750
1893
|
containing element. Provided when the content is
|
|
1751
1894
|
text.
|
|
1895
|
+
Note: Omitted if content is an image.
|
|
1896
|
+
content_locations (MutableSequence[google.cloud.modelarmor_v1.types.SdpContentLocation]):
|
|
1897
|
+
List of nested objects pointing to the precise location of
|
|
1898
|
+
the finding within an image, file or record.
|
|
1899
|
+
|
|
1900
|
+
For example, a single finding might be detected in two
|
|
1901
|
+
separate bounding boxes within an image (e.g., if it wraps
|
|
1902
|
+
across a line or is partially obscured). In such cases,
|
|
1903
|
+
content_locations would contain two SdpContentLocation
|
|
1904
|
+
entries, each with an image_finding_location pointing to a
|
|
1905
|
+
different bounding box.
|
|
1752
1906
|
"""
|
|
1753
1907
|
|
|
1754
1908
|
byte_range: "RangeInfo" = proto.Field(
|
|
@@ -1761,6 +1915,11 @@ class SdpFinding(proto.Message):
|
|
|
1761
1915
|
number=2,
|
|
1762
1916
|
message="RangeInfo",
|
|
1763
1917
|
)
|
|
1918
|
+
content_locations: MutableSequence["SdpContentLocation"] = proto.RepeatedField(
|
|
1919
|
+
proto.MESSAGE,
|
|
1920
|
+
number=3,
|
|
1921
|
+
message="SdpContentLocation",
|
|
1922
|
+
)
|
|
1764
1923
|
|
|
1765
1924
|
info_type: str = proto.Field(
|
|
1766
1925
|
proto.STRING,
|
|
@@ -1778,6 +1937,64 @@ class SdpFinding(proto.Message):
|
|
|
1778
1937
|
)
|
|
1779
1938
|
|
|
1780
1939
|
|
|
1940
|
+
class SdpRedactResult(proto.Message):
|
|
1941
|
+
r"""Sensitive Data Protection Redaction Result.
|
|
1942
|
+
|
|
1943
|
+
Attributes:
|
|
1944
|
+
execution_state (google.cloud.modelarmor_v1.types.FilterExecutionState):
|
|
1945
|
+
Output only. Reports whether Sensitive Data
|
|
1946
|
+
Protection redaction was successfully executed
|
|
1947
|
+
or not.
|
|
1948
|
+
message_items (MutableSequence[google.cloud.modelarmor_v1.types.MessageItem]):
|
|
1949
|
+
Output only. Optional messages corresponding
|
|
1950
|
+
to the result. A message can provide warnings or
|
|
1951
|
+
error details. For example, if execution state
|
|
1952
|
+
is skipped then this field provides related
|
|
1953
|
+
reason/explanation.
|
|
1954
|
+
match_state (google.cloud.modelarmor_v1.types.FilterMatchState):
|
|
1955
|
+
Output only. Match state for Sensitive Data Protection
|
|
1956
|
+
Redaction. Value is MATCH_FOUND if content is redacted.
|
|
1957
|
+
redacted_image (bytes):
|
|
1958
|
+
Output only. The redacted image. The type
|
|
1959
|
+
will be the same as the original image.
|
|
1960
|
+
findings (MutableSequence[google.cloud.modelarmor_v1.types.SdpFinding]):
|
|
1961
|
+
Output only. The findings. This field is populated in the
|
|
1962
|
+
response only when include_findings in the SDP template is
|
|
1963
|
+
set to true.
|
|
1964
|
+
extracted_image_text (str):
|
|
1965
|
+
The extracted text from the image.
|
|
1966
|
+
"""
|
|
1967
|
+
|
|
1968
|
+
execution_state: "FilterExecutionState" = proto.Field(
|
|
1969
|
+
proto.ENUM,
|
|
1970
|
+
number=1,
|
|
1971
|
+
enum="FilterExecutionState",
|
|
1972
|
+
)
|
|
1973
|
+
message_items: MutableSequence["MessageItem"] = proto.RepeatedField(
|
|
1974
|
+
proto.MESSAGE,
|
|
1975
|
+
number=2,
|
|
1976
|
+
message="MessageItem",
|
|
1977
|
+
)
|
|
1978
|
+
match_state: "FilterMatchState" = proto.Field(
|
|
1979
|
+
proto.ENUM,
|
|
1980
|
+
number=3,
|
|
1981
|
+
enum="FilterMatchState",
|
|
1982
|
+
)
|
|
1983
|
+
redacted_image: bytes = proto.Field(
|
|
1984
|
+
proto.BYTES,
|
|
1985
|
+
number=4,
|
|
1986
|
+
)
|
|
1987
|
+
findings: MutableSequence["SdpFinding"] = proto.RepeatedField(
|
|
1988
|
+
proto.MESSAGE,
|
|
1989
|
+
number=5,
|
|
1990
|
+
message="SdpFinding",
|
|
1991
|
+
)
|
|
1992
|
+
extracted_image_text: str = proto.Field(
|
|
1993
|
+
proto.STRING,
|
|
1994
|
+
number=6,
|
|
1995
|
+
)
|
|
1996
|
+
|
|
1997
|
+
|
|
1781
1998
|
class PiAndJailbreakFilterResult(proto.Message):
|
|
1782
1999
|
r"""Prompt injection and Jailbreak Filter Result.
|
|
1783
2000
|
|
|
@@ -99,7 +99,7 @@ else: # pragma: NO COVER
|
|
|
99
99
|
|
|
100
100
|
def parse_version_to_tuple(version_string: str):
|
|
101
101
|
"""Safely converts a semantic version string to a comparable tuple of integers.
|
|
102
|
-
Example: "
|
|
102
|
+
Example: "6.33.5" -> (6, 33, 5)
|
|
103
103
|
Ignores non-numeric parts and handles common version formats.
|
|
104
104
|
Args:
|
|
105
105
|
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
|
|
@@ -128,9 +128,9 @@ else: # pragma: NO COVER
|
|
|
128
128
|
return (None, "--")
|
|
129
129
|
|
|
130
130
|
_dependency_package = "google.protobuf"
|
|
131
|
-
_next_supported_version = "
|
|
132
|
-
_next_supported_version_tuple = (
|
|
133
|
-
_recommendation = " (we recommend
|
|
131
|
+
_next_supported_version = "6.33.5"
|
|
132
|
+
_next_supported_version_tuple = (6, 33, 5)
|
|
133
|
+
_recommendation = " (we recommend 7.x)"
|
|
134
134
|
(_version_used, _version_used_string) = _get_version(_dependency_package)
|
|
135
135
|
if _version_used and _version_used < _next_supported_version_tuple:
|
|
136
136
|
warnings.warn(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-modelarmor
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Google Cloud Modelarmor API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-modelarmor
|
|
6
6
|
Author: Google LLC
|
|
@@ -21,13 +21,12 @@ Classifier: Operating System :: OS Independent
|
|
|
21
21
|
Classifier: Topic :: Internet
|
|
22
22
|
Requires-Python: >=3.10
|
|
23
23
|
License-File: LICENSE
|
|
24
|
-
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.
|
|
24
|
+
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.24.2
|
|
25
25
|
Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
26
26
|
Requires-Dist: grpcio<2.0.0,>=1.59.0
|
|
27
27
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
|
|
28
|
-
Requires-Dist: proto-plus<2.0.0,>=1.
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist: protobuf<8.0.0,>=4.25.8
|
|
28
|
+
Requires-Dist: proto-plus<2.0.0,>=1.26.1
|
|
29
|
+
Requires-Dist: protobuf<8.0.0,>=6.33.5
|
|
31
30
|
Dynamic: author
|
|
32
31
|
Dynamic: author-email
|
|
33
32
|
Dynamic: classifier
|
|
@@ -29,7 +29,10 @@ description = "Google Cloud Modelarmor API client library"
|
|
|
29
29
|
version = None
|
|
30
30
|
|
|
31
31
|
with open(os.path.join(package_root, "google/cloud/modelarmor/gapic_version.py")) as fp:
|
|
32
|
-
version_candidates = re.findall(
|
|
32
|
+
version_candidates = re.findall(
|
|
33
|
+
r"(?<=\")\d+\.\d+\.\d+[^\"\s]*(?=\")",
|
|
34
|
+
fp.read(),
|
|
35
|
+
)
|
|
33
36
|
assert len(version_candidates) == 1
|
|
34
37
|
version = version_candidates[0]
|
|
35
38
|
|
|
@@ -39,15 +42,14 @@ else:
|
|
|
39
42
|
release_status = "Development Status :: 5 - Production/Stable"
|
|
40
43
|
|
|
41
44
|
dependencies = [
|
|
42
|
-
"google-api-core[grpc] >= 2.
|
|
45
|
+
"google-api-core[grpc] >= 2.24.2, <3.0.0",
|
|
43
46
|
# Exclude incompatible versions of `google-auth`
|
|
44
47
|
# See https://github.com/googleapis/google-cloud-python/issues/12364
|
|
45
48
|
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
|
|
46
49
|
"grpcio >= 1.59.0, < 2.0.0",
|
|
47
50
|
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
|
|
48
|
-
"proto-plus >= 1.
|
|
49
|
-
"
|
|
50
|
-
"protobuf >= 4.25.8, < 8.0.0",
|
|
51
|
+
"proto-plus >= 1.26.1, <2.0.0",
|
|
52
|
+
"protobuf >= 6.33.5, < 8.0.0",
|
|
51
53
|
]
|
|
52
54
|
extras = {}
|
|
53
55
|
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-modelarmor"
|
|
@@ -7239,6 +7239,7 @@ def test_create_template_rest_call_success(request_type):
|
|
|
7239
7239
|
"log_sanitize_operations": True,
|
|
7240
7240
|
"enforcement_type": 1,
|
|
7241
7241
|
"multi_language_detection": {"enable_multi_language_detection": True},
|
|
7242
|
+
"modalities": [1],
|
|
7242
7243
|
},
|
|
7243
7244
|
}
|
|
7244
7245
|
# The version of a generated dependency at test runtime may differ from the version used during generation.
|
|
@@ -7470,6 +7471,7 @@ def test_update_template_rest_call_success(request_type):
|
|
|
7470
7471
|
"log_sanitize_operations": True,
|
|
7471
7472
|
"enforcement_type": 1,
|
|
7472
7473
|
"multi_language_detection": {"enable_multi_language_detection": True},
|
|
7474
|
+
"modalities": [1],
|
|
7473
7475
|
},
|
|
7474
7476
|
}
|
|
7475
7477
|
# The version of a generated dependency at test runtime may differ from the version used during generation.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
google-api-core[grpc]<3.0.0,>=2.17.1
|
|
2
|
-
google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
3
|
-
grpcio<2.0.0,>=1.59.0
|
|
4
|
-
proto-plus<2.0.0,>=1.22.3
|
|
5
|
-
protobuf<8.0.0,>=4.25.8
|
|
6
|
-
|
|
7
|
-
[:python_version >= "3.13"]
|
|
8
|
-
proto-plus<2.0.0,>=1.25.0
|
|
9
|
-
|
|
10
|
-
[:python_version >= "3.14"]
|
|
11
|
-
grpcio<2.0.0,>=1.75.1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
{google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/google/cloud/modelarmor_v1/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_cloud_modelarmor-0.7.0 → google_cloud_modelarmor-0.7.1}/tests/unit/gapic/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|