Skip to content

Commit 30f3233

Browse files
deliaqihemantadilgoogle-labs-jules[bot]zli82016c2thorn
authored
Add Generator resource to product Dialogflow (#15599)
Signed-off-by: Baptiste Roux <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Chris Henzie <[email protected]> Co-authored-by: hemantadil <[email protected]> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Zhenhua Li <[email protected]> Co-authored-by: Cameron Thornton <[email protected]> Co-authored-by: Sam Levenick <[email protected]> Co-authored-by: Stephen Lewis (Burrows) <[email protected]> Co-authored-by: Nicolas Dumazet <[email protected]> Co-authored-by: Hemant Adil <[email protected]> Co-authored-by: Shuya Ma <[email protected]> Co-authored-by: Nicolas Dumazet <[email protected]> Co-authored-by: NA2047 <[email protected]> Co-authored-by: Dhruv Agarwal <[email protected]> Co-authored-by: Swamita Gupta <[email protected]> Co-authored-by: deekshithakasireddy <[email protected]> Co-authored-by: Baptiste Roux <[email protected]> Co-authored-by: Scott Suarez <[email protected]> Co-authored-by: Mike Prieto <[email protected]> Co-authored-by: Björn <[email protected]> Co-authored-by: Manan <[email protected]> Co-authored-by: Jiongxin Ye <[email protected]> Co-authored-by: shang-jason <[email protected]> Co-authored-by: devanshikhatsuriya <[email protected]> Co-authored-by: Mauricio Alvarez Leon <[email protected]> Co-authored-by: Mehul3217 <[email protected]> Co-authored-by: Ellen Jiang <[email protected]> Co-authored-by: porky256 <[email protected]> Co-authored-by: Matheus Guilherme Souza Aleixo <[email protected]> Co-authored-by: Andrei Gurau <[email protected]> Co-authored-by: Chris Hawk <[email protected]> Co-authored-by: Thomas Rodgers <[email protected]> Co-authored-by: tongryan-google <[email protected]> Co-authored-by: Riley Karson <[email protected]> Co-authored-by: Kushal Lunkad <[email protected]> Co-authored-by: Thoufic <[email protected]> Co-authored-by: Thoufic <[email protected]> Co-authored-by: Stephen Lewis (Burrows) <[email protected]> Co-authored-by: Paridhi Shah <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yu Liao <[email protected]> Co-authored-by: gurusai-voleti <[email protected]> Co-authored-by: siddhisingh-13 <[email protected]> Co-authored-by: Abhijeet Dargude <[email protected]> Co-authored-by: Luca Prete <[email protected]> Co-authored-by: knparikh <[email protected]> Co-authored-by: veraz0818 <[email protected]> Co-authored-by: Chris Henzie <[email protected]> Co-authored-by: Xian-Ji Chen <[email protected]> Co-authored-by: Ryan Oaks <[email protected]> Co-authored-by: Nick Elliot <[email protected]> Co-authored-by: Siddharth Dharm (Google) <[email protected]> Co-authored-by: Yanwei Guo <[email protected]> Co-authored-by: hao-nan-li <[email protected]> Co-authored-by: jgforsberg <[email protected]> Co-authored-by: Spheny1 <[email protected]> Co-authored-by: Ramon Vermeulen <[email protected]> Co-authored-by: efe <[email protected]> Co-authored-by: rahul2393 <[email protected]> Co-authored-by: harshithpatte-g <[email protected]> Co-authored-by: mizanali-04 <[email protected]> Co-authored-by: Xingya Zhao <[email protected]> Co-authored-by: Lingkai Shen <[email protected]> Co-authored-by: Daniel Dubnikov <[email protected]> Co-authored-by: jlmwise <[email protected]> Co-authored-by: zhihaos <[email protected]> Co-authored-by: Jirka Korejtko <[email protected]> Co-authored-by: wj-chen <[email protected]> Co-authored-by: Rohan Chawla <[email protected]> Co-authored-by: Rahul Jaideoka <[email protected]> Co-authored-by: avinash patnala <[email protected]> Co-authored-by: Avinash Patnala <[email protected]> Co-authored-by: James Edouard <[email protected]> Co-authored-by: James Edouard <[email protected]> Co-authored-by: Akshat Jindal <[email protected]> Co-authored-by: Steren <[email protected]> Co-authored-by: congdu-kun <[email protected]> Co-authored-by: Komal Chauhan <[email protected]> Co-authored-by: Abhishek Sharma <[email protected]> Co-authored-by: Veronika Priesner <[email protected]> Co-authored-by: Michael Turgeman <[email protected]>
1 parent 15dc2c7 commit 30f3233

File tree

3 files changed

+479
-0
lines changed

3 files changed

+479
-0
lines changed
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
# Copyright 2025 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
---
15+
name: 'Generator'
16+
description: |
17+
LLM generator.
18+
references:
19+
guides:
20+
'Official Documentation': 'https://cloud.google.com/agent-assist/docs'
21+
api: 'https://cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.generators'
22+
base_url: 'projects/{{project}}/locations/{{location}}/generators'
23+
create_url: 'projects/{{project}}/locations/{{location}}/generators?generatorId={{generator_id}}'
24+
self_link: '{{name}}'
25+
update_verb: 'PATCH'
26+
update_mask: true
27+
28+
custom_code:
29+
pre_create: 'templates/terraform/pre_create/dialogflow_set_endpoint.go.tmpl'
30+
pre_read: 'templates/terraform/pre_create/dialogflow_set_endpoint.go.tmpl'
31+
pre_update: 'templates/terraform/pre_create/dialogflow_set_endpoint.go.tmpl'
32+
pre_delete: 'templates/terraform/pre_create/dialogflow_set_endpoint.go.tmpl'
33+
post_create: 'templates/terraform/post_create/set_computed_name.tmpl'
34+
custom_import: 'templates/terraform/custom_import/self_link_as_name_set_project_and_location.go.tmpl'
35+
36+
examples:
37+
- name: 'dialogflow_generator_basic'
38+
primary_resource_id: 'summarization_basic_generator'
39+
vars:
40+
profile_name: 'dialogflow-profile'
41+
42+
parameters:
43+
- name: 'location'
44+
type: String
45+
required: true
46+
url_param_only: true
47+
description: |
48+
desc
49+
- name: 'generatorId'
50+
type: String
51+
default_from_api: true
52+
custom_flatten: 'templates/terraform/custom_flatten/id_from_name.tmpl'
53+
description: |
54+
Optional. The ID to use for the generator, which will become the final component of the generator's resource name.
55+
56+
properties:
57+
- name: name
58+
type: String
59+
description: |
60+
The resource name of the generator.
61+
output: true
62+
- name: description
63+
type: String
64+
description: |
65+
Optional. Human readable description of the generator.
66+
- name: summarizationContext
67+
type: NestedObject
68+
required: true
69+
description: |
70+
Input of prebuilt Summarization feature.
71+
properties:
72+
- name: summarizationSections
73+
type: Array
74+
description: |
75+
Optional. List of sections. Note it contains both predefined section sand customer defined sections.
76+
item_type:
77+
type: NestedObject
78+
properties:
79+
- name: key
80+
type: String
81+
description: |
82+
Optional. Name of the section, for example, "situation".
83+
- name: definition
84+
type: String
85+
description: |
86+
Optional. Definition of the section, for example, "what the customer needs help with or has question about."
87+
- name: type
88+
type: Enum
89+
description: |
90+
Optional. Type of the summarization section.
91+
enum_values:
92+
- 'SITUATION'
93+
- 'ACTION'
94+
- 'RESOLUTION'
95+
- 'REASON_FOR_CANCELLATION'
96+
- 'CUSTOMER_SATISFACTION'
97+
- 'ENTITIES'
98+
- 'CUSTOMER_DEFINED'
99+
- 'SITUATION_CONCISE'
100+
- 'ACTION_CONCISE'
101+
- name: fewShotExamples
102+
type: Array
103+
description: |
104+
Optional. List of few shot examples.
105+
item_type:
106+
type: NestedObject
107+
properties:
108+
- name: conversationContext
109+
type: NestedObject
110+
description: |
111+
Optional. Conversation transcripts.
112+
properties:
113+
- name: messageEntries
114+
type: Array
115+
description:
116+
Optional. List of message transcripts in the conversation.
117+
item_type:
118+
type: NestedObject
119+
properties:
120+
- name: role
121+
type: Enum
122+
description: |
123+
Optional. Participant role of the message.
124+
enum_values:
125+
- 'HUMAN_AGENT'
126+
- 'AUTOMATED_AGENT'
127+
- 'END_USER'
128+
- name: text
129+
type: String
130+
description: |
131+
Optional. Transcript content of the message.
132+
- name: languageCode
133+
type: String
134+
description: |
135+
Optional. The language of the text.
136+
- name: createTime
137+
type: String
138+
description: |
139+
Optional. Create time of the message entry.
140+
- name: extraInfo
141+
type: KeyValuePairs
142+
description: |
143+
Optional. Key is the placeholder field name in input, value is the value of the placeholder. E.g. instruction contains "@price", and ingested data has <"price", "10">
144+
- name: output
145+
type: NestedObject
146+
required: true
147+
description: |
148+
Required. Example output of the model.
149+
properties:
150+
- name: summarySuggestion
151+
type: NestedObject
152+
description: |
153+
Optional. Suggested summary.
154+
properties:
155+
- name: summarySections
156+
type: Array
157+
required: true
158+
description: |
159+
Required. All the parts of generated summary.
160+
item_type:
161+
type: NestedObject
162+
properties:
163+
- name: section
164+
type: String
165+
required: true
166+
description: |
167+
Required. Name of the section.
168+
- name: summary
169+
type: String
170+
required: true
171+
description: |
172+
Required. Summary text for the section.
173+
- name: summarizationSectionList
174+
type: NestedObject
175+
description: |
176+
Summarization sections.
177+
properties:
178+
- name: summarizationSections
179+
type: Array
180+
description: |
181+
Optional. Summarization sections.
182+
item_type:
183+
type: NestedObject
184+
properties:
185+
- name: key
186+
type: String
187+
description: |
188+
Optional. Name of the section, for example, "situation".
189+
- name: definition
190+
type: String
191+
description: |
192+
Optional. Definition of the section, for example, "what the customer needs help with or has question about."
193+
- name: type
194+
type: Enum
195+
description: |
196+
Optional. Type of the summarization section.
197+
enum_values:
198+
- 'SITUATION'
199+
- 'ACTION'
200+
- 'RESOLUTION'
201+
- 'REASON_FOR_CANCELLATION'
202+
- 'CUSTOMER_SATISFACTION'
203+
- 'ENTITIES'
204+
- 'CUSTOMER_DEFINED'
205+
- 'SITUATION_CONCISE'
206+
- 'ACTION_CONCISE'
207+
- name: version
208+
type: String
209+
default_from_api: true
210+
description: |
211+
Optional. Version of the feature. If not set, default to latest version. Current candidates are ["1.0"].
212+
- name: outputLanguageCode
213+
type: String
214+
description: |
215+
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.
216+
- name: inferenceParameter
217+
type: NestedObject
218+
description: |
219+
Optional. Inference parameters for this generator.
220+
properties:
221+
- name: maxOutputTokens
222+
type: Integer
223+
description: |
224+
Optional. Maximum number of the output tokens for the generator.
225+
- name: temperature
226+
type: Double
227+
description: |
228+
Optional. Controls the randomness of LLM predictions. Low temperature = less random. High temperature = more random. If unset (or 0), uses a default value of 0.
229+
- name: topK
230+
type: Integer
231+
description: |
232+
Optional. Top-k changes how the model selects tokens for output. A top-k of 1 means the selected token is the most probable among all tokens in the model's vocabulary (also called greedy decoding), while a top-k of 3 means that the next token is selected from among the 3 most probable tokens (using temperature). For each token selection step, the top K tokens with the highest probabilities are sampled. Then tokens are further filtered based on topP with the final token selected using temperature sampling. Specify a lower value for less random responses and a higher value for more random responses. Acceptable value is [1, 40], default to 40.
233+
- name: topP
234+
type: Double
235+
description: |
236+
Optional. Top-p changes how the model selects tokens for output. Tokens are selected from most K (see topK parameter) probable to least until the sum of their probabilities equals the top-p value. For example, if tokens A, B, and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, then the model will select either A or B as the next token (using temperature) and doesn't consider C. The default top-p value is 0.95. Specify a lower value for less random responses and a higher value for more random responses. Acceptable value is [0.0, 1.0], default to 0.95.
237+
- name: triggerEvent
238+
type: Enum
239+
description: |
240+
Optional. The trigger event of the generator. It defines when the generator is triggered in a conversation.
241+
enum_values:
242+
- 'END_OF_UTTERANCE'
243+
- 'MANUAL_CALL'
244+
- 'CUSTOMER_MESSAGE'
245+
- 'AGENT_MESSAGE'
246+
- name: publishedModel
247+
type: String
248+
description: |
249+
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.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
resource "google_dialogflow_generator" "{{$.PrimaryResourceId}}" {
2+
location = "global"
3+
description = "A v4.0 summarization generator."
4+
inference_parameter {
5+
max_output_tokens = 1024
6+
temperature = 0
7+
top_k = 40
8+
top_p = 0.95
9+
}
10+
summarization_context {
11+
version = "4.0"
12+
output_language_code = "en"
13+
}
14+
trigger_event = "MANUAL_CALL"
15+
}

0 commit comments

Comments
 (0)