Skip to content

googleDialogflowCxEntityType

Entities are extracted from user input and represent parameters that are meaningful to your application. For example, a date range, a proper name such as a geographic location or landmark, and so on. Entities represent actionable data for your application.

To get more information about EntityType, see:

Example Usage - Dialogflowcx Entity Type Full

/*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 googleDialogflowCxAgentAgent =
  new google.dialogflowCxAgent.DialogflowCxAgent(this, "agent", {
    avatar_uri:
      "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
    default_language_code: "en",
    description: "Example description.",
    display_name: "dialogflowcx-agent",
    enable_spell_correction: true,
    enable_stackdriver_logging: true,
    location: "global",
    speech_to_text_settings: [
      {
        enable_speech_adaptation: true,
      },
    ],
    supported_language_codes: ["fr", "de", "es"],
    time_zone: "America/New_York",
  });
new google.dialogflowCxEntityType.DialogflowCxEntityType(
  this,
  "basic_entity_type",
  {
    display_name: "MyEntity",
    enable_fuzzy_extraction: false,
    entities: [
      {
        synonyms: ["synonym1", "synonym2"],
        value: "value1",
      },
      {
        synonyms: ["synonym3", "synonym4"],
        value: "value2",
      },
    ],
    kind: "KIND_MAP",
    parent: googleDialogflowCxAgentAgent.id,
  }
);

Argument Reference

The following arguments are supported:

  • displayName - (Required) The human-readable name of the entity type, unique within the agent.

  • kind - (Required) Indicates whether the entity type can be automatically expanded.

    • KIND_MAP: Map entity types allow mapping of a group of synonyms to a canonical value.
    • KIND_LIST: List entity types contain a set of entries that do not map to canonical values. However, list entity types can contain references to other entity types (with or without aliases).
    • KIND_REGEXP: Regexp entity types allow to specify regular expressions in entries values. Possible values are kindMap, kindList, and kindRegexp.
  • entities - (Required) The collection of entity entries associated with the entity type. Structure is documented below.

The entities block supports:

  • value - (Optional) The primary value associated with this entity entry. For example, if the entity type is vegetable, the value could be scallions. For KIND_MAP entity types: A canonical value to be used in place of synonyms. For KIND_LIST entity types: A string that can contain references to other entity types (with or without aliases).

  • synonyms - (Optional) A collection of value synonyms. For example, if the entity type is vegetable, and value is scallions, a synonym could be green onions. For KIND_LIST entity types: This collection must contain exactly one synonym equal to value.


  • autoExpansionMode - (Optional) Represents kinds of entities.

    • AUTO_EXPANSION_MODE_UNSPECIFIED: Auto expansion disabled for the entity.
    • AUTO_EXPANSION_MODE_DEFAULT: Allows an agent to recognize values that have not been explicitly listed in the entity. Possible values are autoExpansionModeDefault and autoExpansionModeUnspecified.
  • excludedPhrases - (Optional) Collection of exceptional words and phrases that shouldn't be matched. For example, if you have a size entity type with entry giant(an adjective), you might consider adding giants(a noun) as an exclusion. If the kind of entity type is KIND_MAP, then the phrases specified by entities and excluded phrases should be mutually exclusive. Structure is documented below.

  • enableFuzzyExtraction - (Optional) Enables fuzzy entity extraction during classification.

  • redact - (Optional) Indicates whether parameters of the entity type should be redacted in log. If redaction is enabled, page parameters and intent parameters referring to the entity type will be replaced by parameter name when logging.

  • parent - (Optional) The agent to create a entity type for. Format: projects//locations//agents/.

  • languageCode - (Optional) The language of the following fields in entityType: EntityType.entities.value EntityType.entities.synonyms EntityType.excluded_phrases.value If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

The excludedPhrases block supports:

  • value - (Optional) The word or phrase to be excluded.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format {{parent}}/entityTypes/{{name}}

  • name - The unique identifier of the entity type. Format: projects//locations//agents//entityTypes/.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 40 minutes.
  • update - Default is 40 minutes.
  • delete - Default is 20 minutes.

Import

EntityType can be imported using any of these accepted formats:

$ terraform import google_dialogflow_cx_entity_type.default {{parent}}/entityTypes/{{name}}
$ terraform import google_dialogflow_cx_entity_type.default {{parent}}/{{name}}