Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class SafetySpec.
Safety specification.
There are two use cases:
- when only safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold will be applied for all categories.
- when safety_spec.enable is set and some safety_settings are set, only specified safety_settings are applied.
Generated from protobuf message google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec
Namespace
Google \ Cloud \ DiscoveryEngine \ V1 \ AnswerQueryRequestMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ enable |
bool
Enable the safety filtering on the answer response. It is false by default. |
↳ safety_settings |
array<SafetySpec\SafetySetting>
Optional. Safety settings. This settings are effective only when the safety_spec.enable is true. |
getEnable
Enable the safety filtering on the answer response. It is false by default.
Returns | |
---|---|
Type | Description |
bool |
setEnable
Enable the safety filtering on the answer response. It is false by default.
Parameter | |
---|---|
Name | Description |
var |
bool
|
Returns | |
---|---|
Type | Description |
$this |
getSafetySettings
Optional. Safety settings.
This settings are effective only when the safety_spec.enable is true.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setSafetySettings
Optional. Safety settings.
This settings are effective only when the safety_spec.enable is true.
Parameter | |
---|---|
Name | Description |
var |
array<SafetySpec\SafetySetting>
|
Returns | |
---|---|
Type | Description |
$this |