Skip to content

Commit

Permalink
feat: supports SentimentAnalysisResult in webhook request, add http r…
Browse files Browse the repository at this point in the history
…ules for long running operations

docs: minor updates in wording

PiperOrigin-RevId: 356804449
  • Loading branch information
Google APIs authored and Copybara-Service committed Feb 10, 2021
1 parent e28aa85 commit 6de7abe
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 32 deletions.
50 changes: 25 additions & 25 deletions google/cloud/dialogflow/cx/v3/audio_config.proto
Expand Up @@ -29,31 +29,6 @@ option java_outer_classname = "AudioConfigProto";
option java_package = "com.google.cloud.dialogflow.cx.v3";
option objc_class_prefix = "DF";

// Information for a word recognized by the speech recognizer.
message SpeechWordInfo {
// The word this info is for.
string word = 3;

// Time offset relative to the beginning of the audio that corresponds to the
// start of the spoken word. This is an experimental feature and the accuracy
// of the time offset can vary.
google.protobuf.Duration start_offset = 1;

// Time offset relative to the beginning of the audio that corresponds to the
// end of the spoken word. This is an experimental feature and the accuracy of
// the time offset can vary.
google.protobuf.Duration end_offset = 2;

// The Speech confidence between 0.0 and 1.0 for this word. A higher number
// indicates an estimated greater likelihood that the recognized word is
// correct. The default of 0.0 is a sentinel value indicating that confidence
// was not set.
//
// This field is not guaranteed to be fully stable over time for the same
// audio input. Users should also not rely on it to always be provided.
float confidence = 4;
}

// Audio encoding of the audio content sent in the conversational query request.
// Refer to the
// [Cloud Speech API
Expand Down Expand Up @@ -103,6 +78,31 @@ enum AudioEncoding {
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
}

// Information for a word recognized by the speech recognizer.
message SpeechWordInfo {
// The word this info is for.
string word = 3;

// Time offset relative to the beginning of the audio that corresponds to the
// start of the spoken word. This is an experimental feature and the accuracy
// of the time offset can vary.
google.protobuf.Duration start_offset = 1;

// Time offset relative to the beginning of the audio that corresponds to the
// end of the spoken word. This is an experimental feature and the accuracy of
// the time offset can vary.
google.protobuf.Duration end_offset = 2;

// The Speech confidence between 0.0 and 1.0 for this word. A higher number
// indicates an estimated greater likelihood that the recognized word is
// correct. The default of 0.0 is a sentinel value indicating that confidence
// was not set.
//
// This field is not guaranteed to be fully stable over time for the same
// audio input. Users should also not rely on it to always be provided.
float confidence = 4;
}

// Instructs the speech recognizer on how to process the audio content.
message InputAudioConfig {
// Required. Audio encoding of the audio content to process.
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/dialogflow/cx/v3/dialogflow_v3.yaml
Expand Up @@ -93,6 +93,21 @@ backend:
- selector: 'google.longrunning.Operations.*'
deadline: 60.0

http:
rules:
- selector: google.longrunning.Operations.CancelOperation
post: '/v3/{name=projects/*/operations/*}:cancel'
additional_bindings:
- post: '/v3/{name=projects/*/locations/*/operations/*}:cancel'
- selector: google.longrunning.Operations.GetOperation
get: '/v3/{name=projects/*/operations/*}'
additional_bindings:
- get: '/v3/{name=projects/*/locations/*/operations/*}'
- selector: google.longrunning.Operations.ListOperations
get: '/v3/{name=projects/*}/operations'
additional_bindings:
- get: '/v3/{name=projects/*/locations/*}/operations'

authentication:
rules:
- selector: 'google.cloud.dialogflow.cx.v3.Agents.*'
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/dialogflow/cx/v3/page.proto
Expand Up @@ -150,6 +150,9 @@ message Page {
// [transition route groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] with intent
// specified.
// * TransitionRoutes defined in flow with intent specified.
// * TransitionRoutes defined in the
// [transition route groups][google.cloud.dialogflow.cx.v3.Flow.transition_route_groups] with intent
// specified.
// * TransitionRoutes defined in the page with only condition specified.
// * TransitionRoutes defined in the
// [transition route groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] with only
Expand Down
14 changes: 7 additions & 7 deletions google/cloud/dialogflow/cx/v3/response_message.proto
Expand Up @@ -113,6 +113,13 @@ message ResponseMessage {
bool allow_playback_interruption = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Indicates that interaction with the Dialogflow agent has ended.
// This message is generated by Dialogflow only and not supposed to be
// defined by the user.
message EndInteraction {

}

// Specifies an audio clip to be played by the client as part of the response.
message PlayAudio {
// Required. URI of the audio clip. Dialogflow does not impose any validation on this
Expand All @@ -125,13 +132,6 @@ message ResponseMessage {
bool allow_playback_interruption = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Indicates that interaction with the Dialogflow agent has ended.
// This message is generated by Dialogflow only and not supposed to be
// defined by the user.
message EndInteraction {

}

// Represents an audio message that is composed of both segments
// synthesized from the Dialogflow agent prompts and ones hosted externally
// at the specified URIs.
Expand Down
16 changes: 16 additions & 0 deletions google/cloud/dialogflow/cx/v3/webhook.proto
Expand Up @@ -273,6 +273,18 @@ message WebhookRequest {
float confidence = 4;
}

// Represents the result of sentiment analysis.
message SentimentAnalysisResult {
// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
// sentiment).
float score = 1;

// A non-negative number in the [0, +inf) range, which represents the
// absolute magnitude of sentiment, regardless of score (positive or
// negative).
float magnitude = 2;
}

// Always present. The unique identifier of the [DetectIntentResponse][google.cloud.dialogflow.cx.v3.DetectIntentResponse] that
// will be returned to the API caller.
string detect_intent_response_id = 1;
Expand All @@ -297,6 +309,10 @@ message WebhookRequest {

// Custom data set in [QueryParameters.payload][google.cloud.dialogflow.cx.v3.QueryParameters.payload].
google.protobuf.Struct payload = 8;

// The sentiment analysis result of the current user request. The field is
// filled when sentiment analysis is configured to be enabled for the request.
SentimentAnalysisResult sentiment_analysis_result = 9;
}

// The response message for a webhook call.
Expand Down

0 comments on commit 6de7abe

Please sign in to comment.