@@ -57,6 +57,10 @@ service Sessions {
57
57
// as a result. This method is not idempotent, because it may cause contexts
58
58
// and session entity types to be updated, which in turn might affect
59
59
// results of future queries.
60
+ //
61
+ // Note: Always use agent versions for production traffic.
62
+ // See [Versions and
63
+ // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
60
64
rpc DetectIntent (DetectIntentRequest ) returns (DetectIntentResponse ) {
61
65
option (google.api.http ) = {
62
66
post : "/v2/{session=projects/*/agent/sessions/*}:detectIntent"
@@ -72,8 +76,12 @@ service Sessions {
72
76
// Processes a natural language query in audio format in a streaming fashion
73
77
// and returns structured, actionable data as a result. This method is only
74
78
// available via the gRPC API (not REST).
75
- rpc StreamingDetectIntent (stream StreamingDetectIntentRequest ) returns (stream StreamingDetectIntentResponse ) {
76
- }
79
+ //
80
+ // Note: Always use agent versions for production traffic.
81
+ // See [Versions and
82
+ // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
83
+ rpc StreamingDetectIntent (stream StreamingDetectIntentRequest )
84
+ returns (stream StreamingDetectIntentResponse ) {}
77
85
}
78
86
79
87
// The request to detect user's intent.
@@ -90,6 +98,10 @@ message DetectIntentRequest {
90
98
//
91
99
// For more information, see the [API interactions
92
100
// guide](https://cloud.google.com/dialogflow/docs/api-overview).
101
+ //
102
+ // Note: Always use agent versions for production traffic.
103
+ // See [Versions and
104
+ // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
93
105
string session = 1 [
94
106
(google.api.field_behavior ) = REQUIRED ,
95
107
(google.api.resource_reference ) = {
@@ -115,12 +127,14 @@ message DetectIntentRequest {
115
127
// configured, no output audio is generated.
116
128
OutputAudioConfig output_audio_config = 4 ;
117
129
118
- // Mask for [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] indicating which settings in this
119
- // request-level config should override speech synthesizer settings defined at
120
- // agent-level.
130
+ // Mask for
131
+ // [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config]
132
+ // indicating which settings in this request-level config should override
133
+ // speech synthesizer settings defined at agent-level.
121
134
//
122
- // If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] replaces the agent-level
123
- // config in its entirety.
135
+ // If unspecified or empty,
136
+ // [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config]
137
+ // replaces the agent-level config in its entirety.
124
138
google.protobuf.FieldMask output_audio_config_mask = 7 ;
125
139
126
140
// The natural language speech audio to be processed. This field
@@ -192,6 +206,17 @@ message QueryParameters {
192
206
// Configures the type of sentiment analysis to perform. If not
193
207
// provided, sentiment analysis is not performed.
194
208
SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10 ;
209
+
210
+ // This field can be used to pass HTTP headers for a webhook
211
+ // call. These headers will be sent to webhook along with the headers that
212
+ // have been configured through the Dialogflow web console. The headers
213
+ // defined within this field will overwrite the headers configured through the
214
+ // Dialogflow console if there is a conflict. Header names are
215
+ // case-insensitive. Google's specified headers are not allowed. Including:
216
+ // "Host", "Content-Length", "Connection", "From", "User-Agent",
217
+ // "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For",
218
+ // etc.
219
+ map <string , string > webhook_headers = 14 ;
195
220
}
196
221
197
222
// Represents the query input. It can contain either:
@@ -325,25 +350,29 @@ message QueryResult {
325
350
}
326
351
327
352
// The top-level message sent by the client to the
328
- // [Sessions.StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent] method.
353
+ // [Sessions.StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]
354
+ // method.
329
355
//
330
356
// Multiple request messages should be sent in order:
331
357
//
332
358
// 1. The first message must contain
333
359
// [session][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.session],
334
- // [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input] plus optionally
335
- // [query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params]. If the client
336
- // wants to receive an audio response, it should also contain
360
+ // [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input]
361
+ // plus optionally
362
+ // [query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params].
363
+ // If the client wants to receive an audio response, it should also contain
337
364
// [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config].
338
365
// The message must not contain
339
366
// [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio].
340
- // 2. If [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input] was set to
341
- // [query_input.audio_config][google.cloud.dialogflow.v2.InputAudioConfig], all subsequent
342
- // messages must contain
343
- // [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio] to continue with
344
- // Speech recognition.
345
- // If you decide to rather detect an intent from text input after you
346
- // already started Speech recognition, please send a message with
367
+ // 2. If
368
+ // [query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input]
369
+ // was set to
370
+ // [query_input.audio_config][google.cloud.dialogflow.v2.InputAudioConfig],
371
+ // all subsequent messages must contain
372
+ // [input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio]
373
+ // to continue with Speech recognition. If you decide to rather detect an
374
+ // intent from text input after you already started Speech recognition,
375
+ // please send a message with
347
376
// [query_input.text][google.cloud.dialogflow.v2.QueryInput.text].
348
377
//
349
378
// However, note that:
@@ -368,6 +397,10 @@ message StreamingDetectIntentRequest {
368
397
//
369
398
// For more information, see the [API interactions
370
399
// guide](https://cloud.google.com/dialogflow/docs/api-overview).
400
+ //
401
+ // Note: Always use agent versions for production traffic.
402
+ // See [Versions and
403
+ // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
371
404
string session = 1 [
372
405
(google.api.field_behavior ) = REQUIRED ,
373
406
(google.api.resource_reference ) = {
@@ -388,27 +421,30 @@ message StreamingDetectIntentRequest {
388
421
// 3. an event that specifies which intent to trigger.
389
422
QueryInput query_input = 3 [(google.api.field_behavior ) = REQUIRED ];
390
423
391
- // Please use [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] instead.
392
- // If `false` (default), recognition does not cease until
393
- // the client closes the stream. If `true`, the recognizer will detect a
394
- // single spoken utterance in input audio. Recognition ceases when it detects
395
- // the audio's voice has stopped or paused. In this case, once a detected
396
- // intent is received, the client should close the stream and start a new
397
- // request with a new stream as needed.
398
- // This setting is ignored when `query_input` is a piece of text or an event.
424
+ // Please use
425
+ // [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance]
426
+ // instead. If `false` (default), recognition does not cease until the client
427
+ // closes the stream. If `true`, the recognizer will detect a single spoken
428
+ // utterance in input audio. Recognition ceases when it detects the audio's
429
+ // voice has stopped or paused. In this case, once a detected intent is
430
+ // received, the client should close the stream and start a new request with a
431
+ // new stream as needed. This setting is ignored when `query_input` is a piece
432
+ // of text or an event.
399
433
bool single_utterance = 4 [deprecated = true ];
400
434
401
435
// Instructs the speech synthesizer how to generate the output
402
436
// audio. If this field is not set and agent-level speech synthesizer is not
403
437
// configured, no output audio is generated.
404
438
OutputAudioConfig output_audio_config = 5 ;
405
439
406
- // Mask for [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] indicating which settings in this
407
- // request-level config should override speech synthesizer settings defined at
408
- // agent-level.
440
+ // Mask for
441
+ // [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config]
442
+ // indicating which settings in this request-level config should override
443
+ // speech synthesizer settings defined at agent-level.
409
444
//
410
- // If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] replaces the agent-level
411
- // config in its entirety.
445
+ // If unspecified or empty,
446
+ // [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config]
447
+ // replaces the agent-level config in its entirety.
412
448
google.protobuf.FieldMask output_audio_config_mask = 7 ;
413
449
414
450
// The input audio content to be recognized. Must be sent if
@@ -503,11 +539,12 @@ message StreamingRecognitionResult {
503
539
504
540
// Event indicates that the server has detected the end of the user's speech
505
541
// utterance and expects no additional inputs.
506
- // Therefore, the server will not process additional audio (although it may subsequently return additional results). The
507
- // client should stop sending additional audio data, half-close the gRPC
508
- // connection, and wait for any additional results until the server closes
509
- // the gRPC connection. This message is only sent if `single_utterance` was
510
- // set to `true`, and is not used otherwise.
542
+ // Therefore, the server will not process additional audio (although it may
543
+ // subsequently return additional results). The client should stop sending
544
+ // additional audio data, half-close the gRPC connection, and wait for any
545
+ // additional results until the server closes the gRPC connection. This
546
+ // message is only sent if `single_utterance` was set to `true`, and is not
547
+ // used otherwise.
511
548
END_OF_SINGLE_UTTERANCE = 2 ;
512
549
}
513
550
@@ -534,7 +571,8 @@ message StreamingRecognitionResult {
534
571
float confidence = 4 ;
535
572
536
573
// Word-specific information for the words recognized by Speech in
537
- // [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. Populated if and only if `message_type` = `TRANSCRIPT` and
574
+ // [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript].
575
+ // Populated if and only if `message_type` = `TRANSCRIPT` and
538
576
// [InputAudioConfig.enable_word_info] is set.
539
577
repeated SpeechWordInfo speech_word_info = 7 ;
540
578
@@ -601,11 +639,14 @@ message SentimentAnalysisRequestConfig {
601
639
// and identifies the prevailing subjective opinion, especially to determine a
602
640
// user's attitude as positive, negative, or neutral.
603
641
// For [Participants.DetectIntent][], it needs to be configured in
604
- // [DetectIntentRequest.query_params][google.cloud.dialogflow.v2.DetectIntentRequest.query_params]. For
605
- // [Participants.StreamingDetectIntent][], it needs to be configured in
642
+ // [DetectIntentRequest.query_params][google.cloud.dialogflow.v2.DetectIntentRequest.query_params].
643
+ // For [Participants.StreamingDetectIntent][], it needs to be configured in
606
644
// [StreamingDetectIntentRequest.query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params].
607
- // And for [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] and
608
- // [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent], it needs to be configured in
645
+ // And for
646
+ // [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent]
647
+ // and
648
+ // [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent],
649
+ // it needs to be configured in
609
650
// [ConversationProfile.human_agent_assistant_config][google.cloud.dialogflow.v2.ConversationProfile.human_agent_assistant_config]
610
651
message SentimentAnalysisResult {
611
652
// The sentiment analysis result for `query_text`.
0 commit comments