Class AutoMlClient (0.10.0)

AutoMlClient(transport=None,channel=None,credentials=None,client_config=None,client_info=None,client_options=None,)

AutoML Server API.

The resource names are assigned by the server. The server never reusesnames that it has created after the resources with those names aredeleted.

An ID of a resource is the last element of the item's resource name. Forprojects/{project_id}/locations/{location_id}/datasets/{dataset_id},then the id for the item is{dataset_id}.

Currently the only supportedlocation_id is "us-central1".

On any input that is documented to expect a string parameter insnake_case or kebab-case, either of those cases is accepted.

Methods

AutoMlClient

AutoMlClient(transport=None,channel=None,credentials=None,client_config=None,client_info=None,client_options=None,)

Constructor.

Parameters
NameDescription
channelgrpc.Channel

DEPRECATED. AChannel instance through which to make calls. This argument is mutually exclusive withcredentials; providing both will raise an exception.

credentialsgoogle.auth.credentials.Credentials

The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. This argument is mutually exclusive with providing a transport instance totransport; doing so will raise an exception.

client_configdict

DEPRECATED. A dictionary of call options for each method. If not specified, the default configuration is used.

client_infogoogle.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. IfNone, then default info will be used. Generally, you only need to set this if you're developing your own client library.

client_optionsUnion[dict, google.api_core.client_options.ClientOptions]

Client options used to set user options on the client. API Endpoint should be set through client_options.

annotation_spec_path

annotation_spec_path(project,location,dataset,annotation_spec)

Return a fully-qualified annotation_spec string.

create_dataset

create_dataset(parent,dataset,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Creates a dataset.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

parent = client.location_path('[PROJECT]', '[LOCATION]')

TODO: Initializedataset:

dataset = {}

response = client.create_dataset(parent, dataset)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
parentstr

The resource name of the project to create the dataset for.

datasetUnion[dict,Dataset]

The dataset to create. If a dict is provided, it must be of the same form as the protobuf messageDataset

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

create_model

create_model(parent,model,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Creates a model. Returns a Model in theresponse field when itcompletes. When you create a model, several model evaluations arecreated for it: a global evaluation, and one evaluation for eachannotation spec.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

parent = client.location_path('[PROJECT]', '[LOCATION]')

TODO: Initializemodel:

model = {}

response = client.create_model(parent, model)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
parentstr

Resource name of the parent project where the model is being created.

modelUnion[dict,Model]

The model to create. If a dict is provided, it must be of the same form as the protobuf messageModel

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

dataset_path

dataset_path(project,location,dataset)

Return a fully-qualified dataset string.

delete_dataset

delete_dataset(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Deletes a dataset and all of its contents. Returns empty response in theresponse field when it completes, anddelete_details in themetadata field.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')

response = client.delete_dataset(name)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
namestr

The resource name of the dataset to delete.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

delete_model

delete_model(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Deletes a model. Returnsgoogle.protobuf.Empty in theresponsefield when it completes, anddelete_details in themetadatafield.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')

response = client.delete_model(name)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
namestr

Resource name of the model being deleted.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

deploy_model

deploy_model(name,image_object_detection_model_deployment_metadata=None,image_classification_model_deployment_metadata=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Deploys a model. If a model is already deployed, deploying it with thesame parameters has no effect. Deploying with different parametrs (ase.g. changing

node_number) will reset the deployment state without pausing themodel's availability.

Only applicable for Text Classification, Image Object Detection; allother domains manage deployment automatically.

Returns an empty response in theresponse field when it completes.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')

response = client.deploy_model(name)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
namestr

Resource name of the model to deploy.

image_object_detection_model_deployment_metadataUnion[dict,ImageObjectDetectionModelDeploymentMetadata]

Model deployment metadata specific to Image Object Detection. If a dict is provided, it must be of the same form as the protobuf messageImageObjectDetectionModelDeploymentMetadata

image_classification_model_deployment_metadataUnion[dict,ImageClassificationModelDeploymentMetadata]

Model deployment metadata specific to Image Classification. If a dict is provided, it must be of the same form as the protobuf messageImageClassificationModelDeploymentMetadata

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

export_data

export_data(name,output_config,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Exports dataset's data to the provided output location. Returns an emptyresponse in theresponse field when it completes.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')

TODO: Initializeoutput_config:

output_config = {}

response = client.export_data(name, output_config)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
namestr

Required. The resource name of the dataset.

output_configUnion[dict,OutputConfig]

Required. The desired output location. If a dict is provided, it must be of the same form as the protobuf messageOutputConfig

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

export_model

export_model(name,output_config,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Exports a trained, "export-able", model to a user specified Google CloudStorage location. A model is considered export-able if and only if ithas an export format defined for it inModelExportOutputConfig.

Returns an empty response in theresponse field when it completes.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')

TODO: Initializeoutput_config:

output_config = {}

response = client.export_model(name, output_config)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
namestr

Required. The resource name of the model to export.

output_configUnion[dict,ModelExportOutputConfig]

Required. The desired output location and configuration. If a dict is provided, it must be of the same form as the protobuf messageModelExportOutputConfig

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

from_service_account_file

from_service_account_file(filename,*args,**kwargs)

Creates an instance of this client using the provided credentialsfile.

Parameter
NameDescription
filenamestr

The path to the service account private key json file.

Returns
TypeDescription
AutoMlClientThe constructed client.

from_service_account_json

from_service_account_json(filename,*args,**kwargs)

Creates an instance of this client using the provided credentialsfile.

Parameter
NameDescription
filenamestr

The path to the service account private key json file.

Returns
TypeDescription
AutoMlClientThe constructed client.

get_annotation_spec

get_annotation_spec(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Gets an annotation spec.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.annotation_spec_path('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]')

response = client.get_annotation_spec(name)

Parameters
NameDescription
namestr

The resource name of the annotation spec to retrieve.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

get_dataset

get_dataset(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Gets a dataset.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')

response = client.get_dataset(name)

Parameters
NameDescription
namestr

The resource name of the dataset to retrieve.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

get_model

get_model(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Gets a model.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')

response = client.get_model(name)

Parameters
NameDescription
namestr

Resource name of the model.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

get_model_evaluation

get_model_evaluation(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Gets a model evaluation.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.model_evaluation_path('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]')

response = client.get_model_evaluation(name)

Parameters
NameDescription
namestr

Resource name for the model evaluation.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

import_data

import_data(name,input_config,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Imports data into a dataset.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]')

TODO: Initializeinput_config:

input_config = {}

response = client.import_data(name, input_config)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
namestr

Required. Dataset name. Dataset must already exist. All imported annotations and examples will be added.

input_configUnion[dict,InputConfig]

Required. The desired input location and its domain specific semantics, if any. If a dict is provided, it must be of the same form as the protobuf messageInputConfig

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

list_datasets

list_datasets(parent,filter_=None,page_size=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Lists datasets in a project.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

parent = client.location_path('[PROJECT]', '[LOCATION]')

Iterate over all results

for element in client.list_datasets(parent):... # process element... pass

Alternatively:

Iterate over results one page at a time

for page in client.list_datasets(parent).pages:... for element in page:... # process element... pass

Parameters
NameDescription
parentstr

The resource name of the project from which to list datasets.

filter_str

An expression for filtering the results of the request. -dataset_metadata - for existence of the case (e.g. image_classification_dataset_metadata:*). Some examples of using the filter are: -translation_dataset_metadata:* --> The dataset has translation_dataset_metadata.

page_sizeint

The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

list_model_evaluations

list_model_evaluations(parent,filter_,page_size=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Lists model evaluations.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

parent = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')

TODO: Initializefilter_:

filter_ = ''

Iterate over all results

for element in client.list_model_evaluations(parent, filter_):... # process element... pass

Alternatively:

Iterate over results one page at a time

for page in client.list_model_evaluations(parent, filter_).pages:... for element in page:... # process element... pass

Parameters
NameDescription
parentstr

Resource name of the model to list the model evaluations for. If modelId is set as "-", this will list model evaluations from across all models of the parent location.

filter_str

An expression for filtering the results of the request. -annotation_spec_id - for =, != or existence. See example below for the last. Some examples of using the filter are: -annotation_spec_id!=4 --> The model evaluation was done for annotation spec with ID different than 4. -NOT annotation_spec_id:* --> The model evaluation was done for aggregate of all annotation specs.

page_sizeint

The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

list_models

list_models(parent,filter_=None,page_size=None,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Lists models.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

parent = client.location_path('[PROJECT]', '[LOCATION]')

Iterate over all results

for element in client.list_models(parent):... # process element... pass

Alternatively:

Iterate over results one page at a time

for page in client.list_models(parent).pages:... for element in page:... # process element... pass

Parameters
NameDescription
parentstr

Resource name of the project, from which to list the models.

filter_str

An expression for filtering the results of the request. -model_metadata - for existence of the case (e.g. image_classification_model_metadata:*). -dataset_id - for = or !=. Some examples of using the filter are: -image_classification_model_metadata:* --> The model has image_classification_model_metadata. -dataset_id=5 --> The model was created from a dataset with ID 5.

page_sizeint

The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

location_path

location_path(project,location)

Return a fully-qualified location string.

model_evaluation_path

model_evaluation_path(project,location,model,model_evaluation)

Return a fully-qualified model_evaluation string.

model_path

model_path(project,location,model)

Return a fully-qualified model string.

undeploy_model

undeploy_model(name,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Undeploys a model. If the model is not deployed this method has noeffect.

Only applicable for Text Classification, Image Object Detection; allother domains manage deployment automatically.

Returns an empty response in theresponse field when it completes.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]')

response = client.undeploy_model(name)

def callback(operation_future):... # Handle result.... result = operation_future.result()

response.add_done_callback(callback)

Handle metadata.

metadata = response.metadata()

Parameters
NameDescription
namestr

Resource name of the model to undeploy.

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

update_dataset

update_dataset(dataset,update_mask,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Updates a dataset.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

TODO: Initializedataset:

dataset = {}

TODO: Initializeupdate_mask:

update_mask = {}

response = client.update_dataset(dataset, update_mask)

Parameters
NameDescription
datasetUnion[dict,Dataset]

The dataset which replaces the resource on the server. If a dict is provided, it must be of the same form as the protobuf messageDataset

update_maskUnion[dict,FieldMask]

Required. The update mask applies to the resource. If a dict is provided, it must be of the same form as the protobuf messageFieldMask

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

update_model

update_model(model,update_mask,retry=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,timeout=<_MethodDefault._DEFAULT_VALUE: <objectobject>>,metadata=None)

Updates a model.

.. rubric:: Example

from google.cloud import automl_v1

client = automl_v1.AutoMlClient()

TODO: Initializemodel:

model = {}

TODO: Initializeupdate_mask:

update_mask = {}

response = client.update_model(model, update_mask)

Parameters
NameDescription
modelUnion[dict,Model]

The model which replaces the resource on the server. If a dict is provided, it must be of the same form as the protobuf messageModel

update_maskUnion[dict,FieldMask]

Required. The update mask applies to the resource. If a dict is provided, it must be of the same form as the protobuf messageFieldMask

retryOptional[google.api_core.retry.Retry]

A retry object used to retry requests. IfNone is specified, requests will be retried using a default configuration.

timeoutOptional[float]

The amount of time, in seconds, to wait for the request to complete. Note that ifretry is specified, the timeout applies to each individual attempt.

metadataOptional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.