Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
feat: supports SentimentAnalysisResult in webhook request docs: minor…
Browse files Browse the repository at this point in the history
… updates in wording (#62)

PiperOrigin-RevId: 356624136

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Feb 9 16:52:56 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: e28aa8570dc86136fe677202c976f4ee00d77f61
Source-Link: googleapis/googleapis@e28aa85

Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
yoshi-automation and bcoe committed Mar 1, 2021
1 parent 38acf82 commit 1e167ab
Show file tree
Hide file tree
Showing 9 changed files with 511 additions and 177 deletions.
50 changes: 25 additions & 25 deletions protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ option java_outer_classname = "AudioConfigProto";
option java_package = "com.google.cloud.dialogflow.cx.v3beta1";
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 @@ -78,31 +103,6 @@ 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
97 changes: 36 additions & 61 deletions protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,36 +33,30 @@ option java_outer_classname = "ExperimentProto";
option java_package = "com.google.cloud.dialogflow.cx.v3beta1";
option objc_class_prefix = "DF";

// Service for managing
// [Experiments][google.cloud.dialogflow.cx.v3beta1.Experiment].
// Service for managing [Experiments][google.cloud.dialogflow.cx.v3beta1.Experiment].
service Experiments {
option (google.api.default_host) = "dialogflow.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/dialogflow";

// Returns the list of all experiments in the specified
// [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
rpc ListExperiments(ListExperimentsRequest)
returns (ListExperimentsResponse) {
// Returns the list of all experiments in the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
rpc ListExperiments(ListExperimentsRequest) returns (ListExperimentsResponse) {
option (google.api.http) = {
get: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments"
};
option (google.api.method_signature) = "parent";
}

// Retrieves the specified
// [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment].
// Retrieves the specified [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment].
rpc GetExperiment(GetExperimentRequest) returns (Experiment) {
option (google.api.http) = {
get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}"
};
option (google.api.method_signature) = "name";
}

// Creates an [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment] in
// the specified
// [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
// Creates an [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment] in the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
rpc CreateExperiment(CreateExperimentRequest) returns (Experiment) {
option (google.api.http) = {
post: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/experiments"
Expand All @@ -71,8 +65,7 @@ service Experiments {
option (google.api.method_signature) = "parent,experiment";
}

// Updates the specified
// [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment].
// Updates the specified [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment].
rpc UpdateExperiment(UpdateExperimentRequest) returns (Experiment) {
option (google.api.http) = {
patch: "/v3beta1/{experiment.name=projects/*/locations/*/agents/*/environments/*/experiments/*}"
Expand All @@ -81,19 +74,16 @@ service Experiments {
option (google.api.method_signature) = "experiment,update_mask";
}

// Deletes the specified
// [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment].
rpc DeleteExperiment(DeleteExperimentRequest)
returns (google.protobuf.Empty) {
// Deletes the specified [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment].
rpc DeleteExperiment(DeleteExperimentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}"
};
option (google.api.method_signature) = "name";
}

// Starts the specified
// [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. This rpc only
// changes the state of experiment from PENDING to RUNNING.
// Starts the specified [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. This rpc only changes the state of
// experiment from PENDING to RUNNING.
rpc StartExperiment(StartExperimentRequest) returns (Experiment) {
option (google.api.http) = {
post: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:start"
Expand All @@ -102,9 +92,8 @@ service Experiments {
option (google.api.method_signature) = "name";
}

// Stops the specified
// [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. This rpc only
// changes the state of experiment from RUNNING to DONE.
// Stops the specified [Experiment][google.cloud.dialogflow.cx.v3beta1.Experiment]. This rpc only changes the state of
// experiment from RUNNING to DONE.
rpc StopExperiment(StopExperimentRequest) returns (Experiment) {
option (google.api.http) = {
post: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/experiments/*}:stop"
Expand Down Expand Up @@ -184,13 +173,12 @@ message Experiment {

// Version variant and associated metrics.
message VersionMetrics {
// The name of the flow
// [Version][google.cloud.dialogflow.cx.v3beta1.Version]. Format:
// `projects/<Project Number>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>/versions/<Version ID>`.
// The name of the flow [Version][google.cloud.dialogflow.cx.v3beta1.Version].
// Format: `projects/<Project Number>/locations/<Location
// ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`.
string version = 1 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Version"
}];
type: "dialogflow.googleapis.com/Version"
}];

// The metrics and corresponding confidence intervals in the inference
// result.
Expand Down Expand Up @@ -265,8 +253,8 @@ message Experiment {
// ID>/environments/<Environment ID>/experiments/<Experiment ID>..
string name = 1;

// Required. The human-readable name of the experiment (unique in an
// environment). Limit of 64 characters.
// Required. The human-readable name of the experiment (unique in an environment). Limit
// of 64 characters.
string display_name = 2 [(google.api.field_behavior) = REQUIRED];

// The human-readable description of the experiment.
Expand Down Expand Up @@ -337,13 +325,11 @@ message VariantsHistory {
google.protobuf.Timestamp update_time = 2;
}

// The request message for
// [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments].
// The request message for [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments].
message ListExperimentsRequest {
// Required. The [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]
// to list all environments for. Format: `projects/<Project
// ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment
// ID>`.
// Required. The [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to list all environments for.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -359,8 +345,7 @@ message ListExperimentsRequest {
string page_token = 3;
}

// The response message for
// [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments].
// The response message for [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments].
message ListExperimentsResponse {
// The list of experiments. There will be a maximum number of items
// returned based on the page_size field in the request. The list may in some
Expand All @@ -373,12 +358,10 @@ message ListExperimentsResponse {
string next_page_token = 2;
}

// The request message for
// [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.GetExperiment].
// The request message for [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.GetExperiment].
message GetExperimentRequest {
// Required. The name of the
// [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. Format:
// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>/experiments/<Experiment ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
Expand All @@ -388,11 +371,9 @@ message GetExperimentRequest {
];
}

// The request message for
// [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.CreateExperiment].
// The request message for [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.CreateExperiment].
message CreateExperimentRequest {
// Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create
// an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
// Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>`.
string parent = 1 [
Expand All @@ -406,22 +387,18 @@ message CreateExperimentRequest {
Experiment experiment = 2 [(google.api.field_behavior) = REQUIRED];
}

// The request message for
// [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.UpdateExperiment].
// The request message for [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.UpdateExperiment].
message UpdateExperimentRequest {
// Required. The experiment to update.
Experiment experiment = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}

// The request message for
// [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.DeleteExperiment].
// The request message for [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.DeleteExperiment].
message DeleteExperimentRequest {
// Required. The name of the
// [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
// Required. The name of the [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>/experiments/<Experiment ID>`.
string name = 1 [
Expand All @@ -432,8 +409,7 @@ message DeleteExperimentRequest {
];
}

// The request message for
// [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StartExperiment].
// The request message for [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StartExperiment].
message StartExperimentRequest {
// Required. Resource name of the experiment to start.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
Expand All @@ -446,8 +422,7 @@ message StartExperimentRequest {
];
}

// The request message for
// [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StopExperiment].
// The request message for [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StopExperiment].
message StopExperimentRequest {
// Required. Resource name of the experiment to stop.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
Expand Down
3 changes: 3 additions & 0 deletions protos/google/cloud/dialogflow/cx/v3beta1/page.proto
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ message Page {
// [transition route groups][google.cloud.dialogflow.cx.v3beta1.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.v3beta1.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.v3beta1.Page.transition_route_groups] with only
Expand Down
16 changes: 16 additions & 0 deletions protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto
Original file line number Diff line number Diff line change
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.v3beta1.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.v3beta1.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
Loading

0 comments on commit 1e167ab

Please sign in to comment.