DataLabelingServiceClient

DataLabelingServiceClient

Service for the AI Platform Data Labeling API.

Constructor

new DataLabelingServiceClient(optionsopt, gaxInstanceopt)

Construct an instance of DataLabelingServiceClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. The options accepted by the constructor are described in detail in this document. The common options are:

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

clientConfig gax.ClientConfig <optional>

Client configuration override. Follows the structure of gapicConfig.

fallback boolean | "rest" <optional>

Use HTTP fallback mode. Pass "rest" to use HTTP/1.1 REST API instead of gRPC. For more information, please check the documentation.

gaxInstance gax <optional>

loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new DataLabelingServiceClient({fallback: 'rest'}, gax);

Members

apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

port

The port for this API service.

scopes

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

The DNS address for this API service.

Methods

annotatedDatasetPath(project, dataset, annotated_dataset) → {string}

Return a fully-qualified annotatedDataset resource name string.

Parameters:
Name Type Description
project string
dataset string
annotated_dataset string
Returns:
Type Description
string

Resource name string.

annotationSpecSetPath(project, annotation_spec_set) → {string}

Return a fully-qualified annotationSpecSet resource name string.

Parameters:
Name Type Description
project string
annotation_spec_set string
Returns:
Type Description
string

Resource name string.

(async) checkCreateInstructionProgress(name) → {Promise}

