From 36297bda2fa52e16994a17d47fb36ab8c200e14a Mon Sep 17 00:00:00 2001 From: Matthew DeGraffenreid Date: Wed, 8 Jul 2026 20:07:48 +0000 Subject: [PATCH 1/4] feat(dialogflow): expand generator with all contexts and settings Added support for freeFormContext, agentCoachingContext, translationContext, agentFeedbackContext, and customerMessageGenerationContext. Enforced mutual exclusivity using exactly_one_of. Made summarizationContext optional (non-breaking). Added timeouts and tunedModel support. --- mmv1/products/dialogflow/Generator.yaml | 260 +++++++++++++++++- ...ialogflow_generator_agent_coaching.tf.tmpl | 8 + 2 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_agent_coaching.tf.tmpl diff --git a/mmv1/products/dialogflow/Generator.yaml b/mmv1/products/dialogflow/Generator.yaml index 58fa343b9a9c..a906082db755 100644 --- a/mmv1/products/dialogflow/Generator.yaml +++ b/mmv1/products/dialogflow/Generator.yaml @@ -24,6 +24,10 @@ self_link: '{{name}}' create_url: projects/{{project}}/locations/{{location}}/generators?generatorId={{generator_id}} update_mask: true update_verb: PATCH +timeouts: + insert_minutes: 20 + update_minutes: 20 + delete_minutes: 20 custom_code: pre_create: templates/terraform/pre_create/dialogflow_set_endpoint.go.tmpl post_create: templates/terraform/post_create/set_computed_name.tmpl @@ -38,6 +42,10 @@ samples: - name: dialogflow_generator_basic resource_id_vars: profile_name: dialogflow-profile + - name: dialogflow_generator_agent_coaching + primary_resource_id: agent_coaching_generator + steps: + - name: dialogflow_generator_agent_coaching parameters: - name: location type: String @@ -63,7 +71,13 @@ properties: Optional. Human readable description of the generator. - name: summarizationContext type: NestedObject - required: true + exactly_one_of: + - summarization_context + - free_form_context + - agent_coaching_context + - translation_context + - agent_feedback_context + - customer_message_generation_context description: | Input of prebuilt Summarization feature. properties: @@ -210,6 +224,239 @@ properties: type: String description: | Optional. The target language of the generated summary. The language code for conversation will be used if this field is empty. Supported 2.0 and later versions. + - name: freeFormContext + type: NestedObject + exactly_one_of: + - summarization_context + - free_form_context + - agent_coaching_context + - translation_context + - agent_feedback_context + - customer_message_generation_context + description: | + Free form text input to LLM. + properties: + - name: text + type: String + description: | + Optional. Free form text input to LLM. + - name: agentCoachingContext + type: NestedObject + exactly_one_of: + - summarization_context + - free_form_context + - agent_coaching_context + - translation_context + - agent_feedback_context + - customer_message_generation_context + description: | + Agent coaching context. + properties: + - name: overarchingGuidance + type: String + description: | + Optional. The overarching guidance for the agent coaching. This should be set only for v1.5 and later versions. + - name: version + type: String + description: | + Optional. Version of the feature. If not set, default to latest version. Current candidates are ["2.5"]. + - name: outputLanguageCode + type: String + description: | + Optional. Output language code. + - name: searchConfig + type: NestedObject + description: | + Optional. Search configuration for agent coaching. This is used for general articles search. + properties: + - name: searchEngine + type: String + description: | + Required. The search engine to use for the agent coaching articles/instructions. Format: `projects/{project}/locations/global/collections/default_collection/engines/{engine_id}` + - name: datastores + type: Array + description: | + Optional. The datastore ids linked to the search engine. + item_type: + type: String + - name: instructions + type: Array + description: | + Optional. Customized instructions for agent coaching. + item_type: + type: NestedObject + properties: + - name: displayName + type: String + description: | + Optional. Display name for the instruction. + - name: displayDetails + type: String + description: | + Optional. The detailed description of this instruction. + - name: condition + type: String + description: | + Optional. The condition of the instruction. + - name: agentAction + type: String + description: | + Optional. The action that human agent should take. + - name: systemAction + type: String + description: | + Optional. The action that system should take. + - name: triggeringEvent + type: Enum + description: | + Optional. The trigger event of the instruction. + enum_values: + - END_OF_UTTERANCE + - MANUAL_CALL + - CUSTOMER_MESSAGE + - AGENT_MESSAGE + - name: translationContext + type: NestedObject + exactly_one_of: + - summarization_context + - free_form_context + - agent_coaching_context + - translation_context + - agent_feedback_context + - customer_message_generation_context + description: | + Translation context. + properties: + - name: agentLanguageCode + type: String + required: true + description: | + Required. The language code used by the agent. At least one of agent_language_code and customer_language_code must be English (en-US). + - name: customerLanguageCode + type: String + required: true + description: | + Required. The language code used by the customer. At least one of agent_language_code and customer_language_code must be English (en-US). + - name: version + type: String + description: | + Optional. Version of the feature. If not set, default to latest version. Current candidates are ["1.0"]. + - name: translationCustomization + type: NestedObject + description: | + Optional. Customized translation for specific glossaries and sentences. + properties: + - name: glossaryTerms + type: Array + description: | + Optional. Translation of a specific glossary in both agent and customer languages. + item_type: + type: NestedObject + properties: + - name: agentLanguageGlossary + type: String + required: true + description: | + Required. The glossary in agent language. + - name: customerLanguageGlossary + type: String + required: true + description: | + Required. The glossary in customer language. + - name: sentenceTranslations + type: Array + description: | + Optional. Translation of a specific sentence in both agent and customer languages. + item_type: + type: NestedObject + properties: + - name: agentLanguageSentence + type: String + required: true + description: | + Required. The sentence in agent language. + - name: customerLanguageSentence + type: String + required: true + description: | + Required. The sentence in customer language. + - name: agentFeedbackContext + type: NestedObject + exactly_one_of: + - summarization_context + - free_form_context + - agent_coaching_context + - translation_context + - agent_feedback_context + - customer_message_generation_context + description: | + Agent feedback context. + properties: + - name: version + type: String + description: | + Optional. Version of the feature. If not set, default to latest version. Current candidates are ["1.0"]. + - name: instructions + type: Array + description: | + Optional. Instructions to generate feedback from. + item_type: + type: NestedObject + properties: + - name: displayName + type: String + description: | + Optional. Display name for the instruction. + - name: displayDetails + type: String + description: | + Optional. The detailed description of this instruction. + - name: condition + type: String + description: | + Optional. The condition of the instruction. + - name: agentAction + type: String + description: | + Optional. The action that human agent should take. + - name: systemAction + type: String + description: | + Optional. The action that system should take. + - name: triggeringEvent + type: Enum + description: | + Optional. The trigger event of the instruction. + enum_values: + - END_OF_UTTERANCE + - MANUAL_CALL + - CUSTOMER_MESSAGE + - AGENT_MESSAGE + - name: customerMessageGenerationContext + type: NestedObject + exactly_one_of: + - summarization_context + - free_form_context + - agent_coaching_context + - translation_context + - agent_feedback_context + - customer_message_generation_context + description: | + Customer message generation context. + properties: + - name: version + type: String + description: | + Optional. Version of the feature. If not set, default to latest version. Current candidates are ["1.0"]. + - name: customization + type: NestedObject + description: | + Optional. Customizations for customer message generation. + properties: + - name: scenario + type: String + description: | + Optional. Scenario for generating customer messages. - name: inferenceParameter type: NestedObject description: | @@ -240,7 +487,18 @@ properties: - MANUAL_CALL - CUSTOMER_MESSAGE - AGENT_MESSAGE + - TOOL_CALL_COMPLETION - name: publishedModel type: String + exactly_one_of: + - published_model + - tuned_model description: | Optional. The published Large Language Model name. * To use the latest model version, specify the model name without version number. Example: text-bison * To use a stable model version, specify the version number as well. Example: text-bison@002. + - name: tunedModel + type: String + exactly_one_of: + - published_model + - tuned_model + description: | + Optional. Tuned Large Language Model endpoint from Vertex. Format: `projects//locations//endpoints/`. diff --git a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_agent_coaching.tf.tmpl b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_agent_coaching.tf.tmpl new file mode 100644 index 000000000000..8dc582706a6d --- /dev/null +++ b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_agent_coaching.tf.tmpl @@ -0,0 +1,8 @@ +resource "google_dialogflow_generator" "{{$.PrimaryResourceId}}" { + location = "global" + description = "An agent coaching generator." + agent_coaching_context { + version = "1.0" + overarching_guidance = "Be helpful." + } +} From d8d14239c593c55aebb3a02b33c59641b803d169 Mon Sep 17 00:00:00 2001 From: Matthew DeGraffenreid Date: Wed, 8 Jul 2026 21:34:46 +0000 Subject: [PATCH 2/4] feat(dialogflow): link generators to tools Added 'tools' property to Generator.yaml and updated samples to demonstrate linkage. Fixed pre-existing errors in Tool connector and datastore samples. --- mmv1/products/dialogflow/Generator.yaml | 10 ++++++++ .../dialogflow_generator_with_tools.tf.tmpl | 25 +++++++++++++++++++ .../dialogflow_tool_connector.tf.tmpl | 11 ++++++++ .../dialogflow_tool_datastore.tf.tmpl | 12 +++++++++ 4 files changed, 58 insertions(+) create mode 100644 mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl create mode 100644 mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_connector.tf.tmpl create mode 100644 mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_datastore.tf.tmpl diff --git a/mmv1/products/dialogflow/Generator.yaml b/mmv1/products/dialogflow/Generator.yaml index a906082db755..4925522596ae 100644 --- a/mmv1/products/dialogflow/Generator.yaml +++ b/mmv1/products/dialogflow/Generator.yaml @@ -46,6 +46,10 @@ samples: primary_resource_id: agent_coaching_generator steps: - name: dialogflow_generator_agent_coaching + - name: dialogflow_generator_with_tools + primary_resource_id: generator_with_tools + steps: + - name: dialogflow_generator_with_tools parameters: - name: location type: String @@ -502,3 +506,9 @@ properties: - tuned_model description: | Optional. Tuned Large Language Model endpoint from Vertex. Format: `projects//locations//endpoints/`. + - name: tools + type: Array + description: | + Optional. A list of tools this generator can use. Format: `projects//locations//tools/`. + item_type: + type: String diff --git a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl new file mode 100644 index 000000000000..b7aa0259b30e --- /dev/null +++ b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl @@ -0,0 +1,25 @@ +resource "google_dialogflow_generator" "{{$.PrimaryResourceId}}" { + location = "global" + description = "A generator with tools." + tools = [google_dialogflow_tool.test_tool.name] + summarization_context { + version = "4.0" + output_language_code = "en" + } + trigger_event = "MANUAL_CALL" +} + +resource "google_dialogflow_tool" "test_tool" { + location = "global" + display_name = "test-tool" + description = "A test tool" + open_api_spec { + text_schema = < Date: Thu, 9 Jul 2026 04:02:44 +0000 Subject: [PATCH 3/4] feat(dialogflow): Update Dialogflow Generator versions to 5.0 and 6.0 - Update summarizationContext.version candidates in Generator.yaml to 5.0 and 6.0 - Update versions in samples to 6.0 - Update versions in handwritten tests to 5.0 and 6.0 - Add valid path to dialogflow_generator_with_tools OpenAPI spec --- mmv1/products/dialogflow/Generator.yaml | 2 +- .../dialogflow/dialogflow_generator_basic.tf.tmpl | 2 +- .../dialogflow_generator_with_tools.tf.tmpl | 11 +++++++++-- .../dialogflow/resource_dialogflow_generator_test.go | 10 +++++----- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/mmv1/products/dialogflow/Generator.yaml b/mmv1/products/dialogflow/Generator.yaml index 4925522596ae..f81661519176 100644 --- a/mmv1/products/dialogflow/Generator.yaml +++ b/mmv1/products/dialogflow/Generator.yaml @@ -223,7 +223,7 @@ properties: type: String default_from_api: true description: | - Optional. Version of the feature. If not set, default to latest version. Current candidates are ["1.0"]. + Optional. Version of the feature. If not set, default to latest version. Current candidates are ["5.0", "6.0"]. - name: outputLanguageCode type: String description: | diff --git a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_basic.tf.tmpl b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_basic.tf.tmpl index 6d8ccb62ba19..4691bac5de6a 100644 --- a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_basic.tf.tmpl +++ b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_basic.tf.tmpl @@ -8,7 +8,7 @@ resource "google_dialogflow_generator" "{{$.PrimaryResourceId}}" { top_p = 0.95 } summarization_context { - version = "4.0" + version = "6.0" output_language_code = "en" } trigger_event = "MANUAL_CALL" diff --git a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl index b7aa0259b30e..aa4effac333d 100644 --- a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl +++ b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_generator_with_tools.tf.tmpl @@ -3,7 +3,7 @@ resource "google_dialogflow_generator" "{{$.PrimaryResourceId}}" { description = "A generator with tools." tools = [google_dialogflow_tool.test_tool.name] summarization_context { - version = "4.0" + version = "6.0" output_language_code = "en" } trigger_event = "MANUAL_CALL" @@ -19,7 +19,14 @@ openapi: 3.0.0 info: title: Test Tool version: 1.0.0 -paths: {} +paths: + /search: + get: + summary: Search function + operationId: searchAction + responses: + '200': + description: OK EOF } } diff --git a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_generator_test.go b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_generator_test.go index b98315771f51..7bebf5ef4e2f 100644 --- a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_generator_test.go +++ b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_generator_test.go @@ -78,7 +78,7 @@ func testAccDialogflowGenerator_full(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_dialogflow_generator" "summarization_generator" { location = "global" - description = "A v4.0 summarization generator with customized section." + description = "A v6.0 summarization generator with customized section." published_model = "gemini-2.0-flash-001" inference_parameter { max_output_tokens = 1024 @@ -126,7 +126,7 @@ resource "google_dialogflow_generator" "summarization_generator" { key = "Redaction" type = "CUSTOMER_DEFINED" } - version = "4.0" + version = "6.0" output_language_code = "en" } trigger_event = "MANUAL_CALL" @@ -138,7 +138,7 @@ func testAccDialogflowGenerator_update(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_dialogflow_generator" "summarization_generator" { location = "global" - description = "A v3.0 summarization generator with customized section." + description = "A v5.0 summarization generator with customized section." published_model = "gemini-1.0-pro-002" inference_parameter { max_output_tokens = 2048 @@ -186,7 +186,7 @@ resource "google_dialogflow_generator" "summarization_generator" { key = "Redaction" type = "CUSTOMER_DEFINED" } - version = "3.0" + version = "5.0" output_language_code = "es" } trigger_event = "MANUAL_CALL" @@ -207,7 +207,7 @@ resource "google_dialogflow_generator" "summarization_generator" { top_p = 0.95 } summarization_context { - version = "4.0" + version = "6.0" output_language_code = "en" } trigger_event = "MANUAL_CALL" From bdb78ee8a1e8d9f6f34a93c1192aecdb84036804 Mon Sep 17 00:00:00 2001 From: Matthew DeGraffenreid Date: Thu, 9 Jul 2026 05:12:45 +0000 Subject: [PATCH 4/4] chore(dialogflow): remove unused tool templates from generator branch --- .../dialogflow/dialogflow_tool_connector.tf.tmpl | 11 ----------- .../dialogflow/dialogflow_tool_datastore.tf.tmpl | 12 ------------ 2 files changed, 23 deletions(-) delete mode 100644 mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_connector.tf.tmpl delete mode 100644 mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_datastore.tf.tmpl diff --git a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_connector.tf.tmpl b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_connector.tf.tmpl deleted file mode 100644 index 81edb8d5db31..000000000000 --- a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_connector.tf.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -resource "google_dialogflow_tool" "{{$.PrimaryResourceId}}" { - location = "{{index $.ResourceIdVars "location"}}" - display_name = "connector-tool" - description = "A tool with Connector spec" - connector_spec { - name = "projects/test-project/locations/{{index $.ResourceIdVars "location"}}/connections/test-connection" - actions { - connection_action_id = "test-action" - } - } -} diff --git a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_datastore.tf.tmpl b/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_datastore.tf.tmpl deleted file mode 100644 index 7c485eb587d1..000000000000 --- a/mmv1/templates/terraform/samples/services/dialogflow/dialogflow_tool_datastore.tf.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -resource "google_dialogflow_tool" "{{$.PrimaryResourceId}}" { - location = "{{index $.ResourceIdVars "location"}}" - display_name = "datastore-tool" - description = "A tool with Data Store spec" - data_store_spec { - data_store_connections { - data_store = "projects/test-project/locations/{{index $.ResourceIdVars "location"}}/dataStores/test-datastore" - data_store_type = "PUBLIC_WEB" - } - fallback_prompt {} - } -}