Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit dea9d08

Browse files
author
Benjamin E. Coe
authored
feat: v1 API surface added (#245)
1 parent 199e37f commit dea9d08

38 files changed

Lines changed: 20379 additions & 326 deletions
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2019 Google LLC.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
syntax = "proto3";
17+
18+
package google.cloud.automl.v1;
19+
20+
import "google/cloud/automl/v1/translation.proto";
21+
import "google/protobuf/any.proto";
22+
import "google/api/annotations.proto";
23+
24+
option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
25+
option csharp_namespace = "Google.Cloud.AutoML.V1";
26+
option java_multiple_files = true;
27+
option java_package = "com.google.cloud.automl.v1";
28+
option php_namespace = "Google\\Cloud\\AutoML\\V1";
29+
option ruby_package = "Google::Cloud::AutoML::V1";
30+
31+
// Contains annotation information that is relevant to AutoML.
32+
message AnnotationPayload {
33+
// Output only . Additional information about the annotation
34+
// specific to the AutoML domain.
35+
oneof detail {
36+
// Annotation details for translation.
37+
TranslationAnnotation translation = 2;
38+
}
39+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2019 Google LLC.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
syntax = "proto3";
17+
18+
package google.cloud.automl.v1;
19+
20+
import "google/cloud/automl/v1/io.proto";
21+
import "google/protobuf/any.proto";
22+
import "google/protobuf/duration.proto";
23+
import "google/protobuf/struct.proto";
24+
import "google/api/annotations.proto";
25+
26+
option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
27+
option csharp_namespace = "Google.Cloud.AutoML.V1";
28+
option java_multiple_files = true;
29+
option java_package = "com.google.cloud.automl.v1";
30+
option php_namespace = "Google\\Cloud\\AutoML\\V1";
31+
option ruby_package = "Google::Cloud::AutoML::V1";
32+
33+
// A representation of a text snippet.
34+
message TextSnippet {
35+
// Required. The content of the text snippet as a string. Up to 250000
36+
// characters long.
37+
string content = 1;
38+
39+
// Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
40+
// values are "text/html" and "text/plain". If left blank, the format is
41+
// automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
42+
string mime_type = 2;
43+
44+
// Output only. HTTP URI where you can download the content.
45+
string content_uri = 4;
46+
}
47+
48+
// Example data used for training or prediction.
49+
message ExamplePayload {
50+
// Required. Input only. The example data.
51+
oneof payload {
52+
// Example text.
53+
TextSnippet text_snippet = 2;
54+
}
55+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Copyright 2019 Google LLC.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
syntax = "proto3";
17+
18+
package google.cloud.automl.v1;
19+
20+
import "google/cloud/automl/v1/translation.proto";
21+
import "google/protobuf/timestamp.proto";
22+
import "google/api/annotations.proto";
23+
24+
option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
25+
option csharp_namespace = "Google.Cloud.AutoML.V1";
26+
option java_multiple_files = true;
27+
option java_package = "com.google.cloud.automl.v1";
28+
option php_namespace = "Google\\Cloud\\AutoML\\V1";
29+
option ruby_package = "Google::Cloud::AutoML::V1";
30+
31+
// A workspace for solving a single, particular machine learning (ML) problem.
32+
// A workspace contains examples that may be annotated.
33+
message Dataset {
34+
// Required.
35+
// The dataset metadata that is specific to the problem type.
36+
oneof dataset_metadata {
37+
// Metadata for a dataset used for translation.
38+
TranslationDatasetMetadata translation_dataset_metadata = 23;
39+
}
40+
41+
// Output only. The resource name of the dataset.
42+
// Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`
43+
string name = 1;
44+
45+
// Required. The name of the dataset to show in the interface. The name can be
46+
// up to 32 characters long and can consist only of ASCII Latin letters A-Z
47+
// and a-z, underscores
48+
// (_), and ASCII digits 0-9.
49+
string display_name = 2;
50+
51+
// User-provided description of the dataset. The description can be up to
52+
// 25000 characters long.
53+
string description = 3;
54+
55+
// Output only. The number of examples in the dataset.
56+
int32 example_count = 21;
57+
58+
// Output only. Timestamp when this dataset was created.
59+
google.protobuf.Timestamp create_time = 14;
60+
61+
// Used to perform consistent read-modify-write updates. If not set, a blind
62+
// "overwrite" update happens.
63+
string etag = 17;
64+
65+
// Optional. The labels with user-defined metadata to organize your dataset.
66+
//
67+
// Label keys and values can be no longer than 64 characters
68+
// (Unicode codepoints), can only contain lowercase letters, numeric
69+
// characters, underscores and dashes. International characters are allowed.
70+
// Label values are optional. Label keys must start with a letter.
71+
//
72+
// See https://goo.gl/xmQnxf for more information on and examples of labels.
73+
map<string, string> labels = 39;
74+
}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// Copyright 2019 Google LLC.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
syntax = "proto3";
17+
18+
package google.cloud.automl.v1;
19+
20+
import "google/api/annotations.proto";
21+
22+
option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
23+
option csharp_namespace = "Google.Cloud.AutoML.V1";
24+
option java_multiple_files = true;
25+
option java_package = "com.google.cloud.automl.v1";
26+
option php_namespace = "Google\\Cloud\\AutoML\\V1";
27+
option ruby_package = "Google::Cloud::AutoML::V1";
28+
29+
// Input configuration for ImportData Action.
30+
//
31+
// The format of input depends on dataset_metadata the Dataset into which
32+
// the import is happening has. As input source the
33+
// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source]
34+
// is expected, unless specified otherwise. Additionally any input .CSV file
35+
// by itself must be 100MB or smaller, unless specified otherwise.
36+
// If an "example" file (that is, image, video etc.) with identical content
37+
// (even if it had different GCS_FILE_PATH) is mentioned multiple times, then
38+
// its label, bounding boxes etc. are appended. The same file should be always
39+
// provided with the same ML_USE and GCS_FILE_PATH, if it is not, then
40+
// these values are nondeterministically selected from the given ones.
41+
//
42+
// Errors:
43+
// If any of the provided CSV files can't be parsed or if more than certain
44+
// percent of CSV rows cannot be processed then the operation fails and
45+
// nothing is imported. Regardless of overall success or failure the per-row
46+
// failures, up to a certain count cap, is listed in
47+
// Operation.metadata.partial_failures.
48+
//
49+
message InputConfig {
50+
// The source of the input.
51+
oneof source {
52+
// The Google Cloud Storage location for the input content.
53+
// In ImportData, the gcs_source points to a csv with structure described in
54+
// the comment.
55+
GcsSource gcs_source = 1;
56+
}
57+
58+
// Additional domain-specific parameters describing the semantic of the
59+
// imported data, any string must be up to 25000
60+
// characters long.
61+
map<string, string> params = 2;
62+
}
63+
64+
// * For Translation:
65+
// CSV file `translation.csv`, with each line in format:
66+
// ML_USE,GCS_FILE_PATH
67+
// GCS_FILE_PATH leads to a .TSV file which describes examples that have
68+
// given ML_USE, using the following row format per line:
69+
// TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target
70+
// language)
71+
//
72+
// `export_data_<automl-dataset-display-name>_<timestamp-of-export-call>`
73+
// where <automl-dataset-display-name> will be made
74+
// BigQuery-dataset-name compatible (e.g. most special characters will
75+
// become underscores), and timestamp will be in
76+
// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that
77+
// dataset a new table called `primary_table` will be created, and
78+
// filled with precisely the same data as this obtained on import.
79+
message OutputConfig {
80+
// Required. The destination of the output.
81+
oneof destination {
82+
// The Google Cloud Storage location where the output is to be written to.
83+
// For Image Object Detection, Text Extraction, Video Classification and
84+
// Tables, in the given directory a new directory will be created with name:
85+
// export_data-<dataset-display-name>-<timestamp-of-export-call> where
86+
// timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
87+
// output will be written into that directory.
88+
GcsDestination gcs_destination = 1;
89+
}
90+
}
91+
92+
// The Google Cloud Storage location for the input content.
93+
message GcsSource {
94+
// Required. Google Cloud Storage URIs to input files, up to 2000 characters
95+
// long. Accepted forms:
96+
// * Full object path, e.g. gs://bucket/directory/object.csv
97+
repeated string input_uris = 1;
98+
}
99+
100+
// The Google Cloud Storage location where the output is to be written to.
101+
message GcsDestination {
102+
// Required. Google Cloud Storage URI to output directory, up to 2000
103+
// characters long.
104+
// Accepted forms:
105+
// * Prefix path: gs://bucket/directory
106+
// The requesting user must have write permission to the bucket.
107+
// The directory is created if it doesn't exist.
108+
string output_uri_prefix = 1;
109+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Copyright 2019 Google LLC.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
syntax = "proto3";
17+
18+
package google.cloud.automl.v1;
19+
20+
import "google/cloud/automl/v1/translation.proto";
21+
import "google/protobuf/timestamp.proto";
22+
import "google/api/annotations.proto";
23+
24+
option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
25+
option csharp_namespace = "Google.Cloud.AutoML.V1";
26+
option java_multiple_files = true;
27+
option java_package = "com.google.cloud.automl.v1";
28+
option php_namespace = "Google\\Cloud\\AutoML\\V1";
29+
option ruby_package = "Google::Cloud::AutoML::V1";
30+
31+
// API proto representing a trained machine learning model.
32+
message Model {
33+
// Deployment state of the model.
34+
enum DeploymentState {
35+
// Should not be used, an un-set enum has this value by default.
36+
DEPLOYMENT_STATE_UNSPECIFIED = 0;
37+
38+
// Model is deployed.
39+
DEPLOYED = 1;
40+
41+
// Model is not deployed.
42+
UNDEPLOYED = 2;
43+
}
44+
45+
// Required.
46+
// The model metadata that is specific to the problem type.
47+
// Must match the metadata type of the dataset used to train the model.
48+
oneof model_metadata {
49+
// Metadata for translation models.
50+
TranslationModelMetadata translation_model_metadata = 15;
51+
}
52+
53+
// Output only. Resource name of the model.
54+
// Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
55+
string name = 1;
56+
57+
// Required. The name of the model to show in the interface. The name can be
58+
// up to 32 characters long and can consist only of ASCII Latin letters A-Z
59+
// and a-z, underscores
60+
// (_), and ASCII digits 0-9. It must start with a letter.
61+
string display_name = 2;
62+
63+
// Required. The resource ID of the dataset used to create the model. The dataset must
64+
// come from the same ancestor project and location.
65+
string dataset_id = 3;
66+
67+
// Output only. Timestamp when the model training finished and can be used for prediction.
68+
google.protobuf.Timestamp create_time = 7;
69+
70+
// Output only. Timestamp when this model was last updated.
71+
google.protobuf.Timestamp update_time = 11;
72+
73+
// Output only. Deployment state of the model. A model can only serve
74+
// prediction requests after it gets deployed.
75+
DeploymentState deployment_state = 8;
76+
77+
// Optional. The labels with user-defined metadata to organize your model.
78+
//
79+
// Label keys and values can be no longer than 64 characters
80+
// (Unicode codepoints), can only contain lowercase letters, numeric
81+
// characters, underscores and dashes. International characters are allowed.
82+
// Label values are optional. Label keys must start with a letter.
83+
//
84+
// See https://goo.gl/xmQnxf for more information on and examples of labels.
85+
map<string, string> labels = 34;
86+
}

0 commit comments

Comments
 (0)