# Google Cloud Discovery Engine V1 Client - Class Candidate (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 Candidate.

A response candidate generated from the model.

Generated from protobuf message `google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ GenerateGroundedContentResponse

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ index` | `int` Index of the candidate. |
| `↳ content` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GroundedGenerationContent` Content of the candidate. |
| `↳ grounding_score` | `float` The overall grounding score for the candidate, in the range of \[0, 1\]. |
| `↳ grounding_metadata` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GenerateGroundedContentResponse.Candidate.GroundingMetadata` Grounding metadata for the generated content. |

### getIndex

Index of the candidate.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setIndex

Index of the candidate.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

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

### getContent

Content of the candidate.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GroundedGenerationContent|null` |   |

### hasContent

### clearContent

### setContent

Content of the candidate.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GroundedGenerationContent` |

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

### getGroundingScore

The overall grounding score for the candidate, in the range of \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### hasGroundingScore

### clearGroundingScore

### setGroundingScore

The overall grounding score for the candidate, in the range of \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

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

### getGroundingMetadata

Grounding metadata for the generated content.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GenerateGroundedContentResponse.Candidate.GroundingMetadata|null` |   |

### hasGroundingMetadata

### clearGroundingMetadata

### setGroundingMetadata

Grounding metadata for the generated content.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GenerateGroundedContentResponse.Candidate.GroundingMetadata` |

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