Skip to content

Commit 7a595fd

Browse files
Google APIscopybara-github
authored andcommitted
feat: updated v2 dialogflow client libraries
docs: updated v2 dialogflow client libraries PiperOrigin-RevId: 843703774
1 parent 05f6595 commit 7a595fd

19 files changed

+2188
-33
lines changed

google/cloud/dialogflow/v2/BUILD.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ proto_library(
2525
name = "dialogflow_proto",
2626
srcs = [
2727
"agent.proto",
28+
"agent_coaching_instruction.proto",
2829
"answer_record.proto",
2930
"audio_config.proto",
3031
"context.proto",
@@ -40,12 +41,17 @@ proto_library(
4041
"fulfillment.proto",
4142
"gcs.proto",
4243
"generator.proto",
44+
"generator_evaluation.proto",
4345
"human_agent_assistant_event.proto",
4446
"intent.proto",
4547
"knowledge_base.proto",
48+
"operations.proto",
4649
"participant.proto",
4750
"session.proto",
4851
"session_entity_type.proto",
52+
"sip_trunk.proto",
53+
"tool.proto",
54+
"tool_call.proto",
4955
"validation_result.proto",
5056
"version.proto",
5157
"webhook.proto",
@@ -145,6 +151,8 @@ java_gapic_test(
145151
"com.google.cloud.dialogflow.v2.EnvironmentsClientTest",
146152
"com.google.cloud.dialogflow.v2.FulfillmentsClientHttpJsonTest",
147153
"com.google.cloud.dialogflow.v2.FulfillmentsClientTest",
154+
"com.google.cloud.dialogflow.v2.GeneratorEvaluationsClientHttpJsonTest",
155+
"com.google.cloud.dialogflow.v2.GeneratorEvaluationsClientTest",
148156
"com.google.cloud.dialogflow.v2.GeneratorsClientHttpJsonTest",
149157
"com.google.cloud.dialogflow.v2.GeneratorsClientTest",
150158
"com.google.cloud.dialogflow.v2.IntentsClientHttpJsonTest",
@@ -157,6 +165,10 @@ java_gapic_test(
157165
"com.google.cloud.dialogflow.v2.SessionEntityTypesClientTest",
158166
"com.google.cloud.dialogflow.v2.SessionsClientHttpJsonTest",
159167
"com.google.cloud.dialogflow.v2.SessionsClientTest",
168+
"com.google.cloud.dialogflow.v2.SipTrunksClientHttpJsonTest",
169+
"com.google.cloud.dialogflow.v2.SipTrunksClientTest",
170+
"com.google.cloud.dialogflow.v2.ToolsClientHttpJsonTest",
171+
"com.google.cloud.dialogflow.v2.ToolsClientTest",
160172
"com.google.cloud.dialogflow.v2.VersionsClientHttpJsonTest",
161173
"com.google.cloud.dialogflow.v2.VersionsClientTest",
162174
],
@@ -411,6 +423,7 @@ load(
411423

412424
csharp_proto_library(
413425
name = "dialogflow_csharp_proto",
426+
extra_opts = [],
414427
deps = [":dialogflow_proto"],
415428
)
416429

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.dialogflow.v2;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
22+
option go_package = "cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "AgentCoachingInstructionProto";
25+
option java_package = "com.google.cloud.dialogflow.v2";
26+
option objc_class_prefix = "DF";
27+
28+
// Agent Coaching instructions that customer can configure.
29+
message AgentCoachingInstruction {
30+
// Duplication check for the suggestion.
31+
message DuplicateCheckResult {
32+
// The duplicate suggestion details.
33+
message DuplicateSuggestion {
34+
// Output only. The answer record id of the past duplicate suggestion.
35+
string answer_record = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
36+
37+
// Output only. The index of the duplicate suggestion in the past
38+
// suggestion list.
39+
int32 suggestion_index = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
40+
41+
// Output only. The similarity score of between the past and current
42+
// suggestion.
43+
float similarity_score = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
44+
}
45+
46+
// Output only. The duplicate suggestions.
47+
repeated DuplicateSuggestion duplicate_suggestions = 1
48+
[(google.api.field_behavior) = OUTPUT_ONLY];
49+
}
50+
51+
// The event that should trigger this instruction.
52+
enum TriggerEvent {
53+
// Default value for TriggerEvent.
54+
TRIGGER_EVENT_UNSPECIFIED = 0;
55+
56+
// Triggers when each chat message or voice utterance ends.
57+
END_OF_UTTERANCE = 1;
58+
59+
// Triggers on the conversation manually by API calls.
60+
MANUAL_CALL = 2;
61+
62+
// Triggers after each customer message.
63+
CUSTOMER_MESSAGE = 3;
64+
65+
// Triggers after each agent message.
66+
AGENT_MESSAGE = 4;
67+
68+
// Triggers on tool call completion.
69+
TOOL_CALL_COMPLETION = 5;
70+
}
71+
72+
// Optional. Display name for the instruction.
73+
string display_name = 1 [(google.api.field_behavior) = OPTIONAL];
74+
75+
// Optional. The detailed description of this instruction.
76+
string display_details = 2 [(google.api.field_behavior) = OPTIONAL];
77+
78+
// Optional. The condition of the instruction. For example, "the customer
79+
// wants to cancel an order". If the users want the instruction to be
80+
// triggered unconditionally, the condition can be empty.
81+
string condition = 3 [(google.api.field_behavior) = OPTIONAL];
82+
83+
// Optional. The action that human agent should take. For example, "apologize
84+
// for the slow shipping". If the users only want to use agent coaching for
85+
// intent detection, agent_action can be empty
86+
string agent_action = 4 [(google.api.field_behavior) = OPTIONAL];
87+
88+
// Optional. The action that system should take. For example,
89+
// "call GetOrderTime with order_number={order number provided by the
90+
// customer}". If the users don't have plugins or don't want to trigger
91+
// plugins, the system_action can be empty
92+
string system_action = 5 [(google.api.field_behavior) = OPTIONAL];
93+
94+
// Output only. Duplication check for the AgentCoachingInstruction.
95+
DuplicateCheckResult duplicate_check_result = 8
96+
[(google.api.field_behavior) = OUTPUT_ONLY];
97+
98+
// Optional. The event that should trigger this instruction.
99+
// If UNSPECIFIED, the instruction triggering will be same as the generator's
100+
// trigger_event.
101+
TriggerEvent triggering_event = 10 [(google.api.field_behavior) = OPTIONAL];
102+
}

google/cloud/dialogflow/v2/answer_record.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
23+
import "google/cloud/dialogflow/v2/generator.proto";
2324
import "google/cloud/dialogflow/v2/participant.proto";
2425
import "google/protobuf/field_mask.proto";
2526
import "google/protobuf/timestamp.proto";
@@ -377,5 +378,9 @@ message AgentAssistantRecord {
377378
// Output only. Dialogflow assist answer.
378379
DialogflowAssistAnswer dialogflow_assist_answer = 7
379380
[(google.api.field_behavior) = OUTPUT_ONLY];
381+
382+
// Output only. The generator suggestion.
383+
GeneratorSuggestion generator_suggestion = 8
384+
[(google.api.field_behavior) = OUTPUT_ONLY];
380385
}
381386
}

google/cloud/dialogflow/v2/audio_config.proto

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ message InputAudioConfig {
106106
// Support](https://cloud.google.com/dialogflow/docs/reference/language)
107107
// for a list of the currently supported language codes. Note that queries in
108108
// the same session do not necessarily need to specify the same language.
109+
// If not set, the language is inferred from the
110+
// [ConversationProfile.stt_config][google.cloud.dialogflow.v2.ConversationProfile.stt_config].
109111
string language_code = 3 [(google.api.field_behavior) = REQUIRED];
110112

111113
// If `true`, Dialogflow returns
@@ -226,6 +228,39 @@ message SynthesizeSpeechConfig {
226228

227229
// Optional. The desired voice of the synthesized audio.
228230
VoiceSelectionParams voice = 4 [(google.api.field_behavior) = OPTIONAL];
231+
232+
// Optional. The custom pronunciations for the synthesized audio.
233+
repeated CustomPronunciationParams pronunciations = 6
234+
[(google.api.field_behavior) = OPTIONAL];
235+
}
236+
237+
// Pronunciation customization for a phrase.
238+
message CustomPronunciationParams {
239+
// The phonetic encoding of the phrase.
240+
enum PhoneticEncoding {
241+
// Not specified.
242+
PHONETIC_ENCODING_UNSPECIFIED = 0;
243+
244+
// IPA, such as apple -> ˈæpəl.
245+
// https://en.wikipedia.org/wiki/International_Phonetic_Alphabet
246+
PHONETIC_ENCODING_IPA = 1;
247+
248+
// X-SAMPA, such as apple -> "{p@l".
249+
// https://en.wikipedia.org/wiki/X-SAMPA
250+
PHONETIC_ENCODING_X_SAMPA = 2;
251+
}
252+
253+
// The phrase to which the customization is applied.
254+
// The phrase can be multiple words, such as proper nouns, but shouldn't span
255+
// the length of the sentence.
256+
string phrase = 1;
257+
258+
// The phonetic encoding of the phrase.
259+
PhoneticEncoding phonetic_encoding = 2;
260+
261+
// The pronunciation of the phrase. This must be in the phonetic encoding
262+
// specified above.
263+
string pronunciation = 3;
229264
}
230265

231266
// Instructs the speech synthesizer on how to generate the output audio content.
@@ -312,6 +347,9 @@ message SpeechToTextConfig {
312347
// Support](https://cloud.google.com/dialogflow/docs/reference/language)
313348
// for a list of the currently supported language codes. Note that queries in
314349
// the same session do not necessarily need to specify the same language.
350+
// If not specified, the default language configured at
351+
// [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] is
352+
// used.
315353
string language_code = 8;
316354

317355
// If `true`, Dialogflow returns

google/cloud/dialogflow/v2/conversation.proto

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ option (google.api.resource_definition) = {
3838
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}"
3939
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}"
4040
};
41+
option (google.api.resource_definition) = {
42+
type: "ces.googleapis.com/Tool"
43+
pattern: "projects/{project}/locations/{location}/apps/{app}/tools/{tool}"
44+
};
4145

4246
// Service for managing
4347
// [Conversations][google.cloud.dialogflow.v2.Conversation].
@@ -287,8 +291,9 @@ message Conversation {
287291
// Output only. The number dialed to connect this call in E.164 format.
288292
string dialed_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
289293

290-
// Optional. SDP of the call. It's initially the SDP answer to the endpoint,
291-
// but maybe later updated for the purpose of making the link active, etc.
294+
// Optional. SDP of the call. It's initially the SDP answer to the incoming
295+
// call, but maybe later updated for the purpose of making the link active,
296+
// etc.
292297
string sdp = 5 [(google.api.field_behavior) = OPTIONAL];
293298

294299
// Output only. The SIP headers from the initial SIP INVITE.
@@ -326,6 +331,12 @@ message Conversation {
326331
// relevant context reference.
327332
google.protobuf.Timestamp ingestion_time = 3
328333
[(google.api.field_behavior) = OUTPUT_ONLY];
334+
335+
// If the context content was generated from a tool call, specify the
336+
// answer record associated with the tool call.
337+
// Format: `projects/<Project ID>/locations/<Location
338+
// ID>/answerRecords/<Answer Record ID>`.
339+
string answer_record = 4;
329340
}
330341

331342
// Represents the mode in which context reference contents are updated.
@@ -806,6 +817,16 @@ message GenerateStatelessSuggestionRequest {
806817
// it's trigger event is included here.
807818
repeated TriggerEvent trigger_events = 6
808819
[(google.api.field_behavior) = OPTIONAL];
820+
821+
// Optional. Name of the CX SecuritySettings which is used to redact generated
822+
// response. If this field is empty, try to fetch v2 security_settings, which
823+
// is a project level setting. If this field is empty and no v2
824+
// security_settings set up in this project, no redaction will be done.
825+
//
826+
// Format:
827+
// `projects/<Project ID>/locations/<Location ID>/securitySettings/<Security
828+
// Settings ID>`.
829+
string security_settings = 8 [(google.api.field_behavior) = OPTIONAL];
809830
}
810831

811832
// The response message for

google/cloud/dialogflow/v2/conversation_event.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ syntax = "proto3";
1616

1717
package google.cloud.dialogflow.v2;
1818

19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
1921
import "google/cloud/dialogflow/v2/participant.proto";
2022
import "google/cloud/dialogflow/v2/session.proto";
2123
import "google/rpc/status.proto";
@@ -41,6 +43,8 @@ message ConversationEvent {
4143

4244
// An existing conversation has closed. This is fired when a telephone call
4345
// is terminated, or a conversation is closed via the API.
46+
// The event is fired for every CompleteConversation call, even if the
47+
// conversation is already closed.
4448
CONVERSATION_FINISHED = 2;
4549

4650
// An existing conversation has received notification from Dialogflow that

google/cloud/dialogflow/v2/conversation_model.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,9 @@ message CreateConversationModelOperationMetadata {
628628
// Timestamp when the request to create conversation model is submitted. The
629629
// time is measured on server side.
630630
google.protobuf.Timestamp create_time = 3;
631+
632+
// The time when the operation finished.
633+
google.protobuf.Timestamp done_time = 7;
631634
}
632635

633636
// Metadata for a
@@ -641,6 +644,9 @@ message DeployConversationModelOperationMetadata {
641644
// Timestamp when request to deploy conversation model was submitted. The time
642645
// is measured on server side.
643646
google.protobuf.Timestamp create_time = 3;
647+
648+
// The time when the operation finished.
649+
google.protobuf.Timestamp done_time = 4;
644650
}
645651

646652
// Metadata for a
@@ -654,6 +660,9 @@ message UndeployConversationModelOperationMetadata {
654660
// Timestamp when the request to undeploy conversation model was submitted.
655661
// The time is measured on server side.
656662
google.protobuf.Timestamp create_time = 3;
663+
664+
// The time when the operation finished.
665+
google.protobuf.Timestamp done_time = 4;
657666
}
658667

659668
// Metadata for a
@@ -667,6 +676,9 @@ message DeleteConversationModelOperationMetadata {
667676
// Timestamp when delete conversation model request was created. The time is
668677
// measured on server side.
669678
google.protobuf.Timestamp create_time = 3;
679+
680+
// The time when the operation finished.
681+
google.protobuf.Timestamp done_time = 4;
670682
}
671683

672684
// Metadata for a

0 commit comments

Comments
 (0)