You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description='Example of a Guardrail for Medical Use Cases',
98
-
topicPolicyConfig={
99
-
'topicsConfig': [{
100
-
'name': 'Block Pharmaceuticals',
101
-
'definition': 'This model cannot recommend one pharmaceutical over another. Generic prescriptions consistent with medical expertise and clinical diagnoses only.',
102
-
'type': 'DENY',
103
-
'inputAction': 'BLOCK',
104
-
'outputAction': 'BLOCK',
105
-
}]
106
-
},
107
-
sensitiveInformationPolicyConfig={
108
-
'piiEntitiesConfig': [
109
-
{
110
-
'type': 'UK_NATIONAL_HEALTH_SERVICE_NUMBER',
111
-
'action': 'BLOCK',
112
-
'inputAction': 'BLOCK',
113
-
'outputAction': 'BLOCK'
114
-
},
115
-
]
116
-
},
117
-
contextualGroundingPolicyConfig={
118
-
'filtersConfig': [
119
-
{
120
-
'type': 'RELEVANCE',
121
-
'threshold': 0.9,
122
-
'action': 'BLOCK',
123
-
'enabled': True
124
-
},
125
-
]
126
-
},
127
-
blockedInputMessaging="ExampleMedicalGuardrail has blocked this input.",
128
-
blockedOutputsMessaging="ExampleMedicalGuardrail has blocked this output."
129
-
)
130
-
guardrail_id=guardrail['guardrailId']
131
-
guardrail_version=guardrail['version']
132
-
133
-
print(f"Created new guardrail '{guardrail_id}:{guardrail_version}'")
description='Example of a Guardrail for Medical Use Cases',
99
+
topicPolicyConfig={
100
+
'topicsConfig': [{
101
+
'name': 'Block Pharmaceuticals',
102
+
'definition': 'This model cannot recommend one pharmaceutical over another. Generic prescriptions consistent with medical expertise and clinical diagnoses only.',
103
+
'type': 'DENY',
104
+
'inputAction': 'BLOCK',
105
+
'outputAction': 'BLOCK',
106
+
}]
107
+
},
108
+
sensitiveInformationPolicyConfig={
109
+
'piiEntitiesConfig': [
110
+
{
111
+
'type': 'UK_NATIONAL_HEALTH_SERVICE_NUMBER',
112
+
'action': 'BLOCK',
113
+
'inputAction': 'BLOCK',
114
+
'outputAction': 'BLOCK'
115
+
},
116
+
]
117
+
},
118
+
contextualGroundingPolicyConfig={
119
+
'filtersConfig': [
120
+
{
121
+
'type': 'RELEVANCE',
122
+
'threshold': 0.9,
123
+
'action': 'BLOCK',
124
+
'enabled': True
125
+
},
126
+
]
127
+
},
128
+
blockedInputMessaging="ExampleMedicalGuardrail has blocked this input.",
129
+
blockedOutputsMessaging="ExampleMedicalGuardrail has blocked this output."
130
+
)
131
+
guardrail_id=guardrail['guardrailId']
132
+
guardrail_version=guardrail['version']
133
+
134
+
print(f"Created new guardrail '{guardrail_id}:{guardrail_version}'")
0 commit comments