# Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec (v2.8.0)

2.8.0 (latest) 2.7.0 2.6.2 2.5.0 2.4.0 2.3.1 2.2.0 2.1.1 2.0.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.2 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.2 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec.

Safety specification.
There are two use cases:

1. when only safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold will be applied for all categories.
2. when safety_spec.enable is set and some safety_settings are set, only specified safety_settings are applied.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #enable

    def enable() -> ::Boolean

**Returns**

- (::Boolean) --- Enable the safety filtering on the answer response. It is false by default.

### #enable=

    def enable=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Enable the safety filtering on the answer response. It is false by default.
**Returns**

- (::Boolean) --- Enable the safety filtering on the answer response. It is false by default.

### #safety_settings

    def safety_settings() -> ::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting>

**Returns**

- (::Array\<[::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest-SafetySpec-SafetySetting)\>) --- Optional. Safety settings. This settings are effective only when the safety_spec.enable is true.

### #safety_settings=

    def safety_settings=(value) -> ::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting>

**Parameter**

- **value** (::Array\<[::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest-SafetySpec-SafetySetting)\>) --- Optional. Safety settings. This settings are effective only when the safety_spec.enable is true.
**Returns**

- (::Array\<[::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest-SafetySpec-SafetySetting)\>) --- Optional. Safety settings. This settings are effective only when the safety_spec.enable is true.