Skip to content

Commit 4c7728b

Browse files
committed
addressed review comments
1 parent 42638fd commit 4c7728b

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

model_armor/create_template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def create_model_armor_template(project_id: str, location: str, template_id: str
5555

5656
# Make the request
5757
response = client.create_template(request=request)
58-
5958
# Response
60-
return response
61-
59+
print(response.name)
6260

6361
# [END modelarmor_create_template]
62+
63+
return response

model_armor/get_template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def get_model_armor_template(project_id: str, location: str, template_id: str) -
3838

3939
# Make the request
4040
response = client.get_template(request=request)
41+
print(response.name)
42+
43+
# [END modelarmor_get_template]
4144

4245
# Handle the response
4346
return response
44-
45-
46-
# [END modelarmor_get_template]

model_armor/list_templates.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def list_model_armor_templates(project_id: str, location: str) -> ListTemplatesP
3939
for template in response:
4040
print(template.name)
4141

42+
# [END modelarmor_list_templates]
43+
4244
# Handle the response
4345
return response
44-
45-
46-
# [END modelarmor_list_templates]

model_armor/sanitize_user_prompt.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ def sanitize_user_prompt(
5050
# Match state is TRUE when the prompt is caught by one of the safety policies in the template.
5151
print(response.sanitization_result.filter_match_state)
5252

53+
# [END modelarmor_sanitize_user_prompt]
54+
5355
# Handle the response
5456
return response
55-
56-
57-
# [END modelarmor_sanitize_user_prompt]

model_armor/update_template.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ def update_model_armor_template(project_id: str, location: str, template_id: str
5151

5252
# Make the request
5353
response = client.update_template(request=request)
54+
# Print the updated config
55+
print(response.filter_config)
56+
57+
# [END modelarmor_update_template]
5458

5559
# Response
5660
return response
57-
58-
59-
# [END modelarmor_update_template]

0 commit comments

Comments
 (0)