Skip to content

googleDialogflowIntent

Represents a Dialogflow intent. Intents convert a number of user expressions or patterns into an action. An action is an extraction of a user command or sentence semantics.

To get more information about Intent, see:

Example Usage - Dialogflow Intent 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.dialogflowIntent.DialogflowIntent(this, "basic_intent", {
  depends_on: [`\${${googleDialogflowAgentBasicAgent.fqn}}`],
  display_name: "basic-intent",
});

Example Usage - Dialogflow Intent Full

resource "google_project" "agent_project" {
  project_id = "tf-test-dialogflow-%{random_suffix}"
  name = "tf-test-dialogflow-%{random_suffix}"
  org_id = "123456789"
}

resource "google_project_service" "agent_project" {
  project = google_project.agent_project.project_id
  service = "dialogflow.googleapis.com"
  disable_dependent_services = false
}

resource "google_service_account" "dialogflow_service_account" {
  account_id = "tf-test-dialogflow-%{random_suffix}"
}

resource "google_project_iam_member" "agent_create" {
  project = google_project_service.agent_project.project
  role    = "roles/dialogflow.admin"
  member  = "serviceAccount:${google_service_account.dialogflow_service_account.email}"
}

resource "google_dialogflow_agent" "basic_agent" {
  project = google_project.agent_project.project_id
  display_name = "example_agent"
  default_language_code = "en"
  time_zone = "America/New_York"
}

resource "google_dialogflow_intent" "full_intent" {
  project = google_project.agent_project.project_id
  depends_on = [google_dialogflow_agent.basic_agent]
  display_name = "full-intent"
  webhook_state = "WEBHOOK_STATE_ENABLED"
  priority = 1
  is_fallback = false
  ml_disabled = true
  action = "some_action"
  reset_contexts = true
  input_context_names = ["projects/${google_project.agent_project.project_id}/agent/sessions/-/contexts/some_id"]
  events = ["some_event"]
  default_response_platforms = ["FACEBOOK","SLACK"]
}

Argument Reference

The following arguments are supported:

  • displayName - (Required) The name of this intent to be displayed on the console.

  • webhookState - (Optional) Indicates whether webhooks are enabled for the intent.

    • WEBHOOK_STATE_ENABLED: Webhook is enabled in the agent and in the intent.
    • WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING: Webhook is enabled in the agent and in the intent. Also, each slot filling prompt is forwarded to the webhook. Possible values are webhookStateEnabled and webhookStateEnabledForSlotFilling.
  • priority - (Optional) The priority of this intent. Higher numbers represent higher priorities.

    • If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the Normal priority in the console.
    • If the supplied value is negative, the intent is ignored in runtime detect intent requests.
  • isFallback - (Optional) Indicates whether this is a fallback intent.

  • mlDisabled - (Optional) Indicates whether Machine Learning is disabled for the intent. Note: If mlDisabled setting is set to true, then this intent is not taken into account during inference in ML ONLY match mode. Also, auto-markup in the UI is turned off.

  • inputContextNames - (Optional) The list of context names required for this intent to be triggered. Format: projects//agent/sessions/-/contexts/.

  • events - (Optional) The collection of event names that trigger the intent. If the collection of input contexts is not empty, all of the contexts must be present in the active user session for an event to trigger this intent. See the events reference for more details.

  • action - (Optional) The name of the action associated with the intent. Note: The action name must not contain whitespaces.

  • resetContexts - (Optional) Indicates whether to delete all contexts in the current session when this intent is matched.

  • defaultResponsePlatforms - (Optional) The list of platforms for which the first responses will be copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). Each value may be one of facebook, slack, telegram, kik, skype, line, viber, actionsOnGoogle, and googleHangouts.

  • parentFollowupIntentName - (Optional) The unique identifier of the parent intent in the chain of followup intents. Format: projects//agent/intents/.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

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 this intent. Format: projects//agent/intents/.

  • rootFollowupIntentName - The unique identifier of the root intent in the chain of followup intents. It identifies the correct followup intents chain for this intent. Format: projects//agent/intents/.

  • followupIntentInfo - Information about all followup intents that have this intent as a direct or indirect parent. We populate this field only in the output. Structure is documented below.

The followupIntentInfo block contains:

  • followupIntentName - (Optional) The unique identifier of the followup intent. Format: projects//agent/intents/.

  • parentFollowupIntentName - (Optional) The unique identifier of the followup intent's parent. Format: projects//agent/intents/.

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

Intent can be imported using any of these accepted formats:

$ terraform import google_dialogflow_intent.default {{name}}

User Project Overrides

This resource supports User Project Overrides.