# Google Cloud Discovery Engine V1 Client - Class SafetySpec (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class 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.

Generated from protobuf message `google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ AnswerQueryRequest

## Methods

### __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<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AnswerQueryRequest.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** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AnswerQueryRequest.SafetySpec.SafetySetting>` |   |

### setSafetySettings

Optional. Safety settings.

This settings are effective only when the safety_spec.enable is true.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AnswerQueryRequest.SafetySpec.SafetySetting>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |