Skip to content

Commit b2c4b3d

Browse files
Google APIscopybara-github
authored andcommitted
feat: added API for running continuous test
PiperOrigin-RevId: 375809988
1 parent a28855a commit b2c4b3d

3 files changed

Lines changed: 140 additions & 25 deletions

File tree

google/cloud/dialogflow/cx/v3/audio_config.proto

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,6 @@ option java_outer_classname = "AudioConfigProto";
2929
option java_package = "com.google.cloud.dialogflow.cx.v3";
3030
option objc_class_prefix = "DF";
3131

32-
// Information for a word recognized by the speech recognizer.
33-
message SpeechWordInfo {
34-
// The word this info is for.
35-
string word = 3;
36-
37-
// Time offset relative to the beginning of the audio that corresponds to the
38-
// start of the spoken word. This is an experimental feature and the accuracy
39-
// of the time offset can vary.
40-
google.protobuf.Duration start_offset = 1;
41-
42-
// Time offset relative to the beginning of the audio that corresponds to the
43-
// end of the spoken word. This is an experimental feature and the accuracy of
44-
// the time offset can vary.
45-
google.protobuf.Duration end_offset = 2;
46-
47-
// The Speech confidence between 0.0 and 1.0 for this word. A higher number
48-
// indicates an estimated greater likelihood that the recognized word is
49-
// correct. The default of 0.0 is a sentinel value indicating that confidence
50-
// was not set.
51-
//
52-
// This field is not guaranteed to be fully stable over time for the same
53-
// audio input. Users should also not rely on it to always be provided.
54-
float confidence = 4;
55-
}
56-
5732
// Audio encoding of the audio content sent in the conversational query request.
5833
// Refer to the
5934
// [Cloud Speech API
@@ -103,6 +78,31 @@ enum AudioEncoding {
10378
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
10479
}
10580

81+
// Information for a word recognized by the speech recognizer.
82+
message SpeechWordInfo {
83+
// The word this info is for.
84+
string word = 3;
85+
86+
// Time offset relative to the beginning of the audio that corresponds to the
87+
// start of the spoken word. This is an experimental feature and the accuracy
88+
// of the time offset can vary.
89+
google.protobuf.Duration start_offset = 1;
90+
91+
// Time offset relative to the beginning of the audio that corresponds to the
92+
// end of the spoken word. This is an experimental feature and the accuracy of
93+
// the time offset can vary.
94+
google.protobuf.Duration end_offset = 2;
95+
96+
// The Speech confidence between 0.0 and 1.0 for this word. A higher number
97+
// indicates an estimated greater likelihood that the recognized word is
98+
// correct. The default of 0.0 is a sentinel value indicating that confidence
99+
// was not set.
100+
//
101+
// This field is not guaranteed to be fully stable over time for the same
102+
// audio input. Users should also not rely on it to always be provided.
103+
float confidence = 4;
104+
}
105+
106106
// Instructs the speech recognizer on how to process the audio content.
107107
message InputAudioConfig {
108108
// Required. Audio encoding of the audio content to process.

google/cloud/dialogflow/cx/v3/dialogflow_v3.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ types:
3030
- name: google.cloud.dialogflow.cx.v3.ImportFlowResponse
3131
- name: google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata
3232
- name: google.cloud.dialogflow.cx.v3.ImportTestCasesResponse
33+
- name: google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata
34+
- name: google.cloud.dialogflow.cx.v3.RunContinuousTestResponse
3335
- name: google.cloud.dialogflow.cx.v3.RunTestCaseMetadata
3436
- name: google.cloud.dialogflow.cx.v3.RunTestCaseResponse
3537
- name: google.cloud.dialogflow.cx.v3.TestError

google/cloud/dialogflow/cx/v3/environment.proto

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,26 @@ service Environments {
9898
};
9999
option (google.api.method_signature) = "name";
100100
}
101+
102+
// Kicks off a continuous test under the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
103+
rpc RunContinuousTest(RunContinuousTestRequest) returns (google.longrunning.Operation) {
104+
option (google.api.http) = {
105+
post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest"
106+
body: "*"
107+
};
108+
option (google.longrunning.operation_info) = {
109+
response_type: "RunContinuousTestResponse"
110+
metadata_type: "RunContinuousTestMetadata"
111+
};
112+
}
113+
114+
// Fetches a list of continuous test results for a given environment.
115+
rpc ListContinuousTestResults(ListContinuousTestResultsRequest) returns (ListContinuousTestResultsResponse) {
116+
option (google.api.http) = {
117+
get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults"
118+
};
119+
option (google.api.method_signature) = "parent";
120+
}
101121
}
102122

