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

Commit

Permalink
feat: added support for test cases and agent validation (#53)
Browse files Browse the repository at this point in the history
* feat: added support for test cases and agent validation
Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Jan 20 11:21:52 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: f83715b48369c8d43548cc3cd84015e60be94cf2
Source-Link: googleapis/googleapis@f83715b

feat: Add new Experiment service docs: minor doc update on redact field in intent.proto and page.proto
feat: Add new Experiment service docs: minor doc update on redact field in intent.proto and page.proto
  • Loading branch information
yoshi-automation authored Feb 1, 2021
1 parent 14cd325 commit 63933cd
Show file tree
Hide file tree
Showing 127 changed files with 129,750 additions and 59,360 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
"prelint": "cd samples; npm link ../; npm i",
"prepare": "npm run compile-protos && npm run compile",
"system-test": "c8 mocha build/system-test",
"test": "c8 npm run test:all",
"test:all": "mocha 'build/test/*v3.js' && mocha 'build/test/*v3beta1.js'",
"test": "c8 node build/test/run.js",
"samples-test": "cd samples/ && npm link ../ && npm test"
},
"dependencies": {
Expand Down
73 changes: 73 additions & 0 deletions protos/google/cloud/dialogflow/cx/v3/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ service Agents {
metadata_type: "google.protobuf.Struct"
};
}

// Validates the specified agent and creates or updates validation results.
// The agent in draft version is validated. Please call this API after the
// training is completed to get the complete validation results.
rpc ValidateAgent(ValidateAgentRequest) returns (AgentValidationResult) {
option (google.api.http) = {
post: "/v3/{name=projects/*/locations/*/agents/*}:validate"
body: "*"
};
}

// Gets the latest agent validation result. Agent validation is performed
// when ValidateAgent is called.
rpc GetAgentValidationResult(GetAgentValidationResultRequest) returns (AgentValidationResult) {
option (google.api.http) = {
get: "/v3/{name=projects/*/locations/*/agents/*/validationResult}"
};
option (google.api.method_signature) = "name";
}
}

// Settings related to speech recognition.
Expand Down Expand Up @@ -176,6 +195,13 @@ message Agent {
}
];

// Name of the [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] reference for the agent.
// Format: `projects/<Project ID>/locations/<Location
// ID>/securitySettings/<Security Settings ID>`.
string security_settings = 17 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/SecuritySettings"
}];

// Indicates if stackdriver logging is enabled for the agent.
bool enable_stackdriver_logging = 18;

Expand Down Expand Up @@ -316,3 +342,50 @@ message RestoreAgentRequest {
bytes agent_content = 3;
}
}

// The request message for [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3.Agents.ValidateAgent].
message ValidateAgentRequest {
// Required. The agent to validate.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Agent"
}
];

// If not specified, the agent's default language is used.
string language_code = 2;
}

// The request message for [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
message GetAgentValidationResultRequest {
// Required. The agent name.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/validationResult`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/AgentValidationResult"
}
];

// If not specified, the agent's default language is used.
string language_code = 2;
}

// The response message for [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
message AgentValidationResult {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/AgentValidationResult"
pattern: "projects/{project}/locations/{location}/agents/{agent}/validationResult"
};

// The unique identifier of the agent validation result.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/validationResult`.
string name = 1;

// Contains all flow validation results.
repeated FlowValidationResult flow_validation_results = 2;
}
8 changes: 6 additions & 2 deletions protos/google/cloud/dialogflow/cx/v3/audio_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,17 @@ message VoiceSelectionParams {
// Optional. The name of the voice. If not set, the service will choose a
// voice based on the other parameters such as language_code and
// [ssml_gender][google.cloud.dialogflow.cx.v3.VoiceSelectionParams.ssml_gender].
//
// For the list of available voices, please refer to [Supported voices and
// languages](https://cloud.google.com/text-to-speech/docs/voices).
string name = 1;

// Optional. The preferred gender of the voice. If not set, the service will
// choose a voice based on the other parameters such as language_code and
// [name][google.cloud.dialogflow.cx.v3.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
// voice of the appropriate gender is not available, the synthesizer should
// substitute a voice with a different gender rather than failing the request.
// voice of the appropriate gender is not available, the synthesizer
// substitutes a voice with a different gender rather than failing the
// request.
SsmlVoiceGender ssml_gender = 2;
}

Expand Down
6 changes: 5 additions & 1 deletion protos/google/cloud/dialogflow/cx/v3/entity_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ message EntityType {
};

// An **entity entry** for an associated entity type.
// Next Id = 8
message Entity {
// Required. The primary value associated with this entity entry.
// For example, if the entity type is *vegetable*, the value could be
Expand Down Expand Up @@ -205,6 +204,11 @@ message EntityType {

// Enables fuzzy entity extraction during classification.
bool enable_fuzzy_extraction = 7;

// Indicates whether parameters of the entity type should be redacted in log.
// If redaction is enabled, page parameters and intent parameters referring to
// the entity type will be replaced by parameter name when logging.
bool redact = 9;
}

// The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes].
Expand Down
29 changes: 25 additions & 4 deletions protos/google/cloud/dialogflow/cx/v3/experiment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ service Experiments {
}

// Represents an experiment in an environment.
// Next ID: 13
message Experiment {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/Experiment"
pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}"
};

