forked from googleapis/go-genproto
/
session.pb.go
1247 lines (1128 loc) · 51.8 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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/cloud/dialogflow/v2beta1/session.proto
package dialogflow
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import google_protobuf4 "github.com/golang/protobuf/ptypes/struct"
import google_rpc "google.golang.org/genproto/googleapis/rpc/status"
import google_type "google.golang.org/genproto/googleapis/type/latlng"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Audio encoding of the audio content sent in the conversational query request.
// Refer to the [Cloud Speech API documentation](/speech/docs/basics) for more
// details.
type AudioEncoding int32
const (
// Not specified.
AudioEncoding_AUDIO_ENCODING_UNSPECIFIED AudioEncoding = 0
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
AudioEncoding_AUDIO_ENCODING_LINEAR_16 AudioEncoding = 1
// [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
// Codec) is the recommended encoding because it is lossless (therefore
// recognition is not compromised) and requires only about half the
// bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
// 24-bit samples, however, not all fields in `STREAMINFO` are supported.
AudioEncoding_AUDIO_ENCODING_FLAC AudioEncoding = 2
// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
AudioEncoding_AUDIO_ENCODING_MULAW AudioEncoding = 3
// Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
AudioEncoding_AUDIO_ENCODING_AMR AudioEncoding = 4
// Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
AudioEncoding_AUDIO_ENCODING_AMR_WB AudioEncoding = 5
// Opus encoded audio frames in Ogg container
// ([OggOpus](https://wiki.xiph.org/OggOpus)).
// `sample_rate_hertz` must be 16000.
AudioEncoding_AUDIO_ENCODING_OGG_OPUS AudioEncoding = 6
// Although the use of lossy encodings is not recommended, if a very low
// bitrate encoding is required, `OGG_OPUS` is highly preferred over
// Speex encoding. The [Speex](https://speex.org/) encoding supported by
// Dialogflow API has a header byte in each block, as in MIME type
// `audio/x-speex-with-header-byte`.
// It is a variant of the RTP Speex encoding defined in
// [RFC 5574](https://tools.ietf.org/html/rfc5574).
// The stream is a sequence of blocks, one block per RTP packet. Each block
// starts with a byte containing the length of the block, in bytes, followed
// by one or more frames of Speex data, padded to an integral number of
// bytes (octets) as specified in RFC 5574. In other words, each RTP header
// is replaced with a single byte containing the block length. Only Speex
// wideband is supported. `sample_rate_hertz` must be 16000.
AudioEncoding_AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE AudioEncoding = 7
)
var AudioEncoding_name = map[int32]string{
0: "AUDIO_ENCODING_UNSPECIFIED",
1: "AUDIO_ENCODING_LINEAR_16",
2: "AUDIO_ENCODING_FLAC",
3: "AUDIO_ENCODING_MULAW",
4: "AUDIO_ENCODING_AMR",
5: "AUDIO_ENCODING_AMR_WB",
6: "AUDIO_ENCODING_OGG_OPUS",
7: "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE",
}
var AudioEncoding_value = map[string]int32{
"AUDIO_ENCODING_UNSPECIFIED": 0,
"AUDIO_ENCODING_LINEAR_16": 1,
"AUDIO_ENCODING_FLAC": 2,
"AUDIO_ENCODING_MULAW": 3,
"AUDIO_ENCODING_AMR": 4,
"AUDIO_ENCODING_AMR_WB": 5,
"AUDIO_ENCODING_OGG_OPUS": 6,
"AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7,
}
func (x AudioEncoding) String() string {
return proto.EnumName(AudioEncoding_name, int32(x))
}
func (AudioEncoding) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
// 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 speech. 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
)
var StreamingRecognitionResult_MessageType_name = map[int32]string{
0: "MESSAGE_TYPE_UNSPECIFIED",
1: "TRANSCRIPT",
2: "END_OF_SINGLE_UTTERANCE",
}
var StreamingRecognitionResult_MessageType_value = map[string]int32{
"MESSAGE_TYPE_UNSPECIFIED": 0,
"TRANSCRIPT": 1,
"END_OF_SINGLE_UTTERANCE": 2,
}
func (x StreamingRecognitionResult_MessageType) String() string {
return proto.EnumName(StreamingRecognitionResult_MessageType_name, int32(x))
}
func (StreamingRecognitionResult_MessageType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor4, []int{7, 0}
}
// The request to detect user's intent.
type DetectIntentRequest struct {
// Required. The name of the session this query is sent to. Format:
// `projects/<Project ID>/agent/sessions/<Session ID>`.
// It's up to the API caller to choose an appropriate session ID. It can be
// a random number or some type of user identifier (preferably hashed).
// The length of the session ID must not exceed 36 bytes.
Session string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"`
// Optional. The parameters of this query.
QueryParams *QueryParameters `protobuf:"bytes,2,opt,name=query_params,json=queryParams" 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" json:"query_input,omitempty"`
// Optional. 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 (m *DetectIntentRequest) Reset() { *m = DetectIntentRequest{} }
func (m *DetectIntentRequest) String() string { return proto.CompactTextString(m) }
func (*DetectIntentRequest) ProtoMessage() {}
func (*DetectIntentRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
func (m *DetectIntentRequest) GetSession() string {
if m != nil {
return m.Session
}
return ""
}
func (m *DetectIntentRequest) GetQueryParams() *QueryParameters {
if m != nil {
return m.QueryParams
}
return nil
}
func (m *DetectIntentRequest) GetQueryInput() *QueryInput {
if m != nil {
return m.QueryInput
}
return nil
}
func (m *DetectIntentRequest) GetInputAudio() []byte {
if m != nil {
return m.InputAudio
}
return nil
}
// The message returned from the DetectIntent method.
type DetectIntentResponse struct {
// 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" json:"response_id,omitempty"`
// The results of the conversational query or event processing.
QueryResult *QueryResult `protobuf:"bytes,2,opt,name=query_result,json=queryResult" json:"query_result,omitempty"`
// Specifies the status of the webhook request. `webhook_status`
// is never populated in webhook requests.
WebhookStatus *google_rpc.Status `protobuf:"bytes,3,opt,name=webhook_status,json=webhookStatus" json:"webhook_status,omitempty"`
}
func (m *DetectIntentResponse) Reset() { *m = DetectIntentResponse{} }
func (m *DetectIntentResponse) String() string { return proto.CompactTextString(m) }
func (*DetectIntentResponse) ProtoMessage() {}
func (*DetectIntentResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} }
func (m *DetectIntentResponse) GetResponseId() string {
if m != nil {
return m.ResponseId
}
return ""
}
func (m *DetectIntentResponse) GetQueryResult() *QueryResult {
if m != nil {
return m.QueryResult
}
return nil
}
func (m *DetectIntentResponse) GetWebhookStatus() *google_rpc.Status {
if m != nil {
return m.WebhookStatus
}
return nil
}
// Represents the parameters of the conversational query.
type QueryParameters struct {
// Optional. 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" json:"time_zone,omitempty"`
// Optional. The geo location of this conversational query.
GeoLocation *google_type.LatLng `protobuf:"bytes,2,opt,name=geo_location,json=geoLocation" json:"geo_location,omitempty"`
// Optional. The collection of contexts to be activated before this query is
// executed.
Contexts []*Context `protobuf:"bytes,3,rep,name=contexts" json:"contexts,omitempty"`
// Optional. 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" json:"reset_contexts,omitempty"`
// Optional. The collection of session entity types to replace or extend
// developer entities with for this query only. The entity synonyms apply
// to all languages.
SessionEntityTypes []*SessionEntityType `protobuf:"bytes,5,rep,name=session_entity_types,json=sessionEntityTypes" json:"session_entity_types,omitempty"`
// Optional. This field can be used to pass custom data into the webhook
// associated with the agent. Arbitrary JSON objects are supported.
Payload *google_protobuf4.Struct `protobuf:"bytes,6,opt,name=payload" json:"payload,omitempty"`
}
func (m *QueryParameters) Reset() { *m = QueryParameters{} }
func (m *QueryParameters) String() string { return proto.CompactTextString(m) }
func (*QueryParameters) ProtoMessage() {}
func (*QueryParameters) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} }
func (m *QueryParameters) GetTimeZone() string {
if m != nil {
return m.TimeZone
}
return ""
}
func (m *QueryParameters) GetGeoLocation() *google_type.LatLng {
if m != nil {
return m.GeoLocation
}
return nil
}
func (m *QueryParameters) GetContexts() []*Context {
if m != nil {
return m.Contexts
}
return nil
}
func (m *QueryParameters) GetResetContexts() bool {
if m != nil {
return m.ResetContexts
}
return false
}
func (m *QueryParameters) GetSessionEntityTypes() []*SessionEntityType {
if m != nil {
return m.SessionEntityTypes
}
return nil
}
func (m *QueryParameters) GetPayload() *google_protobuf4.Struct {
if m != nil {
return m.Payload
}
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 {
// Required. The input specification.
//
// Types that are valid to be assigned to Input:
// *QueryInput_AudioConfig
// *QueryInput_Text
// *QueryInput_Event
Input isQueryInput_Input `protobuf_oneof:"input"`
}
func (m *QueryInput) Reset() { *m = QueryInput{} }
func (m *QueryInput) String() string { return proto.CompactTextString(m) }
func (*QueryInput) ProtoMessage() {}
func (*QueryInput) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} }
type isQueryInput_Input interface {
isQueryInput_Input()
}
type QueryInput_AudioConfig struct {
AudioConfig *InputAudioConfig `protobuf:"bytes,1,opt,name=audio_config,json=audioConfig,oneof"`
}
type QueryInput_Text struct {
Text *TextInput `protobuf:"bytes,2,opt,name=text,oneof"`
}
type QueryInput_Event struct {
Event *EventInput `protobuf:"bytes,3,opt,name=event,oneof"`
}
func (*QueryInput_AudioConfig) isQueryInput_Input() {}
func (*QueryInput_Text) isQueryInput_Input() {}
func (*QueryInput_Event) isQueryInput_Input() {}
func (m *QueryInput) GetInput() isQueryInput_Input {
if m != nil {
return m.Input
}
return nil
}
func (m *QueryInput) GetAudioConfig() *InputAudioConfig {
if x, ok := m.GetInput().(*QueryInput_AudioConfig); ok {
return x.AudioConfig
}
return nil
}
func (m *QueryInput) GetText() *TextInput {
if x, ok := m.GetInput().(*QueryInput_Text); ok {
return x.Text
}
return nil
}
func (m *QueryInput) GetEvent() *EventInput {
if x, ok := m.GetInput().(*QueryInput_Event); ok {
return x.Event
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*QueryInput) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _QueryInput_OneofMarshaler, _QueryInput_OneofUnmarshaler, _QueryInput_OneofSizer, []interface{}{
(*QueryInput_AudioConfig)(nil),
(*QueryInput_Text)(nil),
(*QueryInput_Event)(nil),
}
}
func _QueryInput_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*QueryInput)
// input
switch x := m.Input.(type) {
case *QueryInput_AudioConfig:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.AudioConfig); err != nil {
return err
}
case *QueryInput_Text:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Text); err != nil {
return err
}
case *QueryInput_Event:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Event); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("QueryInput.Input has unexpected type %T", x)
}
return nil
}
func _QueryInput_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*QueryInput)
switch tag {
case 1: // input.audio_config
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(InputAudioConfig)
err := b.DecodeMessage(msg)
m.Input = &QueryInput_AudioConfig{msg}
return true, err
case 2: // input.text
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TextInput)
err := b.DecodeMessage(msg)
m.Input = &QueryInput_Text{msg}
return true, err
case 3: // input.event
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(EventInput)
err := b.DecodeMessage(msg)
m.Input = &QueryInput_Event{msg}
return true, err
default:
return false, nil
}
}
func _QueryInput_OneofSizer(msg proto.Message) (n int) {
m := msg.(*QueryInput)
// input
switch x := m.Input.(type) {
case *QueryInput_AudioConfig:
s := proto.Size(x.AudioConfig)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *QueryInput_Text:
s := proto.Size(x.Text)
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *QueryInput_Event:
s := proto.Size(x.Event)
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// Represents the result of conversational query or event processing.
type QueryResult struct {
// 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 an event was provided as input, `query_text` is not set.
QueryText string `protobuf:"bytes,1,opt,name=query_text,json=queryText" json:"query_text,omitempty"`
// The language that was triggered during intent detection.
// See [Language Support](https://dialogflow.com/docs/reference/language)
// for a list of the currently supported language codes.
LanguageCode string `protobuf:"bytes,15,opt,name=language_code,json=languageCode" 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.
//
// You should not rely on this field as it isn't guaranteed to be accurate, or
// even set. In particular this field isn't set in Webhook calls and 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" json:"speech_recognition_confidence,omitempty"`
// The action name from the matched intent.
Action string `protobuf:"bytes,3,opt,name=action" json:"action,omitempty"`
// The collection of extracted parameters.
Parameters *google_protobuf4.Struct `protobuf:"bytes,4,opt,name=parameters" 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" json:"all_required_params_present,omitempty"`
// The text to be pronounced to the user or shown on the screen.
FulfillmentText string `protobuf:"bytes,6,opt,name=fulfillment_text,json=fulfillmentText" 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" 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" 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 *google_protobuf4.Struct `protobuf:"bytes,9,opt,name=webhook_payload,json=webhookPayload" 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" 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` and `webhook_state`.
Intent *Intent `protobuf:"bytes,11,opt,name=intent" json:"intent,omitempty"`
// The intent detection confidence. Values range from 0.0
// (completely uncertain) to 1.0 (completely certain).
IntentDetectionConfidence float32 `protobuf:"fixed32,12,opt,name=intent_detection_confidence,json=intentDetectionConfidence" json:"intent_detection_confidence,omitempty"`
// The free-form diagnostic info. For example, this field
// could contain webhook call latency.
DiagnosticInfo *google_protobuf4.Struct `protobuf:"bytes,14,opt,name=diagnostic_info,json=diagnosticInfo" json:"diagnostic_info,omitempty"`
}
func (m *QueryResult) Reset() { *m = QueryResult{} }
func (m *QueryResult) String() string { return proto.CompactTextString(m) }
func (*QueryResult) ProtoMessage() {}
func (*QueryResult) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} }
func (m *QueryResult) GetQueryText() string {
if m != nil {
return m.QueryText
}
return ""
}
func (m *QueryResult) GetLanguageCode() string {
if m != nil {
return m.LanguageCode
}
return ""
}
func (m *QueryResult) GetSpeechRecognitionConfidence() float32 {
if m != nil {
return m.SpeechRecognitionConfidence
}
return 0
}
func (m *QueryResult) GetAction() string {
if m != nil {
return m.Action
}
return ""
}
func (m *QueryResult) GetParameters() *google_protobuf4.Struct {
if m != nil {
return m.Parameters
}
return nil
}
func (m *QueryResult) GetAllRequiredParamsPresent() bool {
if m != nil {
return m.AllRequiredParamsPresent
}
return false
}
func (m *QueryResult) GetFulfillmentText() string {
if m != nil {
return m.FulfillmentText
}
return ""
}
func (m *QueryResult) GetFulfillmentMessages() []*Intent_Message {
if m != nil {
return m.FulfillmentMessages
}
return nil
}
func (m *QueryResult) GetWebhookSource() string {
if m != nil {
return m.WebhookSource
}
return ""
}
func (m *QueryResult) GetWebhookPayload() *google_protobuf4.Struct {
if m != nil {
return m.WebhookPayload
}
return nil
}
func (m *QueryResult) GetOutputContexts() []*Context {
if m != nil {
return m.OutputContexts
}
return nil
}
func (m *QueryResult) GetIntent() *Intent {
if m != nil {
return m.Intent
}
return nil
}
func (m *QueryResult) GetIntentDetectionConfidence() float32 {
if m != nil {
return m.IntentDetectionConfidence
}
return 0
}
func (m *QueryResult) GetDiagnosticInfo() *google_protobuf4.Struct {
if m != nil {
return m.DiagnosticInfo
}
return nil
}
// The top-level message sent by the client to the
// `StreamingDetectIntent` method.
//
// Multiple request messages should be sent in order:
//
// 1. The first message must contain `session`, `query_input` plus optionally
// `query_params` and/or `single_utterance`. The message must not contain
// `input_audio`.
//
// 2. If `query_input` was set to a streaming input audio config,
// all subsequent messages must contain only `input_audio`.
// Otherwise, finish the request stream.
type StreamingDetectIntentRequest struct {
// Required. The name of the session the query is sent to.
// Format of the session name:
// `projects/<Project ID>/agent/sessions/<Session ID>`.
// It’s up to the API caller to choose an appropriate <Session ID>. It can be
// a random number or some type of user identifier (preferably hashed).
// The length of the session ID must not exceed 36 characters.
Session string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"`
// Optional. The parameters of this query.
QueryParams *QueryParameters `protobuf:"bytes,2,opt,name=query_params,json=queryParams" 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" json:"query_input,omitempty"`
// Optional. If `true`, the recognizer will detect a single spoken utterance
// in input audio. When it detects that the user has paused or stopped
// speaking, it will cease recognition. This setting is ignored when
// `query_input` is a piece of text or an event.
SingleUtterance bool `protobuf:"varint,4,opt,name=single_utterance,json=singleUtterance" json:"single_utterance,omitempty"`
// Optional. 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 (m *StreamingDetectIntentRequest) Reset() { *m = StreamingDetectIntentRequest{} }
func (m *StreamingDetectIntentRequest) String() string { return proto.CompactTextString(m) }
func (*StreamingDetectIntentRequest) ProtoMessage() {}
func (*StreamingDetectIntentRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} }
func (m *StreamingDetectIntentRequest) GetSession() string {
if m != nil {
return m.Session
}
return ""
}
func (m *StreamingDetectIntentRequest) GetQueryParams() *QueryParameters {
if m != nil {
return m.QueryParams
}
return nil
}
func (m *StreamingDetectIntentRequest) GetQueryInput() *QueryInput {
if m != nil {
return m.QueryInput
}
return nil
}
func (m *StreamingDetectIntentRequest) GetSingleUtterance() bool {
if m != nil {
return m.SingleUtterance
}
return false
}
func (m *StreamingDetectIntentRequest) GetInputAudio() []byte {
if m != nil {
return m.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 {
// 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" json:"response_id,omitempty"`
// The result of speech recognition.
RecognitionResult *StreamingRecognitionResult `protobuf:"bytes,2,opt,name=recognition_result,json=recognitionResult" json:"recognition_result,omitempty"`
// The result of the conversational query or event processing.
QueryResult *QueryResult `protobuf:"bytes,3,opt,name=query_result,json=queryResult" json:"query_result,omitempty"`
// Specifies the status of the webhook request.
WebhookStatus *google_rpc.Status `protobuf:"bytes,4,opt,name=webhook_status,json=webhookStatus" json:"webhook_status,omitempty"`
}
func (m *StreamingDetectIntentResponse) Reset() { *m = StreamingDetectIntentResponse{} }
func (m *StreamingDetectIntentResponse) String() string { return proto.CompactTextString(m) }
func (*StreamingDetectIntentResponse) ProtoMessage() {}
func (*StreamingDetectIntentResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{6} }
func (m *StreamingDetectIntentResponse) GetResponseId() string {
if m != nil {
return m.ResponseId
}
return ""
}
func (m *StreamingDetectIntentResponse) GetRecognitionResult() *StreamingRecognitionResult {
if m != nil {
return m.RecognitionResult
}
return nil
}
func (m *StreamingDetectIntentResponse) GetQueryResult() *QueryResult {
if m != nil {
return m.QueryResult
}
return nil
}
func (m *StreamingDetectIntentResponse) GetWebhookStatus() *google_rpc.Status {
if m != nil {
return m.WebhookStatus
}
return nil
}
// Contains a speech recognition result corresponding to a portion of the audio
// that is currently being processed or an indication that this is the end
// of the single requested utterance.
//
// Example:
//
// 1. transcript: "tube"
//
// 2. transcript: "to be a"
//
// 3. transcript: "to be"
//
// 4. transcript: "to be or not to be"
// is_final: true
//
// 5. transcript: " that's"
//
// 6. transcript: " that is"
//
// 7. recognition_event_type: `RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE`
//
// 8. transcript: " that is the question"
// is_final: true
//
// Only two of the responses contain final results (#4 and #8 indicated by
// `is_final: true`). Concatenating these generates the full transcript: "to be
// or not to be that is the question".
//
// In each response we populate:
//
// * for `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`.
//
// * for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`.
type StreamingRecognitionResult struct {
// Type of the result message.
MessageType StreamingRecognitionResult_MessageType `protobuf:"varint,1,opt,name=message_type,json=messageType,enum=google.cloud.dialogflow.v2beta1.StreamingRecognitionResult_MessageType" json:"message_type,omitempty"`
// Transcript text representing the words that the user spoke.
// Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
Transcript string `protobuf:"bytes,2,opt,name=transcript" json:"transcript,omitempty"`
// The default of 0.0 is a sentinel value indicating `confidence` was not set.
// If `false`, the `StreamingRecognitionResult` represents an
// interim result that may change. If `true`, the recognizer will not return
// any further hypotheses about this piece of the audio. May only be populated
// for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
IsFinal bool `protobuf:"varint,3,opt,name=is_final,json=isFinal" json:"is_final,omitempty"`
// The Speech confidence between 0.0 and 1.0 for the current portion of audio.
// 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 typically only provided if `is_final` is true and you should
// not rely on it being accurate or even set.
Confidence float32 `protobuf:"fixed32,4,opt,name=confidence" json:"confidence,omitempty"`
}
func (m *StreamingRecognitionResult) Reset() { *m = StreamingRecognitionResult{} }
func (m *StreamingRecognitionResult) String() string { return proto.CompactTextString(m) }
func (*StreamingRecognitionResult) ProtoMessage() {}
func (*StreamingRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} }
func (m *StreamingRecognitionResult) GetMessageType() StreamingRecognitionResult_MessageType {
if m != nil {
return m.MessageType
}
return StreamingRecognitionResult_MESSAGE_TYPE_UNSPECIFIED
}
func (m *StreamingRecognitionResult) GetTranscript() string {
if m != nil {
return m.Transcript
}
return ""
}
func (m *StreamingRecognitionResult) GetIsFinal() bool {
if m != nil {
return m.IsFinal
}
return false
}
func (m *StreamingRecognitionResult) GetConfidence() float32 {
if m != nil {
return m.Confidence
}
return 0
}
// Instructs the speech recognizer how to process the audio content.
type InputAudioConfig struct {
// Required. Audio encoding of the audio content to process.
AudioEncoding AudioEncoding `protobuf:"varint,1,opt,name=audio_encoding,json=audioEncoding,enum=google.cloud.dialogflow.v2beta1.AudioEncoding" json:"audio_encoding,omitempty"`
// Required. Sample rate (in Hertz) of the audio content sent in the query.
// Refer to [Cloud Speech API documentation](/speech/docs/basics) for more
// details.
SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz" json:"sample_rate_hertz,omitempty"`
// Required. The language of the supplied audio. Dialogflow does not do
// translations. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"`
// Optional. The collection of phrase hints which are used to boost accuracy
// of speech recognition.
// Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints)
// for more details.
PhraseHints []string `protobuf:"bytes,4,rep,name=phrase_hints,json=phraseHints" json:"phrase_hints,omitempty"`
}
func (m *InputAudioConfig) Reset() { *m = InputAudioConfig{} }
func (m *InputAudioConfig) String() string { return proto.CompactTextString(m) }
func (*InputAudioConfig) ProtoMessage() {}
func (*InputAudioConfig) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{8} }
func (m *InputAudioConfig) GetAudioEncoding() AudioEncoding {
if m != nil {
return m.AudioEncoding
}
return AudioEncoding_AUDIO_ENCODING_UNSPECIFIED
}
func (m *InputAudioConfig) GetSampleRateHertz() int32 {
if m != nil {
return m.SampleRateHertz
}
return 0
}
func (m *InputAudioConfig) GetLanguageCode() string {
if m != nil {
return m.LanguageCode
}
return ""
}
func (m *InputAudioConfig) GetPhraseHints() []string {
if m != nil {
return m.PhraseHints
}
return nil
}
// Represents the natural language text to be processed.
type TextInput struct {
// Required. The UTF-8 encoded natural language text to be processed.
// Text length must not exceed 256 bytes.
Text string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"`
// Required. The language of this conversational query. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode" json:"language_code,omitempty"`
}
func (m *TextInput) Reset() { *m = TextInput{} }
func (m *TextInput) String() string { return proto.CompactTextString(m) }
func (*TextInput) ProtoMessage() {}
func (*TextInput) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{9} }
func (m *TextInput) GetText() string {
if m != nil {
return m.Text
}
return ""
}
func (m *TextInput) GetLanguageCode() string {
if m != nil {
return m.LanguageCode
}
return ""
}
// Events allow for matching intents by event name instead of the natural
// language input. For instance, input `<event: { name: “welcome_event”,
// parameters: { name: “Sam” } }>` can trigger a personalized welcome response.
// The parameter `name` may be used by the agent in the response:
// `“Hello #welcome_event.name! What can I do for you today?”`.
type EventInput struct {
// Required. The unique identifier of the event.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
// Optional. The collection of parameters associated with the event.
Parameters *google_protobuf4.Struct `protobuf:"bytes,2,opt,name=parameters" json:"parameters,omitempty"`
// Required. The language of this query. See [Language
// Support](https://dialogflow.com/docs/languages) for a list of the
// currently supported language codes. Note that queries in the same session
// do not necessarily need to specify the same language.
LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"`
}
func (m *EventInput) Reset() { *m = EventInput{} }
func (m *EventInput) String() string { return proto.CompactTextString(m) }
func (*EventInput) ProtoMessage() {}
func (*EventInput) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{10} }
func (m *EventInput) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *EventInput) GetParameters() *google_protobuf4.Struct {
if m != nil {
return m.Parameters
}
return nil
}
func (m *EventInput) GetLanguageCode() string {
if m != nil {
return m.LanguageCode
}
return ""
}
func init() {
proto.RegisterType((*DetectIntentRequest)(nil), "google.cloud.dialogflow.v2beta1.DetectIntentRequest")
proto.RegisterType((*DetectIntentResponse)(nil), "google.cloud.dialogflow.v2beta1.DetectIntentResponse")
proto.RegisterType((*QueryParameters)(nil), "google.cloud.dialogflow.v2beta1.QueryParameters")
proto.RegisterType((*QueryInput)(nil), "google.cloud.dialogflow.v2beta1.QueryInput")
proto.RegisterType((*QueryResult)(nil), "google.cloud.dialogflow.v2beta1.QueryResult")
proto.RegisterType((*StreamingDetectIntentRequest)(nil), "google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest")
proto.RegisterType((*StreamingDetectIntentResponse)(nil), "google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse")
proto.RegisterType((*StreamingRecognitionResult)(nil), "google.cloud.dialogflow.v2beta1.StreamingRecognitionResult")
proto.RegisterType((*InputAudioConfig)(nil), "google.cloud.dialogflow.v2beta1.InputAudioConfig")
proto.RegisterType((*TextInput)(nil), "google.cloud.dialogflow.v2beta1.TextInput")
proto.RegisterType((*EventInput)(nil), "google.cloud.dialogflow.v2beta1.EventInput")
proto.RegisterEnum("google.cloud.dialogflow.v2beta1.AudioEncoding", AudioEncoding_name, AudioEncoding_value)
proto.RegisterEnum("google.cloud.dialogflow.v2beta1.StreamingRecognitionResult_MessageType", StreamingRecognitionResult_MessageType_name, StreamingRecognitionResult_MessageType_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Sessions service