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

Commit

Permalink
feat: added API for running continuous test (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Jun 14, 2021
1 parent ede160d commit 248ae74
Show file tree
Hide file tree
Showing 35 changed files with 6,248 additions and 75 deletions.
50 changes: 25 additions & 25 deletions protos/google/cloud/dialogflow/cx/v3/audio_config.proto
Original file line number Diff line number Diff line change
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
113 changes: 113 additions & 0 deletions protos/google/cloud/dialogflow/cx/v3/environment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ service Environments {
};
option (google.api.method_signature) = "name";
}

// Kicks off a continuous test under the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
rpc RunContinuousTest(RunContinuousTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "RunContinuousTestResponse"
metadata_type: "RunContinuousTestMetadata"
};
}

// Fetches a list of continuous test results for a given environment.
rpc ListContinuousTestResults(ListContinuousTestResultsRequest) returns (ListContinuousTestResultsResponse) {
option (google.api.http) = {
get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults"
};
option (google.api.method_signature) = "parent";
}
}

// Represents an environment for an agent. You can create multiple versions
Expand Down Expand Up @@ -261,3 +281,96 @@ message LookupEnvironmentHistoryResponse {
// results in the list.
string next_page_token = 2;
}

// Represents a result from running a test case in an agent environment.
message ContinuousTestResult {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/ContinuousTestResult"
pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}"
};

// The overall result for a continuous test run in an agent environment.
enum AggregatedTestResult {
// Not specified. Should never be used.
AGGREGATED_TEST_RESULT_UNSPECIFIED = 0;

// All the tests passed.
PASSED = 1;

// At least one test did not pass.
FAILED = 2;
}

// The resource name for the continuous test result. Format:
// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment
// ID>/continuousTestResults/<ContinuousTestResult ID>`.
string name = 1;

// The result of this continuous test run, i.e. whether all the tests in this
// continuous test run pass or not.
AggregatedTestResult result = 2;

// A list of individual test case results names in this continuous test run.
repeated string test_case_results = 3 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/TestCaseResult"
}];

// Time when the continuous testing run starts.
google.protobuf.Timestamp run_time = 4;
}

// The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
message RunContinuousTestRequest {
// Required. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>`.
string environment = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Environment"
}
];
}

// The response message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
message RunContinuousTestResponse {
// The result for a continuous test run.
ContinuousTestResult continuous_test_result = 1;
}

// Metadata returned for the [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest] long running
// operation.
message RunContinuousTestMetadata {
// The test errors.
repeated TestError errors = 1;
}

// The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults].
message ListContinuousTestResultsRequest {
// Required. The environment to list results 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) = {
child_type: "dialogflow.googleapis.com/ContinuousTestResult"
}
];

// The maximum number of items to return in a single page. By default 100 and
// at most 1000.
int32 page_size = 2;

// The next_page_token value returned from a previous list request.
string page_token = 3;
}

// The response message for [Environments.ListTestCaseResults][].
message ListContinuousTestResultsResponse {
// The list of continuous test results.
repeated ContinuousTestResult continuous_test_results = 1;

// Token to retrieve the next page of results, or empty if there are no more
// results in the list.
string next_page_token = 2;
}
Loading

0 comments on commit 248ae74

Please sign in to comment.