// Definition of the experiment.
// Next ID: 3
message Definition {
// The condition defines which subset of sessions are selected for
// this experiment. If not specified, all sessions are eligible. E.g.
Expand Down Expand Up @@ -151,13 +149,21 @@ message Experiment {

// Metric and corresponding confidence intervals.
message Metric {
// The type of the metric.
// Ratio-based metric type. Only one of type or count_type is specified in
// each Metric.
MetricType type = 1;

// Count-based metric type. Only one of type or count_type is specified in
// each Metric.
CountType count_type = 5;

// The actual value of the metric.
oneof value {
// Ratio value of a metric.
double ratio = 2;

// Count value of a metric.
double count = 4;
}

// The probability that the treatment is better than all other treatments
Expand All @@ -182,7 +188,7 @@ message Experiment {
int32 session_count = 3;
}

// Types of metric for Dialogflow experiment.
// Types of ratio-based metric for Dialogflow experiment.
enum MetricType {
// Metric unspecified.
METRIC_UNSPECIFIED = 0;
Expand All @@ -204,6 +210,21 @@ message Experiment {
SESSION_END_RATE = 5;
}

// Types of count-based metric for Dialogflow experiment.
enum CountType {
// Count type unspecified.
COUNT_TYPE_UNSPECIFIED = 0;

// Total number of occurrences of a 'NO_MATCH'.
TOTAL_NO_MATCH_COUNT = 1;

// Total number of turn counts.
TOTAL_TURN_COUNT = 2;

// Average turn count in a session.
AVERAGE_TURN_COUNT = 3;
}

// Version variants and metrics.
repeated VersionMetrics version_metrics = 1;

Expand Down
71 changes: 71 additions & 0 deletions protos/google/cloud/dialogflow/cx/v3/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/dialogflow/cx/v3/page.proto";
import "google/cloud/dialogflow/cx/v3/validation_message.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
Expand Down Expand Up @@ -96,6 +97,25 @@ service Flows {
metadata_type: "google.protobuf.Struct"
};
}

// Validates the specified flow and creates or updates validation results.
// Please call this API after the training is completed to get the complete
// validation results.
rpc ValidateFlow(ValidateFlowRequest) returns (FlowValidationResult) {
option (google.api.http) = {
post: "/v3/{name=projects/*/locations/*/agents/*/flows/*}:validate"
body: "*"
};
}

// Gets the latest flow validation result. Flow validation is performed
// when ValidateFlow is called.
rpc GetFlowValidationResult(GetFlowValidationResultRequest) returns (FlowValidationResult) {
option (google.api.http) = {
get: "/v3/{name=projects/*/locations/*/agents/*/flows/*/validationResult}"
};
option (google.api.method_signature) = "name";
}
}

// Settings related to NLU.
Expand Down Expand Up @@ -364,3 +384,54 @@ message TrainFlowRequest {
}
];
}

// The request message for [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3.Flows.ValidateFlow].
message ValidateFlowRequest {
// Required. The flow to validate.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Flow"
}
];

// If not specified, the agent's default language is used.
string language_code = 2;
}

// The request message for [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
message GetFlowValidationResultRequest {
// Required. The flow name.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>/validationResult`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/FlowValidationResult"
}
];

// If not specified, the agent's default language is used.
string language_code = 2;
}

// The response message for [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
message FlowValidationResult {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/FlowValidationResult"
pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult"
};

// The unique identifier of the flow validation result.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>/validationResult`.
string name = 1;

// Contains all validation messages.
repeated ValidationMessage validation_messages = 2;

// Last time the flow was validated.
google.protobuf.Timestamp update_time = 3;
}
9 changes: 6 additions & 3 deletions protos/google/cloud/dialogflow/cx/v3/intent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ message Intent {
// Indicates whether the parameter represents a list of values.
bool is_list = 3;

// Indicates whether the parameter content is logged in text and audio. If
// it is set to true, the parameter content will be replaced to parameter
// id in both request and response. The default value is false.
// Indicates whether the parameter content should be redacted in log. If
// redaction is enabled, the parameter content will be replaced by parameter
// name during logging.
// Note: the parameter content is subject to redaction if either parameter
// level redaction or [entity type level redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is
// enabled.
bool redact = 4;
}

Expand Down
15 changes: 11 additions & 4 deletions protos/google/cloud/dialogflow/cx/v3/page.proto
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ message Page {
//
// * TransitionRoutes defined in the page with intent specified.
// * TransitionRoutes defined in the
// [transition route groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups].
// [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 page with only condition specified.
// * TransitionRoutes defined in the
// [transition route groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] with only
// condition specified.
repeated TransitionRoute transition_routes = 9;

// Handlers associated with the page to handle events such as webhook errors,
Expand Down Expand Up @@ -238,9 +242,12 @@ message Form {
// the default value will be ignored.
google.protobuf.Value default_value = 9;

// Indicates whether the parameter content is logged in text and audio. If
// it is set to true, the parameter content will be replaced to parameter
// name in both request and response. The default value is false.
// Indicates whether the parameter content should be redacted in log. If
// redaction is enabled, the parameter content will be replaced by parameter
// name during logging.
// Note: the parameter content is subject to redaction if either parameter
// level redaction or [entity type level redaction][google.cloud.dialogflow.cx.v3.EntityType.redact] is
// enabled.
bool redact = 11;
}

Expand Down
14 changes: 7 additions & 7 deletions protos/google/cloud/dialogflow/cx/v3/response_message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ 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 @@ -132,6 +125,13 @@ 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
Loading

0 comments on commit 63933cd

Please sign in to comment.