googleDialogflowFulfillment
By default, your agent responds to a matched intent with a static response. If you're using one of the integration options, you can provide a more dynamic response by using fulfillment. When you enable fulfillment for an intent, Dialogflow responds to that intent by calling a service that you define. For example, if an end-user wants to schedule a haircut on Friday, your service can check your database and respond to the end-user with availability information for Friday.
To get more information about Fulfillment, see:
- API documentation
- How-to Guides
- Official Documentation
Example Usage - Dialogflow Fulfillment Basic
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDialogflowAgentBasicAgent =
new google.dialogflowAgent.DialogflowAgent(this, "basic_agent", {
default_language_code: "en",
display_name: "example_agent",
time_zone: "America/New_York",
});
new google.dialogflowFulfillment.DialogflowFulfillment(
this,
"basic_fulfillment",
{
depends_on: [`\${${googleDialogflowAgentBasicAgent.fqn}}`],
display_name: "basic-fulfillment",
enabled: true,
generic_web_service: [
{
password: "password",
request_headers: [
{
name: "wrench",
},
],
uri: "https://google.com",
username: "admin",
},
],
}
);
Argument Reference
The following arguments are supported:
displayName
- (Required) The human-readable name of the fulfillment, unique within the agent.
-
enabled
- (Optional) Whether fulfillment is enabled. -
features
- (Optional) The field defines whether the fulfillment is enabled for certain features. Structure is documented below. -
genericWebService
- (Optional) Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below. -
project
- (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
type
- (Required) The type of the feature that enabled for fulfillment.- SMALLTALK: Fulfillment is enabled for SmallTalk. Possible values are
smalltalk
.
The genericWebService
block supports:
-
uri
- (Required) The fulfillment URI for receiving POST requests. It must use https protocol. -
username
- (Optional) The user name for HTTP Basic authentication. -
password
- (Optional) The password for HTTP Basic authentication. -
requestHeaders
- (Optional) The HTTP request headers to send together with fulfillment requests.
Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
-
id
- an identifier for the resource with format{{name}}
-
name
- The unique identifier of the fulfillment. Format: projects//agent/fulfillment - projects/ /locations/ /agent/fulfillment
Timeouts
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.
Import
Fulfillment can be imported using any of these accepted formats:
User Project Overrides
This resource supports User Project Overrides.