/
session.pb.go
2466 lines (2258 loc) · 115 KB
/
session.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.12.2
// source: google/cloud/dialogflow/v2/session.proto
package dialogflow
import (
context "context"
reflect "reflect"
sync "sync"
_ "google.golang.org/genproto/googleapis/api/annotations"
status "google.golang.org/genproto/googleapis/rpc/status"
latlng "google.golang.org/genproto/googleapis/type/latlng"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status1 "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
structpb "google.golang.org/protobuf/types/known/structpb"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Type of the response message.
type StreamingRecognitionResult_MessageType int32
const (
// Not specified. Should never be used.
StreamingRecognitionResult_MESSAGE_TYPE_UNSPECIFIED StreamingRecognitionResult_MessageType = 0
// Message contains a (possibly partial) transcript.
StreamingRecognitionResult_TRANSCRIPT StreamingRecognitionResult_MessageType = 1
// Event indicates that the server has detected the end of the user's speech
// utterance and expects no additional inputs.
// Therefore, the server will not process additional audio (although it may subsequently return additional results). The
// client should stop sending additional audio data, half-close the gRPC
// connection, and wait for any additional results until the server closes
// the gRPC connection. This message is only sent if `single_utterance` was
// set to `true`, and is not used otherwise.
StreamingRecognitionResult_END_OF_SINGLE_UTTERANCE StreamingRecognitionResult_MessageType = 2
)
// Enum value maps for StreamingRecognitionResult_MessageType.
var (
StreamingRecognitionResult_MessageType_name = map[int32]string{
0: "MESSAGE_TYPE_UNSPECIFIED",
1: "TRANSCRIPT",
2: "END_OF_SINGLE_UTTERANCE",
}
StreamingRecognitionResult_MessageType_value = map[string]int32{
"MESSAGE_TYPE_UNSPECIFIED": 0,
"TRANSCRIPT": 1,
"END_OF_SINGLE_UTTERANCE": 2,
}
)
func (x StreamingRecognitionResult_MessageType) Enum() *StreamingRecognitionResult_MessageType {
p := new(StreamingRecognitionResult_MessageType)
*p = x
return p
}
func (x StreamingRecognitionResult_MessageType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (StreamingRecognitionResult_MessageType) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_dialogflow_v2_session_proto_enumTypes[0].Descriptor()
}
func (StreamingRecognitionResult_MessageType) Type() protoreflect.EnumType {
return &file_google_cloud_dialogflow_v2_session_proto_enumTypes[0]
}
func (x StreamingRecognitionResult_MessageType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use StreamingRecognitionResult_MessageType.Descriptor instead.
func (StreamingRecognitionResult_MessageType) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2_session_proto_rawDescGZIP(), []int{7, 0}
}
// The request to detect user's intent.
type DetectIntentRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the session this query is sent to. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>`, or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
// default 'draft' environment (`Environment ID` might be referred to as
// environment name at some places). If `User ID` is not specified, we are
// using "-". It's up to the API caller to choose an appropriate `Session ID`
// and `User Id`. They can be a random number or some type of user and session
// identifiers (preferably hashed). The length of the `Session ID` and
// `User ID` must not exceed 36 characters.
//
// For more information, see the [API interactions
// guide](https://cloud.google.com/dialogflow/docs/api-overview).
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Session string `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
// The parameters of this query.
QueryParams *QueryParameters `protobuf:"bytes,2,opt,name=query_params,json=queryParams,proto3" json:"query_params,omitempty"`
// Required. The input specification. It can be set to:
//
// 1. an audio config
// which instructs the speech recognizer how to process the speech audio,
//
// 2. a conversational query in the form of text, or
//
// 3. an event that specifies which intent to trigger.
QueryInput *QueryInput `protobuf:"bytes,3,opt,name=query_input,json=queryInput,proto3" json:"query_input,omitempty"`
// Instructs the speech synthesizer how to generate the output
// audio. If this field is not set and agent-level speech synthesizer is not
// configured, no output audio is generated.
OutputAudioConfig *OutputAudioConfig `protobuf:"bytes,4,opt,name=output_audio_config,json=outputAudioConfig,proto3" json:"output_audio_config,omitempty"`
// Mask for [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] indicating which settings in this
// request-level config should override speech synthesizer settings defined at
// agent-level.
//
// If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] replaces the agent-level
// config in its entirety.
OutputAudioConfigMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=output_audio_config_mask,json=outputAudioConfigMask,proto3" json:"output_audio_config_mask,omitempty"`
// The natural language speech audio to be processed. This field
// should be populated iff `query_input` is set to an input audio config.
// A single request can contain up to 1 minute of speech audio data.
InputAudio []byte `protobuf:"bytes,5,opt,name=input_audio,json=inputAudio,proto3" json:"input_audio,omitempty"`
}
func (x *DetectIntentRequest) Reset() {
*x = DetectIntentRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DetectIntentRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DetectIntentRequest) ProtoMessage() {}
func (x *DetectIntentRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DetectIntentRequest.ProtoReflect.Descriptor instead.
func (*DetectIntentRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2_session_proto_rawDescGZIP(), []int{0}
}
func (x *DetectIntentRequest) GetSession() string {
if x != nil {
return x.Session
}
return ""
}
func (x *DetectIntentRequest) GetQueryParams() *QueryParameters {
if x != nil {
return x.QueryParams
}
return nil
}
func (x *DetectIntentRequest) GetQueryInput() *QueryInput {
if x != nil {
return x.QueryInput
}
return nil
}
func (x *DetectIntentRequest) GetOutputAudioConfig() *OutputAudioConfig {
if x != nil {
return x.OutputAudioConfig
}
return nil
}
func (x *DetectIntentRequest) GetOutputAudioConfigMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.OutputAudioConfigMask
}
return nil
}
func (x *DetectIntentRequest) GetInputAudio() []byte {
if x != nil {
return x.InputAudio
}
return nil
}
// The message returned from the DetectIntent method.
type DetectIntentResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The unique identifier of the response. It can be used to
// locate a response in the training example set or for reporting issues.
ResponseId string `protobuf:"bytes,1,opt,name=response_id,json=responseId,proto3" json:"response_id,omitempty"`
// The selected results of the conversational query or event processing.
// See `alternative_query_results` for additional potential results.
QueryResult *QueryResult `protobuf:"bytes,2,opt,name=query_result,json=queryResult,proto3" json:"query_result,omitempty"`
// Specifies the status of the webhook request.
WebhookStatus *status.Status `protobuf:"bytes,3,opt,name=webhook_status,json=webhookStatus,proto3" json:"webhook_status,omitempty"`
// The audio data bytes encoded as specified in the request.
// Note: The output audio is generated based on the values of default platform
// text responses found in the `query_result.fulfillment_messages` field. If
// multiple default text responses exist, they will be concatenated when
// generating audio. If no default platform text responses exist, the
// generated audio content will be empty.
//
// In some scenarios, multiple output audio fields may be present in the
// response structure. In these cases, only the top-most-level audio output
// has content.
OutputAudio []byte `protobuf:"bytes,4,opt,name=output_audio,json=outputAudio,proto3" json:"output_audio,omitempty"`
// The config used by the speech synthesizer to generate the output audio.
OutputAudioConfig *OutputAudioConfig `protobuf:"bytes,6,opt,name=output_audio_config,json=outputAudioConfig,proto3" json:"output_audio_config,omitempty"`
}
func (x *DetectIntentResponse) Reset() {
*x = DetectIntentResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DetectIntentResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DetectIntentResponse) ProtoMessage() {}
func (x *DetectIntentResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DetectIntentResponse.ProtoReflect.Descriptor instead.
func (*DetectIntentResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2_session_proto_rawDescGZIP(), []int{1}
}
func (x *DetectIntentResponse) GetResponseId() string {
if x != nil {
return x.ResponseId
}
return ""
}
func (x *DetectIntentResponse) GetQueryResult() *QueryResult {
if x != nil {
return x.QueryResult
}
return nil
}
func (x *DetectIntentResponse) GetWebhookStatus() *status.Status {
if x != nil {
return x.WebhookStatus
}
return nil
}
func (x *DetectIntentResponse) GetOutputAudio() []byte {
if x != nil {
return x.OutputAudio
}
return nil
}
func (x *DetectIntentResponse) GetOutputAudioConfig() *OutputAudioConfig {
if x != nil {
return x.OutputAudioConfig
}
return nil
}
// Represents the parameters of the conversational query.
type QueryParameters struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The time zone of this conversational query from the
// [time zone database](https://www.iana.org/time-zones), e.g.,
// America/New_York, Europe/Paris. If not provided, the time zone specified in
// agent settings is used.
TimeZone string `protobuf:"bytes,1,opt,name=time_zone,json=timeZone,proto3" json:"time_zone,omitempty"`
// The geo location of this conversational query.
GeoLocation *latlng.LatLng `protobuf:"bytes,2,opt,name=geo_location,json=geoLocation,proto3" json:"geo_location,omitempty"`
// The collection of contexts to be activated before this query is
// executed.
Contexts []*Context `protobuf:"bytes,3,rep,name=contexts,proto3" json:"contexts,omitempty"`
// Specifies whether to delete all contexts in the current session
// before the new ones are activated.
ResetContexts bool `protobuf:"varint,4,opt,name=reset_contexts,json=resetContexts,proto3" json:"reset_contexts,omitempty"`
// Additional session entity types to replace or extend developer
// entity types with. The entity synonyms apply to all languages and persist
// for the session of this query.
SessionEntityTypes []*SessionEntityType `protobuf:"bytes,5,rep,name=session_entity_types,json=sessionEntityTypes,proto3" json:"session_entity_types,omitempty"`
// This field can be used to pass custom data to your webhook.
// Arbitrary JSON objects are supported.
// If supplied, the value is used to populate the
// `WebhookRequest.original_detect_intent_request.payload`
// field sent to your webhook.
Payload *structpb.Struct `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
// Configures the type of sentiment analysis to perform. If not
// provided, sentiment analysis is not performed.
SentimentAnalysisRequestConfig *SentimentAnalysisRequestConfig `protobuf:"bytes,10,opt,name=sentiment_analysis_request_config,json=sentimentAnalysisRequestConfig,proto3" json:"sentiment_analysis_request_config,omitempty"`
// This field can be used to pass HTTP headers for a webhook
// call. These headers will be sent to webhook along with the headers that
// have been configured through the Dialogflow web console. The headers
// defined within this field will overwrite the headers configured through the
// Dialogflow console if there is a conflict. Header names are
// case-insensitive. Google's specified headers are not allowed. Including:
// "Host", "Content-Length", "Connection", "From", "User-Agent",
// "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For",
// etc.
WebhookHeaders map[string]string `protobuf:"bytes,14,rep,name=webhook_headers,json=webhookHeaders,proto3" json:"webhook_headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *QueryParameters) Reset() {
*x = QueryParameters{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QueryParameters) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QueryParameters) ProtoMessage() {}
func (x *QueryParameters) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use QueryParameters.ProtoReflect.Descriptor instead.
func (*QueryParameters) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2_session_proto_rawDescGZIP(), []int{2}
}
func (x *QueryParameters) GetTimeZone() string {
if x != nil {
return x.TimeZone
}
return ""
}
func (x *QueryParameters) GetGeoLocation() *latlng.LatLng {
if x != nil {
return x.GeoLocation
}
return nil
}
func (x *QueryParameters) GetContexts() []*Context {
if x != nil {
return x.Contexts
}
return nil
}
func (x *QueryParameters) GetResetContexts() bool {
if x != nil {
return x.ResetContexts
}
return false
}
func (x *QueryParameters) GetSessionEntityTypes() []*SessionEntityType {
if x != nil {
return x.SessionEntityTypes
}
return nil
}
func (x *QueryParameters) GetPayload() *structpb.Struct {
if x != nil {
return x.Payload
}
return nil
}
func (x *QueryParameters) GetSentimentAnalysisRequestConfig() *SentimentAnalysisRequestConfig {
if x != nil {
return x.SentimentAnalysisRequestConfig
}
return nil
}
func (x *QueryParameters) GetWebhookHeaders() map[string]string {
if x != nil {
return x.WebhookHeaders
}
return nil
}
// Represents the query input. It can contain either:
//
// 1. An audio config which
// instructs the speech recognizer how to process the speech audio.
//
// 2. A conversational query in the form of text,.
//
// 3. An event that specifies which intent to trigger.
type QueryInput struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The input specification.
//
// Types that are assignable to Input:
// *QueryInput_AudioConfig
// *QueryInput_Text
// *QueryInput_Event
Input isQueryInput_Input `protobuf_oneof:"input"`
}
func (x *QueryInput) Reset() {
*x = QueryInput{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QueryInput) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QueryInput) ProtoMessage() {}
func (x *QueryInput) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use QueryInput.ProtoReflect.Descriptor instead.
func (*QueryInput) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2_session_proto_rawDescGZIP(), []int{3}
}
func (m *QueryInput) GetInput() isQueryInput_Input {
if m != nil {
return m.Input
}
return nil
}
func (x *QueryInput) GetAudioConfig() *InputAudioConfig {
if x, ok := x.GetInput().(*QueryInput_AudioConfig); ok {
return x.AudioConfig
}
return nil
}
func (x *QueryInput) GetText() *TextInput {
if x, ok := x.GetInput().(*QueryInput_Text); ok {
return x.Text
}
return nil
}
func (x *QueryInput) GetEvent() *EventInput {
if x, ok := x.GetInput().(*QueryInput_Event); ok {
return x.Event
}
return nil
}
type isQueryInput_Input interface {
isQueryInput_Input()
}
type QueryInput_AudioConfig struct {
// Instructs the speech recognizer how to process the speech audio.
AudioConfig *InputAudioConfig `protobuf:"bytes,1,opt,name=audio_config,json=audioConfig,proto3,oneof"`
}
type QueryInput_Text struct {
// The natural language text to be processed.
Text *TextInput `protobuf:"bytes,2,opt,name=text,proto3,oneof"`
}
type QueryInput_Event struct {
// The event to be processed.
Event *EventInput `protobuf:"bytes,3,opt,name=event,proto3,oneof"`
}
func (*QueryInput_AudioConfig) isQueryInput_Input() {}
func (*QueryInput_Text) isQueryInput_Input() {}
func (*QueryInput_Event) isQueryInput_Input() {}
// Represents the result of conversational query or event processing.
type QueryResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The original conversational query text:
//
// - If natural language text was provided as input, `query_text` contains
// a copy of the input.
// - If natural language speech audio was provided as input, `query_text`
// contains the speech recognition result. If speech recognizer produced
// multiple alternatives, a particular one is picked.
// - If automatic spell correction is enabled, `query_text` will contain the
// corrected user input.
QueryText string `protobuf:"bytes,1,opt,name=query_text,json=queryText,proto3" json:"query_text,omitempty"`
// The language that was triggered during intent detection.
// See [Language
// Support](https://cloud.google.com/dialogflow/docs/reference/language)
// for a list of the currently supported language codes.
LanguageCode string `protobuf:"bytes,15,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"`
// The Speech recognition confidence between 0.0 and 1.0. A higher number
// indicates an estimated greater likelihood that the recognized words are
// correct. The default of 0.0 is a sentinel value indicating that confidence
// was not set.
//
// This field is not guaranteed to be accurate or set. In particular this
// field isn't set for StreamingDetectIntent since the streaming endpoint has
// separate confidence estimates per portion of the audio in
// StreamingRecognitionResult.
SpeechRecognitionConfidence float32 `protobuf:"fixed32,2,opt,name=speech_recognition_confidence,json=speechRecognitionConfidence,proto3" json:"speech_recognition_confidence,omitempty"`
// The action name from the matched intent.
Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"`
// The collection of extracted parameters.
//
// Depending on your protocol or client library language, this is a
// map, associative array, symbol table, dictionary, or JSON object
// composed of a collection of (MapKey, MapValue) pairs:
//
// - MapKey type: string
// - MapKey value: parameter name
// - MapValue type:
// - If parameter's entity type is a composite entity: map
// - Else: depending on parameter value type, could be one of string,
// number, boolean, null, list or map
// - MapValue value:
// - If parameter's entity type is a composite entity:
// map from composite entity property names to property values
// - Else: parameter value
Parameters *structpb.Struct `protobuf:"bytes,4,opt,name=parameters,proto3" json:"parameters,omitempty"`
// This field is set to:
//
// - `false` if the matched intent has required parameters and not all of
// the required parameter values have been collected.
// - `true` if all required parameter values have been collected, or if the
// matched intent doesn't contain any required parameters.
AllRequiredParamsPresent bool `protobuf:"varint,5,opt,name=all_required_params_present,json=allRequiredParamsPresent,proto3" json:"all_required_params_present,omitempty"`
// Indicates whether the conversational query triggers a cancellation for slot
// filling.
CancelsSlotFilling bool `protobuf:"varint,21,opt,name=cancels_slot_filling,json=cancelsSlotFilling,proto3" json:"cancels_slot_filling,omitempty"`
// The text to be pronounced to the user or shown on the screen.
// Note: This is a legacy field, `fulfillment_messages` should be preferred.
FulfillmentText string `protobuf:"bytes,6,opt,name=fulfillment_text,json=fulfillmentText,proto3" json:"fulfillment_text,omitempty"`
// The collection of rich messages to present to the user.
FulfillmentMessages []*Intent_Message `protobuf:"bytes,7,rep,name=fulfillment_messages,json=fulfillmentMessages,proto3" json:"fulfillment_messages,omitempty"`
// If the query was fulfilled by a webhook call, this field is set to the
// value of the `source` field returned in the webhook response.
WebhookSource string `protobuf:"bytes,8,opt,name=webhook_source,json=webhookSource,proto3" json:"webhook_source,omitempty"`
// If the query was fulfilled by a webhook call, this field is set to the
// value of the `payload` field returned in the webhook response.
WebhookPayload *structpb.Struct `protobuf:"bytes,9,opt,name=webhook_payload,json=webhookPayload,proto3" json:"webhook_payload,omitempty"`
// The collection of output contexts. If applicable,
// `output_contexts.parameters` contains entries with name
// `<parameter name>.original` containing the original parameter values
// before the query.
OutputContexts []*Context `protobuf:"bytes,10,rep,name=output_contexts,json=outputContexts,proto3" json:"output_contexts,omitempty"`
// The intent that matched the conversational query. Some, not
// all fields are filled in this message, including but not limited to:
// `name`, `display_name`, `end_interaction` and `is_fallback`.
Intent *Intent `protobuf:"bytes,11,opt,name=intent,proto3" json:"intent,omitempty"`
// The intent detection confidence. Values range from 0.0
// (completely uncertain) to 1.0 (completely certain).
// This value is for informational purpose only and is only used to
// help match the best intent within the classification threshold.
// This value may change for the same end-user expression at any time due to a
// model retraining or change in implementation.
// If there are `multiple knowledge_answers` messages, this value is set to
// the greatest `knowledgeAnswers.match_confidence` value in the list.
IntentDetectionConfidence float32 `protobuf:"fixed32,12,opt,name=intent_detection_confidence,json=intentDetectionConfidence,proto3" json:"intent_detection_confidence,omitempty"`
// Free-form diagnostic information for the associated detect intent request.
// The fields of this data can change without notice, so you should not write
// code that depends on its structure.
// The data may contain:
//
// - webhook call latency
// - webhook errors
DiagnosticInfo *structpb.Struct `protobuf:"bytes,14,opt,name=diagnostic_info,json=diagnosticInfo,proto3" json:"diagnostic_info,omitempty"`
// The sentiment analysis result, which depends on the
// `sentiment_analysis_request_config` specified in the request.
SentimentAnalysisResult *SentimentAnalysisResult `protobuf:"bytes,17,opt,name=sentiment_analysis_result,json=sentimentAnalysisResult,proto3" json:"sentiment_analysis_result,omitempty"`
}
func (x *QueryResult) Reset() {
*x = QueryResult{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QueryResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QueryResult) ProtoMessage() {}
func (x *QueryResult) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use QueryResult.ProtoReflect.Descriptor instead.
func (*QueryResult) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2_session_proto_rawDescGZIP(), []int{4}
}
func (x *QueryResult) GetQueryText() string {
if x != nil {
return x.QueryText
}
return ""
}
func (x *QueryResult) GetLanguageCode() string {
if x != nil {
return x.LanguageCode
}
return ""
}
func (x *QueryResult) GetSpeechRecognitionConfidence() float32 {
if x != nil {
return x.SpeechRecognitionConfidence
}
return 0
}
func (x *QueryResult) GetAction() string {
if x != nil {
return x.Action
}
return ""
}
func (x *QueryResult) GetParameters() *structpb.Struct {
if x != nil {
return x.Parameters
}
return nil
}
func (x *QueryResult) GetAllRequiredParamsPresent() bool {
if x != nil {
return x.AllRequiredParamsPresent
}
return false
}
func (x *QueryResult) GetCancelsSlotFilling() bool {
if x != nil {
return x.CancelsSlotFilling
}
return false
}
func (x *QueryResult) GetFulfillmentText() string {
if x != nil {
return x.FulfillmentText
}
return ""
}
func (x *QueryResult) GetFulfillmentMessages() []*Intent_Message {
if x != nil {
return x.FulfillmentMessages
}
return nil
}
func (x *QueryResult) GetWebhookSource() string {
if x != nil {
return x.WebhookSource
}
return ""
}
func (x *QueryResult) GetWebhookPayload() *structpb.Struct {
if x != nil {
return x.WebhookPayload
}
return nil
}
func (x *QueryResult) GetOutputContexts() []*Context {
if x != nil {
return x.OutputContexts
}
return nil
}
func (x *QueryResult) GetIntent() *Intent {
if x != nil {
return x.Intent
}
return nil
}
func (x *QueryResult) GetIntentDetectionConfidence() float32 {
if x != nil {
return x.IntentDetectionConfidence
}
return 0
}
func (x *QueryResult) GetDiagnosticInfo() *structpb.Struct {
if x != nil {
return x.DiagnosticInfo
}
return nil
}
func (x *QueryResult) GetSentimentAnalysisResult() *SentimentAnalysisResult {
if x != nil {
return x.SentimentAnalysisResult
}
return nil
}
// The top-level message sent by the client to the
// [Sessions.StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent] method.
//
// Multiple request messages should be sent in order:
//
// 1. The first message must contain
// [session][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.session],
// [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input] plus optionally
// [query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params]. If the client
// wants to receive an audio response, it should also contain
// [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config].
// The message must not contain
// [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio].
// 2. If [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input] was set to
// [query_input.audio_config][google.cloud.dialogflow.v2.InputAudioConfig], all subsequent
// messages must contain
// [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio] to continue with
// Speech recognition.
// If you decide to rather detect an intent from text input after you
// already started Speech recognition, please send a message with
// [query_input.text][google.cloud.dialogflow.v2.QueryInput.text].
//
// However, note that:
//
// * Dialogflow will bill you for the audio duration so far.
// * Dialogflow discards all Speech recognition results in favor of the
// input text.
// * Dialogflow will use the language code from the first message.
//
// After you sent all input, you must half-close or abort the request stream.
type StreamingDetectIntentRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the session the query is sent to.
// Format of the session name:
// `projects/<Project ID>/agent/sessions/<Session ID>`, or
// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
// ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
// default 'draft' environment. If `User ID` is not specified, we are using
// "-". It's up to the API caller to choose an appropriate `Session ID` and
// `User Id`. They can be a random number or some type of user and session
// identifiers (preferably hashed). The length of the `Session ID` and
// `User ID` must not exceed 36 characters.
//
// For more information, see the [API interactions
// guide](https://cloud.google.com/dialogflow/docs/api-overview).
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Session string `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
// The parameters of this query.
QueryParams *QueryParameters `protobuf:"bytes,2,opt,name=query_params,json=queryParams,proto3" json:"query_params,omitempty"`
// Required. The input specification. It can be set to:
//
// 1. an audio config which instructs the speech recognizer how to process
// the speech audio,
//
// 2. a conversational query in the form of text, or
//
// 3. an event that specifies which intent to trigger.
QueryInput *QueryInput `protobuf:"bytes,3,opt,name=query_input,json=queryInput,proto3" json:"query_input,omitempty"`
// Please use [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] instead.
// If `false` (default), recognition does not cease until
// the client closes the stream. If `true`, the recognizer will detect a
// single spoken utterance in input audio. Recognition ceases when it detects
// the audio's voice has stopped or paused. In this case, once a detected
// intent is received, the client should close the stream and start a new
// request with a new stream as needed.
// This setting is ignored when `query_input` is a piece of text or an event.
//
// Deprecated: Do not use.
SingleUtterance bool `protobuf:"varint,4,opt,name=single_utterance,json=singleUtterance,proto3" json:"single_utterance,omitempty"`
// Instructs the speech synthesizer how to generate the output
// audio. If this field is not set and agent-level speech synthesizer is not
// configured, no output audio is generated.
OutputAudioConfig *OutputAudioConfig `protobuf:"bytes,5,opt,name=output_audio_config,json=outputAudioConfig,proto3" json:"output_audio_config,omitempty"`
// Mask for [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] indicating which settings in this
// request-level config should override speech synthesizer settings defined at
// agent-level.
//
// If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] replaces the agent-level
// config in its entirety.
OutputAudioConfigMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=output_audio_config_mask,json=outputAudioConfigMask,proto3" json:"output_audio_config_mask,omitempty"`
// The input audio content to be recognized. Must be sent if
// `query_input` was set to a streaming input audio config. The complete audio
// over all streaming messages must not exceed 1 minute.
InputAudio []byte `protobuf:"bytes,6,opt,name=input_audio,json=inputAudio,proto3" json:"input_audio,omitempty"`
}
func (x *StreamingDetectIntentRequest) Reset() {
*x = StreamingDetectIntentRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StreamingDetectIntentRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StreamingDetectIntentRequest) ProtoMessage() {}
func (x *StreamingDetectIntentRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2_session_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StreamingDetectIntentRequest.ProtoReflect.Descriptor instead.
func (*StreamingDetectIntentRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2_session_proto_rawDescGZIP(), []int{5}
}
func (x *StreamingDetectIntentRequest) GetSession() string {
if x != nil {
return x.Session
}
return ""
}
func (x *StreamingDetectIntentRequest) GetQueryParams() *QueryParameters {
if x != nil {
return x.QueryParams
}
return nil
}
func (x *StreamingDetectIntentRequest) GetQueryInput() *QueryInput {
if x != nil {
return x.QueryInput
}
return nil
}
// Deprecated: Do not use.
func (x *StreamingDetectIntentRequest) GetSingleUtterance() bool {
if x != nil {
return x.SingleUtterance
}
return false
}
func (x *StreamingDetectIntentRequest) GetOutputAudioConfig() *OutputAudioConfig {
if x != nil {
return x.OutputAudioConfig
}
return nil
}
func (x *StreamingDetectIntentRequest) GetOutputAudioConfigMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.OutputAudioConfigMask
}
return nil
}
func (x *StreamingDetectIntentRequest) GetInputAudio() []byte {
if x != nil {
return x.InputAudio
}
return nil
}
// The top-level message returned from the
// `StreamingDetectIntent` method.
//
// Multiple response messages can be returned in order:
//
// 1. If the input was set to streaming audio, the first one or more messages
// contain `recognition_result`. Each `recognition_result` represents a more
// complete transcript of what the user said. The last `recognition_result`
// has `is_final` set to `true`.
//
// 2. The next message contains `response_id`, `query_result`
// and optionally `webhook_status` if a WebHook was called.
type StreamingDetectIntentResponse struct {