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:
resource "google_dialogflow_agent" "basic_agent" {
display_name = "example_agent"
default_language_code = "en"
time_zone = "America/New_York"
}
resource "google_dialogflow_fulfillment" "basic_fulfillment" {
depends_on = [google_dialogflow_agent.basic_agent]
display_name = "basic-fulfillment"
enabled = true
generic_web_service {
uri = "https://google.com"
username = "admin"
password = "password"
request_headers = {
name = "wrench"
}
}
}
The following arguments are supported:
display_name
-
(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.
generic_web_service
-
(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
.The generic_web_service
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.
request_headers
-
(Optional)
The HTTP request headers to send together with fulfillment requests.
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/
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Fulfillment can be imported using any of these accepted formats:
{{name}}
In Terraform v1.5.0 and later, use an import
block to import Fulfillment using one of the formats above. For example:
import {
id = "{{name}}"
to = google_dialogflow_fulfillment.default
}
When using the terraform import
command, Fulfillment can be imported using one of the formats above. For example:
$ terraform import google_dialogflow_fulfillment.default {{name}}
This resource supports User Project Overrides.