blob: 7b53d1baf6183538aab7ed42438c9c2377f9376f [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Dialogflow"
description: |-
A Dialogflow agent is a virtual agent that handles conversations with your end-users.
---
# google\_dialogflow\_agent
A Dialogflow agent is a virtual agent that handles conversations with your end-users. It is a natural language
understanding module that understands the nuances of human language. Dialogflow translates end-user text or audio
during a conversation to structured data that your apps and services can understand. You design and build a Dialogflow
agent to handle the types of conversations required for your system.
To get more information about Agent, see:
* [API documentation](https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects/agent)
* How-to Guides
* [Official Documentation](https://cloud.google.com/dialogflow/docs/)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=dialogflow_agent_full&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Dialogflow Agent Full
```hcl
resource "google_dialogflow_agent" "full_agent" {
display_name = "dialogflow-agent"
default_language_code = "en"
supported_language_codes = ["fr","de","es"]
time_zone = "America/New_York"
description = "Example description."
avatar_uri = "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png"
enable_logging = true
match_mode = "MATCH_MODE_ML_ONLY"
classification_threshold = 0.3
api_version = "API_VERSION_V2_BETA_1"
tier = "TIER_STANDARD"
}
```
## Argument Reference
The following arguments are supported:
* `display_name` -
(Required)
The name of this agent.
* `default_language_code` -
(Required)
The default language of the agent as a language tag. [See Language Support](https://cloud.google.com/dialogflow/docs/reference/language)
for a list of the currently supported language codes. This field cannot be updated after creation.
* `time_zone` -
(Required)
The time zone of this agent from the [time zone database](https://www.iana.org/time-zones), e.g., America/New_York,
Europe/Paris.
- - -
* `supported_language_codes` -
(Optional)
The list of all languages supported by this agent (except for the defaultLanguageCode).
* `description` -
(Optional)
The description of this agent. The maximum length is 500 characters. If exceeded, the request is rejected.
* `avatar_uri` -
(Optional)
The URI of the agent's avatar, which are used throughout the Dialogflow console. When an image URL is entered
into this field, the Dialogflow will save the image in the backend. The address of the backend image returned
from the API will be shown in the [avatarUriBackend] field.
* `enable_logging` -
(Optional)
Determines whether this agent should log conversation queries.
* `match_mode` -
(Optional)
Determines how intents are detected from user queries.
* MATCH_MODE_HYBRID: Best for agents with a small number of examples in intents and/or wide use of templates
syntax and composite entities.
* MATCH_MODE_ML_ONLY: Can be used for agents with a large number of examples in intents, especially the ones
using @sys.any or very large developer entities.
Possible values are: `MATCH_MODE_HYBRID`, `MATCH_MODE_ML_ONLY`.
* `classification_threshold` -
(Optional)
To filter out false positive results and still get variety in matched natural language inputs for your agent,
you can tune the machine learning classification threshold. If the returned score value is less than the threshold
value, then a fallback intent will be triggered or, if there are no fallback intents defined, no intent will be
triggered. The score values range from 0.0 (completely uncertain) to 1.0 (completely certain). If set to 0.0, the
default of 0.3 is used.
* `api_version` -
(Optional)
API version displayed in Dialogflow console. If not specified, V2 API is assumed. Clients are free to query
different service endpoints for different API versions. However, bots connectors and webhook calls will follow
the specified API version.
* API_VERSION_V1: Legacy V1 API.
* API_VERSION_V2: V2 API.
* API_VERSION_V2_BETA_1: V2beta1 API.
Possible values are: `API_VERSION_V1`, `API_VERSION_V2`, `API_VERSION_V2_BETA_1`.
* `tier` -
(Optional)
The agent tier. If not specified, TIER_STANDARD is assumed.
* TIER_STANDARD: Standard tier.
* TIER_ENTERPRISE: Enterprise tier (Essentials).
* TIER_ENTERPRISE_PLUS: Enterprise tier (Plus).
NOTE: Due to consistency issues, the provider will not read this field from the API. Drift is possible between
the Terraform state and Dialogflow if the agent tier is changed outside of Terraform.
Possible values are: `TIER_STANDARD`, `TIER_ENTERPRISE`, `TIER_ENTERPRISE_PLUS`.
* `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 `{{project}}`
* `avatar_uri_backend` -
The URI of the agent's avatar as returned from the API. Output only. To provide an image URL for the agent avatar,
the [avatarUri] field can be used.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 40 minutes.
- `update` - Default is 40 minutes.
- `delete` - Default is 20 minutes.
## Import
Agent can be imported using any of these accepted formats:
* `{{project}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Agent using one of the formats above. For example:
```tf
import {
id = "{{project}}"
to = google_dialogflow_agent.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Agent can be imported using one of the formats above. For example:
```
$ terraform import google_dialogflow_agent.default {{project}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).