-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fulfillment-unavailability article
Why: * Explain how to handle fulfillment unavailability cases How: * Created a new section for fulfillment best practices
- Loading branch information
1 parent
386811e
commit 2ccdcd4
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Dialogflow Fulfillment | ||
|
||
Fulfillment is a part of Google Dialogflow platform which allows developers to provide more dynamic responses by using webhooks. When you enable fulfillment for an intent, Dialogflow responds to that intent by calling a service that you define. Web service will receive a POST request from Dialogflow in the form of the response to a user query matched by intents with webhook enabled. To read more. | ||
|
||
The following are some quick guides to common features we use: | ||
|
||
* [Fulfillment Unavailability Handler](fulfillment-unavailability-handler.md) | ||
|
||
For more information visit https://cloud.google.com/dialogflow/es/docs/fulfillment-overview |
29 changes: 29 additions & 0 deletions
29
guides/dialogflow/fulfillment/fulfillment-unavailability-handler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Dialogflow Fulfillment Unavailability Handler | ||
|
||
Sometimes conversational journeys require some response from fulfillment service. For example: in the end of ID&V process fulfillment service should return some [Followup Event Input](https://cloud.google.com/dialogflow/es/docs/fulfillment-webhook#event), but fulfillment service hasn't responded within 5(by default) seconds for some reasons. In this case Dialogflow will respond with the default text response which breaks normal flow as fulfillment service can't confirm result of the ID&V process. That's why it's important to escalate such calls to some "failover" endpoint. | ||
|
||
In order to escalate or redirect calls which haven't received any response from the fulfillment service we can do the following: | ||
|
||
1. Create a new intent which will be triggered in case of fulfillment unavailability with the following details: | ||
|
||
- Input contexts: `fulfillment-requested` | ||
- Output contexts: `fulfillment-requested(2)` | ||
- Training phrases: any 3-5 phrases which marked as `@sys.any` entity | ||
- Parameters: any extra parameters which you need to handle a call. For example, in order to escalate a call you can add `action`, `stop_recording` and `router_name` parameters | ||
- Fulfillment: make sure webhook is disabled for this intent | ||
|
||
Example of Fulfillment Unavailability intent: | ||
|
||
![fulfillment-unavailability-failover](../../../assets/fulfillment-unavailability.png) | ||
|
||
2. Add `fulfillment-requested(3)` output context To all intents which expect any response form fulfillment service | ||
|
||
3. Add this output context to all your fulfillment responses: | ||
|
||
``` | ||
{ | ||
lifespanCount: 0, | ||
name: `${sessionid}/contexts/fulfillment-requested` | ||
} | ||
``` | ||
This response won't allow DF to match an intent which we created in step 1 as it removes `fulfillment-requested` context by setting `lifespanCount: 0`. If fulfillment is not available and can't delete `fulfillment-requested` context, next utterance will match "fulfillment unavailability" intent. |