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

Top-level message sent by the client for the `GenerateGroundedContent`
method.

Generated from protobuf message `google.cloud.discoveryengine.v1.GenerateGroundedContentRequest`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ location` | `string` Required. Location resource. Format: `projects/{project}/locations/{location}`. |
| `↳ system_instruction` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GroundedGenerationContent` Content of the system instruction for the current API. These instructions will take priority over any other prompt instructions if the selected model is supporting them. |
| `↳ contents` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GroundedGenerationContent>` Content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request. |
| `↳ generation_spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GenerateGroundedContentRequest.GenerationSpec` Content generation specification. |
| `↳ grounding_spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GenerateGroundedContentRequest.GroundingSpec` Grounding specification. |
| `↳ user_labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` The user labels applied to a resource must meet the following requirements: \* \* Each resource can have multiple labels, up to a maximum of 64. \* \* Each label must be a key-value pair. \* \* Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. \* \* Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. \* \* The key portion of a label must be unique. However, you can use the same key with multiple resources. \* \* Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details. |

### getLocation

Required. Location resource.

Format: `projects/{project}/locations/{location}`.

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

### setLocation

Required. Location resource.

Format: `projects/{project}/locations/{location}`.

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

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

### getSystemInstruction

Content of the system instruction for the current API.

These instructions will take priority over any other prompt instructions
if the selected model is supporting them.

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

### hasSystemInstruction

### clearSystemInstruction

### setSystemInstruction

Content of the system instruction for the current API.

These instructions will take priority over any other prompt instructions
if the selected model is supporting them.

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

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

### getContents

Content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries,
this is a repeated field that contains conversation history + latest
request.

| **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.GroundedGenerationContent>` |   |

### setContents

Content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries,
this is a repeated field that contains conversation history + latest
request.

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

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

### getGenerationSpec

Content generation specification.

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

### hasGenerationSpec

### clearGenerationSpec

### setGenerationSpec

Content generation specification.

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

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

### getGroundingSpec

Grounding specification.

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

### hasGroundingSpec

### clearGroundingSpec

### setGroundingSpec

Grounding specification.

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

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

### getUserLabels

The user labels applied to a resource must meet the following requirements:

- Each resource can have multiple labels, up to a maximum of 64.

- Each label must be a key-value pair.

- Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
- The key portion of a label must be unique. However, you can use the same key with multiple resources.
- Keys must start with a lowercase letter or international character. See [Google Cloud
  Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setUserLabels

The user labels applied to a resource must meet the following requirements:

- Each resource can have multiple labels, up to a maximum of 64.

- Each label must be a key-value pair.

- Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
- The key portion of a label must be unique. However, you can use the same key with multiple resources.
- Keys must start with a lowercase letter or international character. See [Google Cloud
  Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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