Class PredictionService.PredictionServiceClient (2.2.0)

public class PredictionServiceClient : ClientBase<PredictionService.PredictionServiceClient>

Client for PredictionService

Inheritance

Object > ClientBase > ClientBase<PredictionService.PredictionServiceClient> > PredictionService.PredictionServiceClient

Namespace

Google.Cloud.AutoML.V1

Assembly

Google.Cloud.AutoML.V1.dll

Constructors

PredictionServiceClient()

protected PredictionServiceClient()

Protected parameterless constructor to allow creation of test doubles.

PredictionServiceClient(CallInvoker)

public PredictionServiceClient(CallInvoker callInvoker)

Creates a new client for PredictionService that uses a custom CallInvoker.

Parameter
NameDescription
callInvokerCallInvoker

The callInvoker to use to make remote calls.

PredictionServiceClient(Channel)

[Obsolete("This constructor overload is present for compatibility only, and will be removed in the next major version")]
public PredictionServiceClient(Channel channel)

Creates a new client using a channel.

Parameter
NameDescription
channelGrpc.Core.Channel

The channel to use to make remote calls.

PredictionServiceClient(ChannelBase)

public PredictionServiceClient(ChannelBase channel)

Creates a new client for PredictionService

Parameter
NameDescription
channelChannelBase

The channel to use to make remote calls.

PredictionServiceClient(ClientBase.ClientBaseConfiguration)

protected PredictionServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBase.ClientBaseConfiguration

The client configuration.

Methods

BatchPredict(BatchPredictRequest, CallOptions)

public virtual Operation BatchPredict(BatchPredictRequest request, CallOptions options)

Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios:

  • AutoML Vision Classification
  • AutoML Vision Object Detection
  • AutoML Video Intelligence Classification
  • AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification
  • AutoML Natural Language Entity Extraction
  • AutoML Natural Language Sentiment Analysis
  • AutoML Tables
Parameters
NameDescription
requestBatchPredictRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

BatchPredict(BatchPredictRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual Operation BatchPredict(BatchPredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))

Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios:

  • AutoML Vision Classification
  • AutoML Vision Object Detection
  • AutoML Video Intelligence Classification
  • AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification
  • AutoML Natural Language Entity Extraction
  • AutoML Natural Language Sentiment Analysis
  • AutoML Tables
Parameters
NameDescription
requestBatchPredictRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

BatchPredictAsync(BatchPredictRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> BatchPredictAsync(BatchPredictRequest request, CallOptions options)

Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios:

  • AutoML Vision Classification
  • AutoML Vision Object Detection
  • AutoML Video Intelligence Classification
  • AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification
  • AutoML Natural Language Entity Extraction
  • AutoML Natural Language Sentiment Analysis
  • AutoML Tables
Parameters
NameDescription
requestBatchPredictRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Operation>

The call object.

BatchPredictAsync(BatchPredictRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<Operation> BatchPredictAsync(BatchPredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))

Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios:

  • AutoML Vision Classification
  • AutoML Vision Object Detection
  • AutoML Video Intelligence Classification
  • AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification
  • AutoML Natural Language Entity Extraction
  • AutoML Natural Language Sentiment Analysis
  • AutoML Tables
Parameters
NameDescription
requestBatchPredictRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCall<Operation>

The call object.

CreateOperationsClient()

public virtual Operations.OperationsClient CreateOperationsClient()

Creates a new instance of Operations.OperationsClient using the same call invoker as this client.

Returns
TypeDescription
Operations.OperationsClient

A new Operations client for the same target as this client.

NewInstance(ClientBase.ClientBaseConfiguration)

protected override PredictionService.PredictionServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBase.ClientBaseConfiguration
Returns
TypeDescription
PredictionService.PredictionServiceClient
Overrides
Grpc.Core.ClientBase<Google.Cloud.AutoML.V1.PredictionService.PredictionServiceClient>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

Predict(PredictRequest, CallOptions)

public virtual PredictResponse Predict(PredictRequest request, CallOptions options)

Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads:

AutoML Vision Classification

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Vision Object Detection

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Natural Language Classification

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Natural Language Entity Extraction

  • A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB.

AutoML Natural Language Sentiment Analysis

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Translation

  • A TextSnippet up to 25,000 characters, UTF-8 encoded.

AutoML Tables

  • A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING prediction_type.
Parameters
NameDescription
requestPredictRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
PredictResponse

The response received from the server.

Predict(PredictRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual PredictResponse Predict(PredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))

Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads:

AutoML Vision Classification

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Vision Object Detection

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Natural Language Classification

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Natural Language Entity Extraction

  • A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB.

AutoML Natural Language Sentiment Analysis

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Translation

  • A TextSnippet up to 25,000 characters, UTF-8 encoded.

AutoML Tables

  • A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING prediction_type.
Parameters
NameDescription
requestPredictRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
PredictResponse

The response received from the server.

PredictAsync(PredictRequest, CallOptions)

public virtual AsyncUnaryCall<PredictResponse> PredictAsync(PredictRequest request, CallOptions options)

Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads:

AutoML Vision Classification

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Vision Object Detection

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Natural Language Classification

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Natural Language Entity Extraction

  • A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB.

AutoML Natural Language Sentiment Analysis

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Translation

  • A TextSnippet up to 25,000 characters, UTF-8 encoded.

AutoML Tables

  • A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING prediction_type.
Parameters
NameDescription
requestPredictRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<PredictResponse>

The call object.

PredictAsync(PredictRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<PredictResponse> PredictAsync(PredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))

Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads:

AutoML Vision Classification

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Vision Object Detection

  • An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB.

AutoML Natural Language Classification

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Natural Language Entity Extraction

  • A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB.

AutoML Natural Language Sentiment Analysis

  • A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB.

AutoML Translation

  • A TextSnippet up to 25,000 characters, UTF-8 encoded.

AutoML Tables

  • A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING prediction_type.
Parameters
NameDescription
requestPredictRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineNullable<DateTime>

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCall<PredictResponse>

The call object.