| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** 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: "Discovery Engine" |
| description: |- |
| Vertex chat and Conversation Engine Chat type |
| --- |
| |
| # google\_discovery\_engine\_chat\_engine |
| |
| Vertex chat and Conversation Engine Chat type |
| |
| |
| To get more information about ChatEngine, see: |
| |
| * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines) |
| * How-to Guides |
| * [Vertex AI Conversation](https://cloud.google.com/dialogflow/cx/docs/concept/generative) |
| |
| <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=discoveryengine_chat_engine_basic&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 - Discoveryengine Chat Engine Basic |
| |
| |
| ```hcl |
| resource "google_discovery_engine_data_store" "test_data_store" { |
| location = "global" |
| data_store_id = "data-store" |
| display_name = "Structured datastore" |
| industry_vertical = "GENERIC" |
| content_config = "NO_CONTENT" |
| solution_types = ["SOLUTION_TYPE_CHAT"] |
| } |
| |
| resource "google_discovery_engine_data_store" "test_data_store_2" { |
| location = google_discovery_engine_data_store.test_data_store.location |
| data_store_id = "data-store-2" |
| display_name = "Structured datastore 2" |
| industry_vertical = "GENERIC" |
| content_config = "NO_CONTENT" |
| solution_types = ["SOLUTION_TYPE_CHAT"] |
| } |
| |
| resource "google_discovery_engine_chat_engine" "primary" { |
| engine_id = "chat-engine-id" |
| collection_id = "default_collection" |
| location = google_discovery_engine_data_store.test_data_store.location |
| display_name = "Chat engine" |
| industry_vertical = "GENERIC" |
| data_store_ids = [google_discovery_engine_data_store.test_data_store.data_store_id, google_discovery_engine_data_store.test_data_store_2.data_store_id] |
| common_config { |
| company_name = "test-company" |
| } |
| chat_engine_config { |
| agent_creation_config { |
| business = "test business name" |
| default_language_code = "en" |
| time_zone = "America/Los_Angeles" |
| } |
| } |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `display_name` - |
| (Required) |
| The display name of the engine. Should be human readable. UTF-8 encoded string with limit of 1024 characters. |
| |
| * `data_store_ids` - |
| (Required) |
| The data stores associated with this engine. Multiple DataStores in the same Collection can be associated here. All listed DataStores must be `SOLUTION_TYPE_CHAT`. Adding or removing data stores will force recreation. |
| |
| * `chat_engine_config` - |
| (Required) |
| Configurations for a chat Engine. |
| Structure is [documented below](#nested_chat_engine_config). |
| |
| * `engine_id` - |
| (Required) |
| The ID to use for chat engine. |
| |
| * `collection_id` - |
| (Required) |
| The collection ID. |
| |
| * `location` - |
| (Required) |
| Location. |
| |
| |
| <a name="nested_chat_engine_config"></a>The `chat_engine_config` block supports: |
| |
| * `agent_creation_config` - |
| (Required) |
| The configuration to generate the Dialogflow agent that is associated to this Engine. |
| Structure is [documented below](#nested_agent_creation_config). |
| |
| |
| <a name="nested_agent_creation_config"></a>The `agent_creation_config` block supports: |
| |
| * `business` - |
| (Optional) |
| Name of the company, organization or other entity that the agent represents. Used for knowledge connector LLM prompt and for knowledge search. |
| |
| * `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. |
| |
| * `time_zone` - |
| (Required) |
| The time zone of the agent from the [time zone database](https://www.iana.org/time-zones), e.g., America/New_York, Europe/Paris. |
| |
| * `location` - |
| (Optional) |
| Agent location for Agent creation, currently supported values: global/us/eu, it needs to be the same region as the Chat Engine. |
| |
| - - - |
| |
| |
| * `industry_vertical` - |
| (Optional) |
| The industry vertical that the chat engine registers. Vertical on Engine has to match vertical of the DataStore linked to the engine. |
| Default value is `GENERIC`. |
| Possible values are: `GENERIC`. |
| |
| * `common_config` - |
| (Optional) |
| Common config spec that specifies the metadata of the engine. |
| Structure is [documented below](#nested_common_config). |
| |
| * `project` - (Optional) The ID of the project in which the resource belongs. |
| If it is not provided, the provider project is used. |
| |
| |
| <a name="nested_common_config"></a>The `common_config` block supports: |
| |
| * `company_name` - |
| (Optional) |
| The name of the company, business or entity that is associated with the engine. Setting this may help improve LLM related features. |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}` |
| |
| * `name` - |
| The unique full resource name of the chat engine. Values are of the format |
| `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. |
| This field must be a UTF-8 encoded string with a length limit of 1024 |
| characters. |
| |
| * `create_time` - |
| Timestamp the Engine was created at. |
| |
| * `update_time` - |
| Timestamp the Engine was last updated. |
| |
| * `chat_engine_metadata` - |
| Additional information of the Chat Engine. |
| Structure is [documented below](#nested_chat_engine_metadata). |
| |
| |
| <a name="nested_chat_engine_metadata"></a>The `chat_engine_metadata` block contains: |
| |
| * `dialogflow_agent` - |
| (Output) |
| The resource name of a Dialogflow agent, that this Chat Engine refers to. |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| ChatEngine can be imported using any of these accepted formats: |
| |
| * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}` |
| * `{{project}}/{{location}}/{{collection_id}}/{{engine_id}}` |
| * `{{location}}/{{collection_id}}/{{engine_id}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import ChatEngine using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}" |
| to = google_discovery_engine_chat_engine.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), ChatEngine can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_discovery_engine_chat_engine.default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}} |
| $ terraform import google_discovery_engine_chat_engine.default {{project}}/{{location}}/{{collection_id}}/{{engine_id}} |
| $ terraform import google_discovery_engine_chat_engine.default {{location}}/{{collection_id}}/{{engine_id}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |