google-cloud-modelarmor 0.5.0__tar.gz → 0.7.0__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.5.0 → google_cloud_modelarmor-0.7.0}/MANIFEST.in +1 -1
- {google_cloud_modelarmor-0.5.0/google_cloud_modelarmor.egg-info → google_cloud_modelarmor-0.7.0}/PKG-INFO +20 -18
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/README.rst +15 -12
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor/__init__.py +3 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor/gapic_version.py +2 -2
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/__init__.py +6 -21
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/gapic_metadata.json +30 -0
- {google_cloud_modelarmor-0.5.0/google/cloud/modelarmor_v1beta → google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1}/gapic_version.py +2 -2
- {google_cloud_modelarmor-0.5.0/google/cloud/modelarmor_v1beta → google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1}/services/__init__.py +1 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/__init__.py +1 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/async_client.py +178 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/client.py +177 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/pagers.py +1 -1
- {google_cloud_modelarmor-0.5.0/google/cloud/modelarmor_v1beta → google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1}/services/model_armor/transports/__init__.py +1 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/transports/base.py +35 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/transports/grpc.py +61 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/transports/grpc_asyncio.py +73 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/transports/rest.py +62 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/services/model_armor/transports/rest_base.py +9 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/types/__init__.py +3 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/types/service.py +51 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/__init__.py +8 -21
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/gapic_metadata.json +30 -0
- {google_cloud_modelarmor-0.5.0/google/cloud/modelarmor_v1 → google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1beta}/gapic_version.py +2 -2
- {google_cloud_modelarmor-0.5.0/tests → google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1beta/services}/__init__.py +1 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/__init__.py +1 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/async_client.py +178 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/client.py +177 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/pagers.py +1 -1
- {google_cloud_modelarmor-0.5.0/google/cloud/modelarmor_v1 → google_cloud_modelarmor-0.7.0/google/cloud/modelarmor_v1beta}/services/model_armor/transports/__init__.py +1 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/transports/base.py +35 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/transports/grpc.py +61 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/transports/grpc_asyncio.py +73 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/transports/rest.py +62 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/services/model_armor/transports/rest_base.py +9 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/types/__init__.py +5 -1
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/types/service.py +141 -8
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0/google_cloud_modelarmor.egg-info}/PKG-INFO +20 -18
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google_cloud_modelarmor.egg-info/requires.txt +2 -2
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/setup.py +5 -6
- {google_cloud_modelarmor-0.5.0/tests/unit → google_cloud_modelarmor-0.7.0/tests}/__init__.py +1 -1
- {google_cloud_modelarmor-0.5.0/google/cloud/modelarmor_v1/services → google_cloud_modelarmor-0.7.0/tests/unit}/__init__.py +1 -1
- google_cloud_modelarmor-0.7.0/tests/unit/gapic/__init__.py +15 -0
- google_cloud_modelarmor-0.7.0/tests/unit/gapic/modelarmor_v1/__init__.py +15 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/tests/unit/gapic/modelarmor_v1/test_model_armor.py +560 -162
- google_cloud_modelarmor-0.7.0/tests/unit/gapic/modelarmor_v1beta/__init__.py +15 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/tests/unit/gapic/modelarmor_v1beta/test_model_armor.py +566 -162
- google_cloud_modelarmor-0.5.0/tests/unit/gapic/__init__.py +0 -15
- google_cloud_modelarmor-0.5.0/tests/unit/gapic/modelarmor_v1/__init__.py +0 -15
- google_cloud_modelarmor-0.5.0/tests/unit/gapic/modelarmor_v1beta/__init__.py +0 -15
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/LICENSE +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor/py.typed +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1/py.typed +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor_v1beta/py.typed +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google_cloud_modelarmor.egg-info/SOURCES.txt +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google_cloud_modelarmor.egg-info/dependency_links.txt +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google_cloud_modelarmor.egg-info/not-zip-safe +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google_cloud_modelarmor.egg-info/top_level.txt +0 -0
- {google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/setup.cfg +0 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-modelarmor
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
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
|
|
7
7
|
Author-email: googleapis-packages@google.com
|
|
8
|
-
License: Apache
|
|
8
|
+
License: Apache-2.0
|
|
9
9
|
Platform: Posix; MacOS X; Windows
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -20,11 +19,11 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
21
20
|
Classifier: Operating System :: OS Independent
|
|
22
21
|
Classifier: Topic :: Internet
|
|
23
|
-
Requires-Python: >=3.
|
|
22
|
+
Requires-Python: >=3.10
|
|
24
23
|
License-File: LICENSE
|
|
25
|
-
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.
|
|
24
|
+
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.17.1
|
|
26
25
|
Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
27
|
-
Requires-Dist: grpcio<2.0.0,>=1.
|
|
26
|
+
Requires-Dist: grpcio<2.0.0,>=1.59.0
|
|
28
27
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
|
|
29
28
|
Requires-Dist: proto-plus<2.0.0,>=1.22.3
|
|
30
29
|
Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
|
|
@@ -41,12 +40,14 @@ Dynamic: requires-dist
|
|
|
41
40
|
Dynamic: requires-python
|
|
42
41
|
Dynamic: summary
|
|
43
42
|
|
|
44
|
-
Python Client for Model Armor
|
|
45
|
-
|
|
43
|
+
Python Client for Model Armor
|
|
44
|
+
=============================
|
|
46
45
|
|
|
47
46
|
|preview| |pypi| |versions|
|
|
48
47
|
|
|
49
|
-
`Model Armor
|
|
48
|
+
`Model Armor`_: Model Armor helps you protect against risks like prompt injection, harmful
|
|
49
|
+
content, and data leakage in generative AI applications by letting you
|
|
50
|
+
define policies that filter user prompts and model responses.
|
|
50
51
|
|
|
51
52
|
- `Client Library Documentation`_
|
|
52
53
|
- `Product Documentation`_
|
|
@@ -57,9 +58,9 @@ Python Client for Model Armor API
|
|
|
57
58
|
:target: https://pypi.org/project/google-cloud-modelarmor/
|
|
58
59
|
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-modelarmor.svg
|
|
59
60
|
:target: https://pypi.org/project/google-cloud-modelarmor/
|
|
60
|
-
.. _Model Armor
|
|
61
|
+
.. _Model Armor: https://cloud.google.com/security-command-center/
|
|
61
62
|
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/google-cloud-modelarmor/latest/summary_overview
|
|
62
|
-
.. _Product Documentation: https://cloud.google.com/security-command-center/
|
|
63
|
+
.. _Product Documentation: https://cloud.google.com/security-command-center/
|
|
63
64
|
|
|
64
65
|
Quick Start
|
|
65
66
|
-----------
|
|
@@ -68,12 +69,12 @@ In order to use this library, you first need to go through the following steps:
|
|
|
68
69
|
|
|
69
70
|
1. `Select or create a Cloud Platform project.`_
|
|
70
71
|
2. `Enable billing for your project.`_
|
|
71
|
-
3. `Enable the Model Armor
|
|
72
|
+
3. `Enable the Model Armor.`_
|
|
72
73
|
4. `Set up Authentication.`_
|
|
73
74
|
|
|
74
75
|
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
|
|
75
76
|
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
|
|
76
|
-
.. _Enable the Model Armor
|
|
77
|
+
.. _Enable the Model Armor.: https://cloud.google.com/security-command-center/
|
|
77
78
|
.. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
|
|
78
79
|
|
|
79
80
|
Installation
|
|
@@ -104,14 +105,15 @@ Supported Python Versions
|
|
|
104
105
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
105
106
|
Python.
|
|
106
107
|
|
|
107
|
-
Python >= 3.
|
|
108
|
+
Python >= 3.10, including 3.14
|
|
108
109
|
|
|
109
110
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
110
111
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
111
112
|
|
|
112
113
|
Unsupported Python Versions
|
|
113
114
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
114
|
-
Python <= 3.
|
|
115
|
+
Python <= 3.9
|
|
116
|
+
|
|
115
117
|
|
|
116
118
|
If you are using an `end-of-life`_
|
|
117
119
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
|
@@ -140,14 +142,14 @@ Windows
|
|
|
140
142
|
Next Steps
|
|
141
143
|
~~~~~~~~~~
|
|
142
144
|
|
|
143
|
-
- Read the `Client Library Documentation`_ for Model Armor
|
|
145
|
+
- Read the `Client Library Documentation`_ for Model Armor
|
|
144
146
|
to see other available methods on the client.
|
|
145
|
-
- Read the `Model Armor
|
|
147
|
+
- Read the `Model Armor Product documentation`_ to learn
|
|
146
148
|
more about the product and see How-to Guides.
|
|
147
149
|
- View this `README`_ to see the full list of Cloud
|
|
148
150
|
APIs that we cover.
|
|
149
151
|
|
|
150
|
-
.. _Model Armor
|
|
152
|
+
.. _Model Armor Product documentation: https://cloud.google.com/security-command-center/
|
|
151
153
|
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
|
|
152
154
|
|
|
153
155
|
Logging
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
Python Client for Model Armor
|
|
2
|
-
|
|
1
|
+
Python Client for Model Armor
|
|
2
|
+
=============================
|
|
3
3
|
|
|
4
4
|
|preview| |pypi| |versions|
|
|
5
5
|
|
|
6
|
-
`Model Armor
|
|
6
|
+
`Model Armor`_: Model Armor helps you protect against risks like prompt injection, harmful
|
|
7
|
+
content, and data leakage in generative AI applications by letting you
|
|
8
|
+
define policies that filter user prompts and model responses.
|
|
7
9
|
|
|
8
10
|
- `Client Library Documentation`_
|
|
9
11
|
- `Product Documentation`_
|
|
@@ -14,9 +16,9 @@ Python Client for Model Armor API
|
|
|
14
16
|
:target: https://pypi.org/project/google-cloud-modelarmor/
|
|
15
17
|
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-modelarmor.svg
|
|
16
18
|
:target: https://pypi.org/project/google-cloud-modelarmor/
|
|
17
|
-
.. _Model Armor
|
|
19
|
+
.. _Model Armor: https://cloud.google.com/security-command-center/
|
|
18
20
|
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/google-cloud-modelarmor/latest/summary_overview
|
|
19
|
-
.. _Product Documentation: https://cloud.google.com/security-command-center/
|
|
21
|
+
.. _Product Documentation: https://cloud.google.com/security-command-center/
|
|
20
22
|
|
|
21
23
|
Quick Start
|
|
22
24
|
-----------
|
|
@@ -25,12 +27,12 @@ In order to use this library, you first need to go through the following steps:
|
|
|
25
27
|
|
|
26
28
|
1. `Select or create a Cloud Platform project.`_
|
|
27
29
|
2. `Enable billing for your project.`_
|
|
28
|
-
3. `Enable the Model Armor
|
|
30
|
+
3. `Enable the Model Armor.`_
|
|
29
31
|
4. `Set up Authentication.`_
|
|
30
32
|
|
|
31
33
|
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
|
|
32
34
|
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
|
|
33
|
-
.. _Enable the Model Armor
|
|
35
|
+
.. _Enable the Model Armor.: https://cloud.google.com/security-command-center/
|
|
34
36
|
.. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
|
|
35
37
|
|
|
36
38
|
Installation
|
|
@@ -61,14 +63,15 @@ Supported Python Versions
|
|
|
61
63
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
62
64
|
Python.
|
|
63
65
|
|
|
64
|
-
Python >= 3.
|
|
66
|
+
Python >= 3.10, including 3.14
|
|
65
67
|
|
|
66
68
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
67
69
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
68
70
|
|
|
69
71
|
Unsupported Python Versions
|
|
70
72
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
71
|
-
Python <= 3.
|
|
73
|
+
Python <= 3.9
|
|
74
|
+
|
|
72
75
|
|
|
73
76
|
If you are using an `end-of-life`_
|
|
74
77
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
|
@@ -97,14 +100,14 @@ Windows
|
|
|
97
100
|
Next Steps
|
|
98
101
|
~~~~~~~~~~
|
|
99
102
|
|
|
100
|
-
- Read the `Client Library Documentation`_ for Model Armor
|
|
103
|
+
- Read the `Client Library Documentation`_ for Model Armor
|
|
101
104
|
to see other available methods on the client.
|
|
102
|
-
- Read the `Model Armor
|
|
105
|
+
- Read the `Model Armor Product documentation`_ to learn
|
|
103
106
|
more about the product and see How-to Guides.
|
|
104
107
|
- View this `README`_ to see the full list of Cloud
|
|
105
108
|
APIs that we cover.
|
|
106
109
|
|
|
107
|
-
.. _Model Armor
|
|
110
|
+
.. _Model Armor Product documentation: https://cloud.google.com/security-command-center/
|
|
108
111
|
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
|
|
109
112
|
|
|
110
113
|
Logging
|
{google_cloud_modelarmor-0.5.0 → google_cloud_modelarmor-0.7.0}/google/cloud/modelarmor/__init__.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -63,6 +63,7 @@ from google.cloud.modelarmor_v1.types.service import (
|
|
|
63
63
|
SdpFinding,
|
|
64
64
|
SdpFindingLikelihood,
|
|
65
65
|
SdpInspectResult,
|
|
66
|
+
StreamingMode,
|
|
66
67
|
Template,
|
|
67
68
|
UpdateFloorSettingRequest,
|
|
68
69
|
UpdateTemplateRequest,
|
|
@@ -118,4 +119,5 @@ __all__ = (
|
|
|
118
119
|
"InvocationResult",
|
|
119
120
|
"RaiFilterType",
|
|
120
121
|
"SdpFindingLikelihood",
|
|
122
|
+
"StreamingMode",
|
|
121
123
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
|
-
__version__ = "0.
|
|
16
|
+
__version__ = "0.7.0" # {x-release-please-version}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -21,13 +21,7 @@ from google.cloud.modelarmor_v1 import gapic_version as package_version
|
|
|
21
21
|
|
|
22
22
|
__version__ = package_version.__version__
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
from importlib import metadata
|
|
26
|
-
else: # pragma: NO COVER
|
|
27
|
-
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
|
|
28
|
-
# this code path once we drop support for Python 3.7
|
|
29
|
-
import importlib_metadata as metadata
|
|
30
|
-
|
|
24
|
+
from importlib import metadata
|
|
31
25
|
|
|
32
26
|
from .services.model_armor import ModelArmorAsyncClient, ModelArmorClient
|
|
33
27
|
from .types.service import (
|
|
@@ -71,6 +65,7 @@ from .types.service import (
|
|
|
71
65
|
SdpFinding,
|
|
72
66
|
SdpFindingLikelihood,
|
|
73
67
|
SdpInspectResult,
|
|
68
|
+
StreamingMode,
|
|
74
69
|
Template,
|
|
75
70
|
UpdateFloorSettingRequest,
|
|
76
71
|
UpdateTemplateRequest,
|
|
@@ -87,28 +82,17 @@ else: # pragma: NO COVER
|
|
|
87
82
|
# An older version of api_core is installed which does not define the
|
|
88
83
|
# functions above. We do equivalent checks manually.
|
|
89
84
|
try:
|
|
90
|
-
import sys
|
|
91
85
|
import warnings
|
|
92
86
|
|
|
93
87
|
_py_version_str = sys.version.split()[0]
|
|
94
88
|
_package_label = "google.cloud.modelarmor_v1"
|
|
95
|
-
if sys.version_info < (3,
|
|
89
|
+
if sys.version_info < (3, 10):
|
|
96
90
|
warnings.warn(
|
|
97
91
|
"You are using a non-supported Python version "
|
|
98
92
|
+ f"({_py_version_str}). Google will not post any further "
|
|
99
93
|
+ f"updates to {_package_label} supporting this Python version. "
|
|
100
94
|
+ "Please upgrade to the latest Python version, or at "
|
|
101
|
-
+ f"least to Python 3.
|
|
102
|
-
FutureWarning,
|
|
103
|
-
)
|
|
104
|
-
if sys.version_info[:2] == (3, 9):
|
|
105
|
-
warnings.warn(
|
|
106
|
-
f"You are using a Python version ({_py_version_str}) "
|
|
107
|
-
+ f"which Google will stop supporting in {_package_label} in "
|
|
108
|
-
+ "January 2026. Please "
|
|
109
|
-
+ "upgrade to the latest Python version, or at "
|
|
110
|
-
+ "least to Python 3.10, before then, and "
|
|
111
|
-
+ f"then update {_package_label}.",
|
|
95
|
+
+ f"least to Python 3.10, and then update {_package_label}.",
|
|
112
96
|
FutureWarning,
|
|
113
97
|
)
|
|
114
98
|
|
|
@@ -215,6 +199,7 @@ __all__ = (
|
|
|
215
199
|
"SdpFinding",
|
|
216
200
|
"SdpFindingLikelihood",
|
|
217
201
|
"SdpInspectResult",
|
|
202
|
+
"StreamingMode",
|
|
218
203
|
"Template",
|
|
219
204
|
"UpdateFloorSettingRequest",
|
|
220
205
|
"UpdateTemplateRequest",
|
|
@@ -45,6 +45,16 @@
|
|
|
45
45
|
"sanitize_user_prompt"
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
|
+
"StreamSanitizeModelResponse": {
|
|
49
|
+
"methods": [
|
|
50
|
+
"stream_sanitize_model_response"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"StreamSanitizeUserPrompt": {
|
|
54
|
+
"methods": [
|
|
55
|
+
"stream_sanitize_user_prompt"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
48
58
|
"UpdateFloorSetting": {
|
|
49
59
|
"methods": [
|
|
50
60
|
"update_floor_setting"
|
|
@@ -95,6 +105,16 @@
|
|
|
95
105
|
"sanitize_user_prompt"
|
|
96
106
|
]
|
|
97
107
|
},
|
|
108
|
+
"StreamSanitizeModelResponse": {
|
|
109
|
+
"methods": [
|
|
110
|
+
"stream_sanitize_model_response"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"StreamSanitizeUserPrompt": {
|
|
114
|
+
"methods": [
|
|
115
|
+
"stream_sanitize_user_prompt"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
98
118
|
"UpdateFloorSetting": {
|
|
99
119
|
"methods": [
|
|
100
120
|
"update_floor_setting"
|
|
@@ -145,6 +165,16 @@
|
|
|
145
165
|
"sanitize_user_prompt"
|
|
146
166
|
]
|
|
147
167
|
},
|
|
168
|
+
"StreamSanitizeModelResponse": {
|
|
169
|
+
"methods": [
|
|
170
|
+
"stream_sanitize_model_response"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
"StreamSanitizeUserPrompt": {
|
|
174
|
+
"methods": [
|
|
175
|
+
"stream_sanitize_user_prompt"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
148
178
|
"UpdateFloorSetting": {
|
|
149
179
|
"methods": [
|
|
150
180
|
"update_floor_setting"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
|
-
__version__ = "0.
|
|
16
|
+
__version__ = "0.7.0" # {x-release-please-version}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -17,6 +17,9 @@ import logging as std_logging
|
|
|
17
17
|
import re
|
|
18
18
|
from collections import OrderedDict
|
|
19
19
|
from typing import (
|
|
20
|
+
AsyncIterable,
|
|
21
|
+
AsyncIterator,
|
|
22
|
+
Awaitable,
|
|
20
23
|
Callable,
|
|
21
24
|
Dict,
|
|
22
25
|
Mapping,
|
|
@@ -1280,6 +1283,180 @@ class ModelArmorAsyncClient:
|
|
|
1280
1283
|
# Done; return the response.
|
|
1281
1284
|
return response
|
|
1282
1285
|
|
|
1286
|
+
def stream_sanitize_user_prompt(
|
|
1287
|
+
self,
|
|
1288
|
+
requests: Optional[AsyncIterator[service.SanitizeUserPromptRequest]] = None,
|
|
1289
|
+
*,
|
|
1290
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1291
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1292
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1293
|
+
) -> Awaitable[AsyncIterable[service.SanitizeUserPromptResponse]]:
|
|
1294
|
+
r"""Streaming version of Sanitize User Prompt.
|
|
1295
|
+
|
|
1296
|
+
.. code-block:: python
|
|
1297
|
+
|
|
1298
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
1299
|
+
# code template only.
|
|
1300
|
+
# It will require modifications to work:
|
|
1301
|
+
# - It may require correct/in-range values for request initialization.
|
|
1302
|
+
# - It may require specifying regional endpoints when creating the service
|
|
1303
|
+
# client as shown in:
|
|
1304
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
1305
|
+
from google.cloud import modelarmor_v1
|
|
1306
|
+
|
|
1307
|
+
async def sample_stream_sanitize_user_prompt():
|
|
1308
|
+
# Create a client
|
|
1309
|
+
client = modelarmor_v1.ModelArmorAsyncClient()
|
|
1310
|
+
|
|
1311
|
+
# Initialize request argument(s)
|
|
1312
|
+
user_prompt_data = modelarmor_v1.DataItem()
|
|
1313
|
+
user_prompt_data.text = "text_value"
|
|
1314
|
+
|
|
1315
|
+
request = modelarmor_v1.SanitizeUserPromptRequest(
|
|
1316
|
+
name="name_value",
|
|
1317
|
+
user_prompt_data=user_prompt_data,
|
|
1318
|
+
)
|
|
1319
|
+
|
|
1320
|
+
# This method expects an iterator which contains
|
|
1321
|
+
# 'modelarmor_v1.SanitizeUserPromptRequest' objects
|
|
1322
|
+
# Here we create a generator that yields a single `request` for
|
|
1323
|
+
# demonstrative purposes.
|
|
1324
|
+
requests = [request]
|
|
1325
|
+
|
|
1326
|
+
def request_generator():
|
|
1327
|
+
for request in requests:
|
|
1328
|
+
yield request
|
|
1329
|
+
|
|
1330
|
+
# Make the request
|
|
1331
|
+
stream = await client.stream_sanitize_user_prompt(requests=request_generator())
|
|
1332
|
+
|
|
1333
|
+
# Handle the response
|
|
1334
|
+
async for response in stream:
|
|
1335
|
+
print(response)
|
|
1336
|
+
|
|
1337
|
+
Args:
|
|
1338
|
+
requests (AsyncIterator[`google.cloud.modelarmor_v1.types.SanitizeUserPromptRequest`]):
|
|
1339
|
+
The request object AsyncIterator. Sanitize User Prompt request.
|
|
1340
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1341
|
+
should be retried.
|
|
1342
|
+
timeout (float): The timeout for this request.
|
|
1343
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1344
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1345
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1346
|
+
be of type `bytes`.
|
|
1347
|
+
|
|
1348
|
+
Returns:
|
|
1349
|
+
AsyncIterable[google.cloud.modelarmor_v1.types.SanitizeUserPromptResponse]:
|
|
1350
|
+
Sanitized User Prompt Response.
|
|
1351
|
+
"""
|
|
1352
|
+
|
|
1353
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1354
|
+
# and friendly error handling.
|
|
1355
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1356
|
+
self._client._transport.stream_sanitize_user_prompt
|
|
1357
|
+
]
|
|
1358
|
+
|
|
1359
|
+
# Validate the universe domain.
|
|
1360
|
+
self._client._validate_universe_domain()
|
|
1361
|
+
|
|
1362
|
+
# Send the request.
|
|
1363
|
+
response = rpc(
|
|
1364
|
+
requests,
|
|
1365
|
+
retry=retry,
|
|
1366
|
+
timeout=timeout,
|
|
1367
|
+
metadata=metadata,
|
|
1368
|
+
)
|
|
1369
|
+
|
|
1370
|
+
# Done; return the response.
|
|
1371
|
+
return response
|
|
1372
|
+
|
|
1373
|
+
def stream_sanitize_model_response(
|
|
1374
|
+
self,
|
|
1375
|
+
requests: Optional[AsyncIterator[service.SanitizeModelResponseRequest]] = None,
|
|
1376
|
+
*,
|
|
1377
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1378
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1379
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1380
|
+
) -> Awaitable[AsyncIterable[service.SanitizeModelResponseResponse]]:
|
|
1381
|
+
r"""Streaming version of Sanitizes Model Response.
|
|
1382
|
+
|
|
1383
|
+
.. code-block:: python
|
|
1384
|
+
|
|
1385
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
1386
|
+
# code template only.
|
|
1387
|
+
# It will require modifications to work:
|
|
1388
|
+
# - It may require correct/in-range values for request initialization.
|
|
1389
|
+
# - It may require specifying regional endpoints when creating the service
|
|
1390
|
+
# client as shown in:
|
|
1391
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
1392
|
+
from google.cloud import modelarmor_v1
|
|
1393
|
+
|
|
1394
|
+
async def sample_stream_sanitize_model_response():
|
|
1395
|
+
# Create a client
|
|
1396
|
+
client = modelarmor_v1.ModelArmorAsyncClient()
|
|
1397
|
+
|
|
1398
|
+
# Initialize request argument(s)
|
|
1399
|
+
model_response_data = modelarmor_v1.DataItem()
|
|
1400
|
+
model_response_data.text = "text_value"
|
|
1401
|
+
|
|
1402
|
+
request = modelarmor_v1.SanitizeModelResponseRequest(
|
|
1403
|
+
name="name_value",
|
|
1404
|
+
model_response_data=model_response_data,
|
|
1405
|
+
)
|
|
1406
|
+
|
|
1407
|
+
# This method expects an iterator which contains
|
|
1408
|
+
# 'modelarmor_v1.SanitizeModelResponseRequest' objects
|
|
1409
|
+
# Here we create a generator that yields a single `request` for
|
|
1410
|
+
# demonstrative purposes.
|
|
1411
|
+
requests = [request]
|
|
1412
|
+
|
|
1413
|
+
def request_generator():
|
|
1414
|
+
for request in requests:
|
|
1415
|
+
yield request
|
|
1416
|
+
|
|
1417
|
+
# Make the request
|
|
1418
|
+
stream = await client.stream_sanitize_model_response(requests=request_generator())
|
|
1419
|
+
|
|
1420
|
+
# Handle the response
|
|
1421
|
+
async for response in stream:
|
|
1422
|
+
print(response)
|
|
1423
|
+
|
|
1424
|
+
Args:
|
|
1425
|
+
requests (AsyncIterator[`google.cloud.modelarmor_v1.types.SanitizeModelResponseRequest`]):
|
|
1426
|
+
The request object AsyncIterator. Sanitize Model Response request.
|
|
1427
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1428
|
+
should be retried.
|
|
1429
|
+
timeout (float): The timeout for this request.
|
|
1430
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1431
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1432
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1433
|
+
be of type `bytes`.
|
|
1434
|
+
|
|
1435
|
+
Returns:
|
|
1436
|
+
AsyncIterable[google.cloud.modelarmor_v1.types.SanitizeModelResponseResponse]:
|
|
1437
|
+
Sanitized Model Response Response.
|
|
1438
|
+
"""
|
|
1439
|
+
|
|
1440
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1441
|
+
# and friendly error handling.
|
|
1442
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1443
|
+
self._client._transport.stream_sanitize_model_response
|
|
1444
|
+
]
|
|
1445
|
+
|
|
1446
|
+
# Validate the universe domain.
|
|
1447
|
+
self._client._validate_universe_domain()
|
|
1448
|
+
|
|
1449
|
+
# Send the request.
|
|
1450
|
+
response = rpc(
|
|
1451
|
+
requests,
|
|
1452
|
+
retry=retry,
|
|
1453
|
+
timeout=timeout,
|
|
1454
|
+
metadata=metadata,
|
|
1455
|
+
)
|
|
1456
|
+
|
|
1457
|
+
# Done; return the response.
|
|
1458
|
+
return response
|
|
1459
|
+
|
|
1283
1460
|
async def get_location(
|
|
1284
1461
|
self,
|
|
1285
1462
|
request: Optional[Union[locations_pb2.GetLocationRequest, dict]] = None,
|