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

Grounding information for a segment of the text.

Generated from protobuf message `google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Segment`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ AssistantGroundedContent \\ TextGroundingMetadata

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ start_index` | `int|string` Zero-based index indicating the start of the segment, measured in bytes of a UTF-8 string (i.e. characters encoded on multiple bytes have a length of more than one). |
| `↳ end_index` | `int|string` End of the segment, exclusive. |
| `↳ reference_indices` | `int[]` References for the segment. |
| `↳ grounding_score` | `float` Score for the segment. |
| `↳ text` | `string` The text segment itself. |

### getStartIndex

Zero-based index indicating the start of the segment, measured in bytes
of a UTF-8 string (i.e. characters encoded on multiple bytes have a
length of more than one).

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

### setStartIndex

Zero-based index indicating the start of the segment, measured in bytes
of a UTF-8 string (i.e. characters encoded on multiple bytes have a
length of more than one).

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

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

### getEndIndex

End of the segment, exclusive.

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

### setEndIndex

End of the segment, exclusive.

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

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

### getReferenceIndices

References for the segment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setReferenceIndices

References for the segment.

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

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

### getGroundingScore

Score for the segment.

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

### setGroundingScore

Score for the segment.

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

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

### getText

The text segment itself.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setText

The text segment itself.

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

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