103123
// Represents an environment for an agent. You can create multiple versions
@@ -261,3 +281,96 @@ message LookupEnvironmentHistoryResponse {
261281
// results in the list.
262282
string next_page_token = 2;
263283
}
284+
285+
// Represents a result from running a test case in an agent environment.
286+
message ContinuousTestResult {
287+
option (google.api.resource) = {
288+
type: "dialogflow.googleapis.com/ContinuousTestResult"
289+
pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}"
290+
};
291+
292+
// The overall result for a continuous test run in an agent environment.
293+
enum AggregatedTestResult {
294+
// Not specified. Should never be used.
295+
AGGREGATED_TEST_RESULT_UNSPECIFIED = 0;
296+
297+
// All the tests passed.
298+
PASSED = 1;
299+
300+
// At least one test did not pass.
301+
FAILED = 2;
302+
}
303+
304+
// The resource name for the continuous test result. Format:
305+
// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
306+
// ID>/environments/<Environment
307+
// ID>/continuousTestResults/<ContinuousTestResult ID>`.
308+
string name = 1;
309+
310+
// The result of this continuous test run, i.e. whether all the tests in this
311+
// continuous test run pass or not.
312+
AggregatedTestResult result = 2;
313+
314+
// A list of individual test case results names in this continuous test run.
315+
repeated string test_case_results = 3 [(google.api.resource_reference) = {
316+
type: "dialogflow.googleapis.com/TestCaseResult"
317+
}];
318+
319+
// Time when the continuous testing run starts.
320+
google.protobuf.Timestamp run_time = 4;
321+
}
322+
323+
// The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
324+
message RunContinuousTestRequest {
325+
// Required. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
326+
// ID>/environments/<Environment ID>`.
327+
string environment = 1 [
328+
(google.api.field_behavior) = REQUIRED,
329+
(google.api.resource_reference) = {
330+
type: "dialogflow.googleapis.com/Environment"
331+
}
332+
];
333+
}
334+
335+
// The response message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
336+
message RunContinuousTestResponse {
337+
// The result for a continuous test run.
338+
ContinuousTestResult continuous_test_result = 1;
339+
}
340+
341+
// Metadata returned for the [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest] long running
342+
// operation.
343+
message RunContinuousTestMetadata {
344+
// The test errors.
345+
repeated TestError errors = 1;
346+
}
347+
348+
// The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults].
349+
message ListContinuousTestResultsRequest {
350+
// Required. The environment to list results for.
351+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
352+
// environments/<Environment ID>`.
353+
string parent = 1 [
354+
(google.api.field_behavior) = REQUIRED,
355+
(google.api.resource_reference) = {
356+
child_type: "dialogflow.googleapis.com/ContinuousTestResult"
357+
}
358+
];
359+
360+
// The maximum number of items to return in a single page. By default 100 and
361+
// at most 1000.
362+
int32 page_size = 2;
363+
364+
// The next_page_token value returned from a previous list request.
365+
string page_token = 3;
366+
}
367+
368+
// The response message for [Environments.ListTestCaseResults][].
369+
message ListContinuousTestResultsResponse {
370+
// The list of continuous test results.
371+
repeated ContinuousTestResult continuous_test_results = 1;
372+
373+
// Token to retrieve the next page of results, or empty if there are no more
374+
// results in the list.
375+
string next_page_token = 2;
376+
}

0 commit comments

Comments
 (0)