# Google Cloud Dialogflow Cx V3 Client - Class Fulfillment (0.11.1)

0.11.1 (latest) 0.11.0 0.10.2 0.9.2 0.8.1 0.7.2 0.6.0 0.5.2 0.4.1 0.3.4 0.2.1 0.1.1 Reference documentation and code samples for the Google Cloud Dialogflow Cx V3 Client class Fulfillment.

A fulfillment can do one or more of the following actions at the same time:

- Generate rich message responses.

<!-- -->

- Set parameter values.
  - Call the webhook. Fulfillments can be called at various stages in the [Page](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Page) or [Form](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Form) lifecycle. For example, when a [DetectIntentRequest](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.DetectIntentRequest) drives a session to enter a new page, the page's entry fulfillment can add a static response to the [QueryResult](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.QueryResult) in the returning [DetectIntentResponse](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.DetectIntentResponse), call the webhook (for example, to load user data from a database), or both.

Generated from protobuf message `google.cloud.dialogflow.cx.v3.Fulfillment`

## Namespace

Google \\ Cloud \\ Dialogflow \\ Cx \\ V3

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ messages` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage>` The list of rich message responses to present to the user. |
| `↳ webhook` | `string` The webhook to call. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/webhooks/<WebhookID>`. |
| `↳ return_partial_responses` | `bool` Whether Dialogflow should return currently queued fulfillment response messages in streaming APIs. If a webhook is specified, it happens before Dialogflow invokes webhook. Warning: 1) This flag only affects streaming API. Responses are still queued and returned once in non-streaming API. 2) The flag can be enabled in any fulfillment but only the first 3 partial responses will be returned. You may only want to apply it to fulfillments that have slow webhooks. |
| `↳ tag` | `string` The value of this field will be populated in the [WebhookRequest](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.WebhookRequest) `fulfillmentInfo.tag` field by Dialogflow when the associated webhook is called. The tag is typically used by the webhook service to identify which fulfillment is being called, but it could be used for other purposes. This field is required if `webhook` is specified. |
| `↳ set_parameter_actions` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.SetParameterAction>` Set parameter values before executing the webhook. |
| `↳ conditional_cases` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.ConditionalCases>` Conditional cases for this fulfillment. |
| `↳ advanced_settings` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.AdvancedSettings` Hierarchical advanced settings for this fulfillment. The settings exposed at the lower level overrides the settings exposed at the higher level. |
| `↳ enable_generative_fallback` | `bool` If the flag is true, the agent will utilize LLM to generate a text response. If LLM generation fails, the defined [responses](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment#_Google_Cloud_Dialogflow_Cx_V3_Fulfillment__getMessages__) in the fulfillment will be respected. This flag is only useful for fulfillments associated with no-match event handlers. |
| `↳ generators` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.GeneratorSettings>` A list of Generators to be called during this fulfillment. |

### getMessages

The list of rich message responses to present to the user.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage>` |   |

### setMessages

The list of rich message responses to present to the user.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.ResponseMessage>` |

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

### getWebhook

The webhook to call.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/webhooks/<WebhookID>`.

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

### setWebhook

The webhook to call.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/webhooks/<WebhookID>`.

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

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

### getReturnPartialResponses

Whether Dialogflow should return currently queued fulfillment response
messages in streaming APIs. If a webhook is specified, it happens before
Dialogflow invokes webhook.

Warning:
1) This flag only affects streaming API. Responses are still queued
and returned once in non-streaming API.
2) The flag can be enabled in any fulfillment but only the first 3 partial
responses will be returned. You may only want to apply it to fulfillments
that have slow webhooks.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setReturnPartialResponses

Whether Dialogflow should return currently queued fulfillment response
messages in streaming APIs. If a webhook is specified, it happens before
Dialogflow invokes webhook.

Warning:
1) This flag only affects streaming API. Responses are still queued
and returned once in non-streaming API.
2) The flag can be enabled in any fulfillment but only the first 3 partial
responses will be returned. You may only want to apply it to fulfillments
that have slow webhooks.

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

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

### getTag

The value of this field will be populated in the
[WebhookRequest](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.WebhookRequest)
`fulfillmentInfo.tag` field by Dialogflow when the associated webhook is
called.

The tag is typically used by the webhook service to identify which
fulfillment is being called, but it could be used for other purposes.
This field is required if `webhook` is specified.

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

### setTag

The value of this field will be populated in the
[WebhookRequest](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.WebhookRequest)
`fulfillmentInfo.tag` field by Dialogflow when the associated webhook is
called.

The tag is typically used by the webhook service to identify which
fulfillment is being called, but it could be used for other purposes.
This field is required if `webhook` is specified.

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

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

### getSetParameterActions

Set parameter values before executing the webhook.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.SetParameterAction>` |   |

### setSetParameterActions

Set parameter values before executing the webhook.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.SetParameterAction>` |

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

### getConditionalCases

Conditional cases for this fulfillment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.ConditionalCases>` |   |

### setConditionalCases

Conditional cases for this fulfillment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.ConditionalCases>` |

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

### getAdvancedSettings

Hierarchical advanced settings for this fulfillment. The settings exposed
at the lower level overrides the settings exposed at the higher level.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.AdvancedSettings|null` |   |

### hasAdvancedSettings

### clearAdvancedSettings

### setAdvancedSettings

Hierarchical advanced settings for this fulfillment. The settings exposed
at the lower level overrides the settings exposed at the higher level.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.AdvancedSettings` |

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

### getEnableGenerativeFallback

If the flag is true, the agent will utilize LLM to generate a text
response. If LLM generation fails, the defined
[responses](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment#_Google_Cloud_Dialogflow_Cx_V3_Fulfillment__getMessages__) in the
fulfillment will be respected. This flag is only useful for fulfillments
associated with no-match event handlers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setEnableGenerativeFallback

If the flag is true, the agent will utilize LLM to generate a text
response. If LLM generation fails, the defined
[responses](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment#_Google_Cloud_Dialogflow_Cx_V3_Fulfillment__getMessages__) in the
fulfillment will be respected. This flag is only useful for fulfillments
associated with no-match event handlers.

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

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

### getGenerators

A list of Generators to be called during this fulfillment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.GeneratorSettings>` |   |

### setGenerators

A list of Generators to be called during this fulfillment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment.GeneratorSettings>` |

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