Check the status of the long running operation returned by createInstruction().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Instruction resource parent, format:
   *  projects/{project_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. Instruction of how to perform the labeling task.
   */
  // const instruction = {}

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callCreateInstruction() {
    // Construct request
    const request = {
      parent,
      instruction,
    };

    // Run request
    const [operation] = await datalabelingClient.createInstruction(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateInstruction();

(async) checkExportDataProgress(name) → {Promise}

Check the status of the long running operation returned by exportData().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Dataset resource name, format:
   *  projects/{project_id}/datasets/{dataset_id}
   */
  // const name = 'abc123'
  /**
   *  Required. Annotated dataset resource name. DataItem in
   *  Dataset and their annotations in specified annotated dataset will be
   *  exported. It's in format of
   *  projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/
   *  {annotated_dataset_id}
   */
  // const annotatedDataset = 'abc123'
  /**
   *  Optional. Filter is not supported at this moment.
   */
  // const filter = 'abc123'
  /**
   *  Required. Specify the output destination.
   */
  // const outputConfig = {}
  /**
   *  Email of the user who started the export task and should be notified by
   *  email. If empty no notification will be sent.
   */
  // const userEmailAddress = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callExportData() {
    // Construct request
    const request = {
      name,
      annotatedDataset,
      outputConfig,
    };

    // Run request
    const [operation] = await datalabelingClient.exportData(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callExportData();

(async) checkImportDataProgress(name) → {Promise}

Check the status of the long running operation returned by importData().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Dataset resource name, format:
   *  projects/{project_id}/datasets/{dataset_id}
   */
  // const name = 'abc123'
  /**
   *  Required. Specify the input source of the data.
   */
  // const inputConfig = {}
  /**
   *  Email of the user who started the import task and should be notified by
   *  email. If empty no notification will be sent.
   */
  // const userEmailAddress = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callImportData() {
    // Construct request
    const request = {
      name,
      inputConfig,
    };

    // Run request
    const [operation] = await datalabelingClient.importData(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callImportData();

(async) checkLabelImageProgress(name) → {Promise}

Check the status of the long running operation returned by labelImage().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Configuration for image classification task.
   *  One of image_classification_config, bounding_poly_config,
   *  polyline_config and segmentation_config are required.
   */
  // const imageClassificationConfig = {}
  /**
   *  Configuration for bounding box and bounding poly task.
   *  One of image_classification_config, bounding_poly_config,
   *  polyline_config and segmentation_config are required.
   */
  // const boundingPolyConfig = {}
  /**
   *  Configuration for polyline task.
   *  One of image_classification_config, bounding_poly_config,
   *  polyline_config and segmentation_config are required.
   */
  // const polylineConfig = {}
  /**
   *  Configuration for segmentation task.
   *  One of image_classification_config, bounding_poly_config,
   *  polyline_config and segmentation_config are required.
   */
  // const segmentationConfig = {}
  /**
   *  Required. Name of the dataset to request labeling task, format:
   *  projects/{project_id}/datasets/{dataset_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. Basic human annotation config.
   */
  // const basicConfig = {}
  /**
   *  Required. The type of image labeling task.
   */
  // const feature = {}

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callLabelImage() {
    // Construct request
    const request = {
      parent,
      basicConfig,
      feature,
    };

    // Run request
    const [operation] = await datalabelingClient.labelImage(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callLabelImage();

(async) checkLabelTextProgress(name) → {Promise}

Check the status of the long running operation returned by labelText().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Configuration for text classification task.
   *  One of text_classification_config and text_entity_extraction_config
   *  is required.
   */
  // const textClassificationConfig = {}
  /**
   *  Configuration for entity extraction task.
   *  One of text_classification_config and text_entity_extraction_config
   *  is required.
   */
  // const textEntityExtractionConfig = {}
  /**
   *  Required. Name of the data set to request labeling task, format:
   *  projects/{project_id}/datasets/{dataset_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. Basic human annotation config.
   */
  // const basicConfig = {}
  /**
   *  Required. The type of text labeling task.
   */
  // const feature = {}

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callLabelText() {
    // Construct request
    const request = {
      parent,
      basicConfig,
      feature,
    };

    // Run request
    const [operation] = await datalabelingClient.labelText(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callLabelText();

(async) checkLabelVideoProgress(name) → {Promise}

Check the status of the long running operation returned by labelVideo().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Configuration for video classification task.
   *  One of video_classification_config, object_detection_config,
   *  object_tracking_config and event_config is required.
   */
  // const videoClassificationConfig = {}
  /**
   *  Configuration for video object detection task.
   *  One of video_classification_config, object_detection_config,
   *  object_tracking_config and event_config is required.
   */
  // const objectDetectionConfig = {}
  /**
   *  Configuration for video object tracking task.
   *  One of video_classification_config, object_detection_config,
   *  object_tracking_config and event_config is required.
   */
  // const objectTrackingConfig = {}
  /**
   *  Configuration for video event task.
   *  One of video_classification_config, object_detection_config,
   *  object_tracking_config and event_config is required.
   */
  // const eventConfig = {}
  /**
   *  Required. Name of the dataset to request labeling task, format:
   *  projects/{project_id}/datasets/{dataset_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. Basic human annotation config.
   */
  // const basicConfig = {}
  /**
   *  Required. The type of video labeling task.
   */
  // const feature = {}

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callLabelVideo() {
    // Construct request
    const request = {
      parent,
      basicConfig,
      feature,
    };

    // Run request
    const [operation] = await datalabelingClient.labelVideo(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callLabelVideo();

close() → {Promise}

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns:
Type Description
Promise

A promise that resolves when the client is closed.

dataItemPath(project, dataset, data_item) → {string}

Return a fully-qualified dataItem resource name string.

Parameters:
Name Type Description
project string
dataset string
data_item string
Returns:
Type Description
string

Resource name string.

datasetPath(project, dataset) → {string}

Return a fully-qualified dataset resource name string.

Parameters:
Name Type Description
project string
dataset string
Returns:
Type Description
string

Resource name string.

evaluationJobPath(project, evaluation_job) → {string}

Return a fully-qualified evaluationJob resource name string.

Parameters:
Name Type Description
project string
evaluation_job string
Returns:
Type Description
string

Resource name string.

evaluationPath(project, dataset, evaluation) → {string}

Return a fully-qualified evaluation resource name string.

Parameters:
Name Type Description
project string
dataset string
evaluation string
Returns:
Type Description
string

Resource name string.

examplePath(project, dataset, annotated_dataset, example) → {string}

Return a fully-qualified example resource name string.

Parameters:
Name Type Description
project string
dataset string
annotated_dataset string
example string
Returns:
Type Description
string

Resource name string.

getProjectId() → {Promise}

Return the project ID used by this class.

Returns:
Type Description
Promise

A promise that resolves to string containing the project ID.

initialize() → {Promise}

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns:
Type Description
Promise

A promise that resolves to an authenticated service stub.

instructionPath(project, instruction) → {string}

Return a fully-qualified instruction resource name string.

Parameters:
Name Type Description
project string
instruction string
Returns:
Type Description
string

Resource name string.

listAnnotatedDatasetsAsync(request, optionsopt) → {Object}

Equivalent to listAnnotatedDatasets, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Name of the dataset to list annotated datasets, format: projects/{project_id}/datasets/{dataset_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListAnnotatedDatasetsResponse.next_page_token of the previous [DataLabelingService.ListAnnotatedDatasets] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing AnnotatedDataset. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the dataset to list annotated datasets, format:
   *  projects/{project_id}/datasets/{dataset_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. Filter is not supported at this moment.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by
   *  ListAnnotatedDatasetsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token  of the previous
   *  DataLabelingService.ListAnnotatedDatasets  call.
   *  Return first page if empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListAnnotatedDatasets() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listAnnotatedDatasetsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListAnnotatedDatasets();

listAnnotatedDatasetsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Name of the dataset to list annotated datasets, format: projects/{project_id}/datasets/{dataset_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListAnnotatedDatasetsResponse.next_page_token of the previous [DataLabelingService.ListAnnotatedDatasets] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing AnnotatedDataset on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listAnnotatedDatasetsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listAnnotationSpecSetsAsync(request, optionsopt) → {Object}

Equivalent to listAnnotationSpecSets, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Parent of AnnotationSpecSet resource, format: projects/{project_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListAnnotationSpecSetsResponse.next_page_token of the previous [DataLabelingService.ListAnnotationSpecSets] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing AnnotationSpecSet. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent of AnnotationSpecSet resource, format:
   *  projects/{project_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. Filter is not supported at this moment.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by
   *  ListAnnotationSpecSetsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token  of the previous
   *  DataLabelingService.ListAnnotationSpecSets  call.
   *  Return first page if empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListAnnotationSpecSets() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listAnnotationSpecSetsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListAnnotationSpecSets();

listAnnotationSpecSetsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Parent of AnnotationSpecSet resource, format: projects/{project_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListAnnotationSpecSetsResponse.next_page_token of the previous [DataLabelingService.ListAnnotationSpecSets] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing AnnotationSpecSet on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listAnnotationSpecSetsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDataItemsAsync(request, optionsopt) → {Object}

Equivalent to listDataItems, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Name of the dataset to list data items, format: projects/{project_id}/datasets/{dataset_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListDataItemsResponse.next_page_token of the previous [DataLabelingService.ListDataItems] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing DataItem. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the dataset to list data items, format:
   *  projects/{project_id}/datasets/{dataset_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. Filter is not supported at this moment.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by
   *  ListDataItemsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token  of the previous
   *  DataLabelingService.ListDataItems  call.
   *  Return first page if empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListDataItems() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listDataItemsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListDataItems();

listDataItemsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Name of the dataset to list data items, format: projects/{project_id}/datasets/{dataset_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListDataItemsResponse.next_page_token of the previous [DataLabelingService.ListDataItems] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing DataItem on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listDataItemsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDatasetsAsync(request, optionsopt) → {Object}

Equivalent to listDatasets, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Dataset resource parent, format: projects/{project_id}

filter string <optional>

Optional. Filter on dataset is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListDatasetsResponse.next_page_token of the previous [DataLabelingService.ListDatasets] call. Returns the first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Dataset. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Dataset resource parent, format:
   *  projects/{project_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. Filter on dataset is not supported at this moment.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by
   *  ListDatasetsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token  of the previous
   *  DataLabelingService.ListDatasets  call.
   *  Returns the first page if empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListDatasets() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listDatasetsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListDatasets();

listDatasetsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Dataset resource parent, format: projects/{project_id}

filter string <optional>

Optional. Filter on dataset is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListDatasetsResponse.next_page_token of the previous [DataLabelingService.ListDatasets] call. Returns the first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Dataset on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listDatasetsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listEvaluationJobsAsync(request, optionsopt) → {Object}

Equivalent to listEvaluationJobs, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Evaluation job resource parent. Format: "projects/{project_id}"

filter string <optional>

Optional. You can filter the jobs to list by model_id (also known as model_name, as described in EvaluationJob.modelVersion) or by evaluation job state (as described in EvaluationJob.state). To filter by both criteria, use the AND operator or the OR operator. For example, you can use the following string for your filter: "evaluationjob.model_id = {model_name} AND evaluationjob.state = {evaluation_job_state}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by the nextPageToken in the response to the previous request. The request returns the first page if this is empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing EvaluationJob. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Evaluation job resource parent. Format:
   *  "projects/<var>{project_id}</var>"
   */
  // const parent = 'abc123'
  /**
   *  Optional. You can filter the jobs to list by model_id (also known as
   *  model_name, as described in
   *  EvaluationJob.modelVersion google.cloud.datalabeling.v1beta1.EvaluationJob.model_version) or by
   *  evaluation job state (as described in EvaluationJob.state google.cloud.datalabeling.v1beta1.EvaluationJob.state). To filter
   *  by both criteria, use the `AND` operator or the `OR` operator. For example,
   *  you can use the following string for your filter:
   *  "evaluation<span>_</span>job.model_id = <var>{model_name}</var> AND
   *  evaluation<span>_</span>job.state = <var>{evaluation_job_state}</var>"
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by the
   *  nextPageToken google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token  in the response
   *  to the previous request. The request returns the first page if this is
   *  empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListEvaluationJobs() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listEvaluationJobsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListEvaluationJobs();

listEvaluationJobsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Evaluation job resource parent. Format: "projects/{project_id}"

filter string <optional>

Optional. You can filter the jobs to list by model_id (also known as model_name, as described in EvaluationJob.modelVersion) or by evaluation job state (as described in EvaluationJob.state). To filter by both criteria, use the AND operator or the OR operator. For example, you can use the following string for your filter: "evaluationjob.model_id = {model_name} AND evaluationjob.state = {evaluation_job_state}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by the nextPageToken in the response to the previous request. The request returns the first page if this is empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing EvaluationJob on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listEvaluationJobsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listExamplesAsync(request, optionsopt) → {Object}

Equivalent to listExamples, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Example resource parent.

filter string <optional>

Optional. An expression for filtering Examples. For annotated datasets that have annotation spec set, filter by annotation_spec.display_name is supported. Format "annotation_spec.display_name = {display_name}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListExamplesResponse.next_page_token of the previous [DataLabelingService.ListExamples] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Example. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Example resource parent.
   */
  // const parent = 'abc123'
  /**
   *  Optional. An expression for filtering Examples. For annotated datasets that
   *  have annotation spec set, filter by
   *  annotation_spec.display_name is supported. Format
   *  "annotation_spec.display_name = {display_name}"
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by
   *  ListExamplesResponse.next_page_token google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token  of the previous
   *  DataLabelingService.ListExamples  call.
   *  Return first page if empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListExamples() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listExamplesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListExamples();

listExamplesStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Example resource parent.

filter string <optional>

Optional. An expression for filtering Examples. For annotated datasets that have annotation spec set, filter by annotation_spec.display_name is supported. Format "annotation_spec.display_name = {display_name}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListExamplesResponse.next_page_token of the previous [DataLabelingService.ListExamples] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Example on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listExamplesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listInstructionsAsync(request, optionsopt) → {Object}

Equivalent to listInstructions, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Instruction resource parent, format: projects/{project_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListInstructionsResponse.next_page_token of the previous [DataLabelingService.ListInstructions] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Instruction. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Instruction resource parent, format:
   *  projects/{project_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. Filter is not supported at this moment.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by
   *  ListInstructionsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token  of the previous
   *  DataLabelingService.ListInstructions  call.
   *  Return first page if empty.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callListInstructions() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.listInstructionsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListInstructions();

listInstructionsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Instruction resource parent, format: projects/{project_id}

filter string <optional>

Optional. Filter is not supported at this moment.

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by ListInstructionsResponse.next_page_token of the previous [DataLabelingService.ListInstructions] call. Return first page if empty.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Instruction on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listInstructionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

matchAnnotatedDatasetFromAnnotatedDatasetName(annotatedDatasetName) → {string}

Parse the annotated_dataset from AnnotatedDataset resource.

Parameters:
Name Type Description
annotatedDatasetName string

A fully-qualified path representing AnnotatedDataset resource.

Returns:
Type Description
string

A string representing the annotated_dataset.

matchAnnotatedDatasetFromExampleName(exampleName) → {string}

Parse the annotated_dataset from Example resource.

Parameters:
Name Type Description
exampleName string

A fully-qualified path representing Example resource.

Returns:
Type Description
string

A string representing the annotated_dataset.

matchAnnotationSpecSetFromAnnotationSpecSetName(annotationSpecSetName) → {string}

Parse the annotation_spec_set from AnnotationSpecSet resource.

Parameters:
Name Type Description
annotationSpecSetName string

A fully-qualified path representing AnnotationSpecSet resource.

Returns:
Type Description
string

A string representing the annotation_spec_set.

matchDataItemFromDataItemName(dataItemName) → {string}

Parse the data_item from DataItem resource.

Parameters:
Name Type Description
dataItemName string

A fully-qualified path representing DataItem resource.

Returns:
Type Description
string

A string representing the data_item.

matchDatasetFromAnnotatedDatasetName(annotatedDatasetName) → {string}

Parse the dataset from AnnotatedDataset resource.

Parameters:
Name Type Description
annotatedDatasetName string

A fully-qualified path representing AnnotatedDataset resource.

Returns:
Type Description
string

A string representing the dataset.

matchDatasetFromDataItemName(dataItemName) → {string}

Parse the dataset from DataItem resource.

Parameters:
Name Type Description
dataItemName string

A fully-qualified path representing DataItem resource.

Returns:
Type Description
string

A string representing the dataset.

matchDatasetFromDatasetName(datasetName) → {string}

Parse the dataset from Dataset resource.

Parameters:
Name Type Description
datasetName string

A fully-qualified path representing Dataset resource.

Returns:
Type Description
string

A string representing the dataset.

matchDatasetFromEvaluationName(evaluationName) → {string}

Parse the dataset from Evaluation resource.

Parameters:
Name Type Description
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns:
Type Description
string

A string representing the dataset.

matchDatasetFromExampleName(exampleName) → {string}

Parse the dataset from Example resource.

Parameters:
Name Type Description
exampleName string

A fully-qualified path representing Example resource.

Returns:
Type Description
string

A string representing the dataset.

matchEvaluationFromEvaluationName(evaluationName) → {string}

Parse the evaluation from Evaluation resource.

Parameters:
Name Type Description
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns:
Type Description
string

A string representing the evaluation.

matchEvaluationJobFromEvaluationJobName(evaluationJobName) → {string}

Parse the evaluation_job from EvaluationJob resource.

Parameters:
Name Type Description
evaluationJobName string

A fully-qualified path representing EvaluationJob resource.

Returns:
Type Description
string

A string representing the evaluation_job.

matchExampleFromExampleName(exampleName) → {string}

Parse the example from Example resource.

Parameters:
Name Type Description
exampleName string

A fully-qualified path representing Example resource.

Returns:
Type Description
string

A string representing the example.

matchInstructionFromInstructionName(instructionName) → {string}

Parse the instruction from Instruction resource.

Parameters:
Name Type Description
instructionName string

A fully-qualified path representing Instruction resource.

Returns:
Type Description
string

A string representing the instruction.

matchProjectFromAnnotatedDatasetName(annotatedDatasetName) → {string}

Parse the project from AnnotatedDataset resource.

Parameters:
Name Type Description
annotatedDatasetName string

A fully-qualified path representing AnnotatedDataset resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromAnnotationSpecSetName(annotationSpecSetName) → {string}

Parse the project from AnnotationSpecSet resource.

Parameters:
Name Type Description
annotationSpecSetName string

A fully-qualified path representing AnnotationSpecSet resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromDataItemName(dataItemName) → {string}

Parse the project from DataItem resource.

Parameters:
Name Type Description
dataItemName string

A fully-qualified path representing DataItem resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromDatasetName(datasetName) → {string}

Parse the project from Dataset resource.

Parameters:
Name Type Description
datasetName string

A fully-qualified path representing Dataset resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromEvaluationJobName(evaluationJobName) → {string}

Parse the project from EvaluationJob resource.

Parameters:
Name Type Description
evaluationJobName string

A fully-qualified path representing EvaluationJob resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromEvaluationName(evaluationName) → {string}

Parse the project from Evaluation resource.

Parameters:
Name Type Description
evaluationName string

A fully-qualified path representing Evaluation resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromExampleName(exampleName) → {string}

Parse the project from Example resource.

Parameters:
Name Type Description
exampleName string

A fully-qualified path representing Example resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromInstructionName(instructionName) → {string}

Parse the project from Instruction resource.

Parameters:
Name Type Description
instructionName string

A fully-qualified path representing Instruction resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromProjectName(projectName) → {string}

Parse the project from Project resource.

Parameters:
Name Type Description
projectName string

A fully-qualified path representing Project resource.

Returns:
Type Description
string

A string representing the project.

projectPath(project) → {string}

Return a fully-qualified project resource name string.

Parameters:
Name Type Description
project string
Returns:
Type Description
string

Resource name string.

searchEvaluationsAsync(request, optionsopt) → {Object}

Equivalent to searchEvaluations, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Evaluation search parent (project ID). Format: "projects/{project_id}"

filter string <optional>

Optional. To search evaluations, you can filter by the following:

  • evaluation_job.evaluation_job_id (the last part of EvaluationJob.name)
  • evaluation_job.model_id (the {model_name} portion of EvaluationJob.modelVersion)
  • evaluation_job.evaluation_job_run_time_start (Minimum threshold for the evaluationJobRunTime that created the evaluation)
  • evaluation_job.evaluation_job_run_time_end (Maximum threshold for the evaluationJobRunTime that created the evaluation)
  • evaluation_job.job_state (EvaluationJob.state)
  • annotation_spec.display_name (the Evaluation contains a metric for the annotation spec with this displayName)

To filter by multiple critiera, use the AND operator or the OR operator. The following examples shows a string that filters by several critiera:

"evaluationjob.evaluation_job_id = {evaluation_job_id} AND evaluationjob.model_id = {model_name} AND evaluationjob.evaluation_job_run_time_start = {timestamp_1} AND evaluationjob.evaluation_job_run_time_end = {timestamp_2} AND annotation_spec.display_name = {display_name}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by the nextPageToken of the response to a previous search request.

If you don't specify this field, the API call requests the first page of the search.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Evaluation. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Evaluation search parent (project ID). Format:
   *  "projects/<var>{project_id}</var>"
   */
  // const parent = 'abc123'
  /**
   *  Optional. To search evaluations, you can filter by the following:
   *  * evaluation<span>_</span>job.evaluation_job_id (the last part of
   *    EvaluationJob.name google.cloud.datalabeling.v1beta1.EvaluationJob.name)
   *  * evaluation<span>_</span>job.model_id (the <var>{model_name}</var> portion
   *    of EvaluationJob.modelVersion google.cloud.datalabeling.v1beta1.EvaluationJob.model_version)
   *  * evaluation<span>_</span>job.evaluation_job_run_time_start (Minimum
   *    threshold for the
   *    evaluationJobRunTime google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time  that created
   *    the evaluation)
   *  * evaluation<span>_</span>job.evaluation_job_run_time_end (Maximum
   *    threshold for the
   *    evaluationJobRunTime google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time  that created
   *    the evaluation)
   *  * evaluation<span>_</span>job.job_state (EvaluationJob.state google.cloud.datalabeling.v1beta1.EvaluationJob.state)
   *  * annotation<span>_</span>spec.display_name (the Evaluation contains a
   *    metric for the annotation spec with this
   *    displayName google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name)
   *  To filter by multiple critiera, use the `AND` operator or the `OR`
   *  operator. The following examples shows a string that filters by several
   *  critiera:
   *  "evaluation<span>_</span>job.evaluation_job_id =
   *  <var>{evaluation_job_id}</var> AND evaluation<span>_</span>job.model_id =
   *  <var>{model_name}</var> AND
   *  evaluation<span>_</span>job.evaluation_job_run_time_start =
   *  <var>{timestamp_1}</var> AND
   *  evaluation<span>_</span>job.evaluation_job_run_time_end =
   *  <var>{timestamp_2}</var> AND annotation<span>_</span>spec.display_name =
   *  <var>{display_name}</var>"
   */
  // const filter = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by the
   *  nextPageToken google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token  of the response
   *  to a previous search request.
   *  If you don't specify this field, the API call requests the first page of
   *  the search.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callSearchEvaluations() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.searchEvaluationsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callSearchEvaluations();

searchEvaluationsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Evaluation search parent (project ID). Format: "projects/{project_id}"

filter string <optional>

Optional. To search evaluations, you can filter by the following:

  • evaluation_job.evaluation_job_id (the last part of EvaluationJob.name)
  • evaluation_job.model_id (the {model_name} portion of EvaluationJob.modelVersion)
  • evaluation_job.evaluation_job_run_time_start (Minimum threshold for the evaluationJobRunTime that created the evaluation)
  • evaluation_job.evaluation_job_run_time_end (Maximum threshold for the evaluationJobRunTime that created the evaluation)
  • evaluation_job.job_state (EvaluationJob.state)
  • annotation_spec.display_name (the Evaluation contains a metric for the annotation spec with this displayName)

To filter by multiple critiera, use the AND operator or the OR operator. The following examples shows a string that filters by several critiera:

"evaluationjob.evaluation_job_id = {evaluation_job_id} AND evaluationjob.model_id = {model_name} AND evaluationjob.evaluation_job_run_time_start = {timestamp_1} AND evaluationjob.evaluation_job_run_time_end = {timestamp_2} AND annotation_spec.display_name = {display_name}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by the nextPageToken of the response to a previous search request.

If you don't specify this field, the API call requests the first page of the search.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Evaluation on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using searchEvaluationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

searchExampleComparisonsAsync(request, optionsopt) → {Object}

Equivalent to searchExampleComparisons, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Name of the Evaluation resource to search for example comparisons from. Format:

"projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by the nextPageToken of the response to a previous search rquest.

If you don't specify this field, the API call requests the first page of the search.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ExampleComparison. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the Evaluation google.cloud.datalabeling.v1beta1.Evaluation  resource to search for example
   *  comparisons from. Format:
   *  "projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>"
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer results than
   *  requested. Default value is 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results for the server to return.
   *  Typically obtained by the
   *  nextPageToken SearchExampleComparisons.next_page_token  of the response
   *  to a previous search rquest.
   *  If you don't specify this field, the API call requests the first page of
   *  the search.
   */
  // const pageToken = 'abc123'

  // Imports the Datalabeling library
  const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1;

  // Instantiates a client
  const datalabelingClient = new DataLabelingServiceClient();

  async function callSearchExampleComparisons() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await datalabelingClient.searchExampleComparisonsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callSearchExampleComparisons();

searchExampleComparisonsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. Name of the Evaluation resource to search for example comparisons from. Format:

"projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}"

pageSize number <optional>

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

pageToken string <optional>

Optional. A token identifying a page of results for the server to return. Typically obtained by the nextPageToken of the response to a previous search rquest.

If you don't specify this field, the API call requests the first page of the search.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing ExampleComparison on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using searchExampleComparisonsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.