Class PredictionService.PredictionServiceClient
Client for PredictionService
Inheritance
Inherited Members
Namespace: Google.Cloud.AutoML.V1
Assembly: Google.Cloud.AutoML.V1.dll
Syntax
public class PredictionServiceClient : ClientBase<PredictionService.PredictionServiceClient>
Constructors
PredictionServiceClient()
Protected parameterless constructor to allow creation of test doubles.
Declaration
protected PredictionServiceClient()
PredictionServiceClient(CallInvoker)
Creates a new client for PredictionService that uses a custom CallInvoker
.
Declaration
public PredictionServiceClient(CallInvoker callInvoker)
Parameters
Type | Name | Description |
---|---|---|
CallInvoker | callInvoker | The callInvoker to use to make remote calls. |
PredictionServiceClient(Channel)
Creates a new client using a channel.
Declaration
[Obsolete("This constructor overload is present for compatibility only, and will be removed in the next major version")]
public PredictionServiceClient(Channel channel)
Parameters
Type | Name | Description |
---|---|---|
Channel | channel | The channel to use to make remote calls. |
PredictionServiceClient(ChannelBase)
Creates a new client for PredictionService
Declaration
public PredictionServiceClient(ChannelBase channel)
Parameters
Type | Name | Description |
---|---|---|
ChannelBase | channel | The channel to use to make remote calls. |
PredictionServiceClient(ClientBase.ClientBaseConfiguration)
Protected constructor to allow creation of configured clients.
Declaration
protected PredictionServiceClient(ClientBase.ClientBaseConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
ClientBase.ClientBaseConfiguration | configuration | The client configuration. |
Methods
BatchPredict(BatchPredictRequest, CallOptions)
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
Declaration
public virtual Operation BatchPredict(BatchPredictRequest request, CallOptions options)
Parameters
Type | Name | Description |
---|---|---|
BatchPredictRequest | request | The request to send to the server. |
CallOptions | options | The options for the call. |
Returns
Type | Description |
---|---|
Operation | The response received from the server. |
BatchPredict(BatchPredictRequest, Metadata, Nullable<DateTime>, 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
Declaration
public virtual Operation BatchPredict(BatchPredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
BatchPredictRequest | request | The request to send to the server. |
Metadata | headers | The initial metadata to send with the call. This parameter is optional. |
System.Nullable<System.DateTime> | deadline | An optional deadline for the call. The call will be cancelled if deadline is hit. |
System.Threading.CancellationToken | cancellationToken | An optional token for canceling the call. |
Returns
Type | Description |
---|---|
Operation | The response received from the server. |
BatchPredictAsync(BatchPredictRequest, CallOptions)
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
Declaration
public virtual AsyncUnaryCall<Operation> BatchPredictAsync(BatchPredictRequest request, CallOptions options)
Parameters
Type | Name | Description |
---|---|---|
BatchPredictRequest | request | The request to send to the server. |
CallOptions | options | The options for the call. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<Operation> | The call object. |
BatchPredictAsync(BatchPredictRequest, Metadata, Nullable<DateTime>, 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
Declaration
public virtual AsyncUnaryCall<Operation> BatchPredictAsync(BatchPredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
BatchPredictRequest | request | The request to send to the server. |
Metadata | headers | The initial metadata to send with the call. This parameter is optional. |
System.Nullable<System.DateTime> | deadline | An optional deadline for the call. The call will be cancelled if deadline is hit. |
System.Threading.CancellationToken | cancellationToken | An optional token for canceling the call. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<Operation> | The call object. |
CreateOperationsClient()
Creates a new instance of Operations.OperationsClient using the same call invoker as this client.
Declaration
public virtual Operations.OperationsClient CreateOperationsClient()
Returns
Type | Description |
---|---|
Operations.OperationsClient | A new Operations client for the same target as this client. |
NewInstance(ClientBase.ClientBaseConfiguration)
Creates a new instance of client from given ClientBaseConfiguration
.
Declaration
protected override PredictionService.PredictionServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
ClientBase.ClientBaseConfiguration | configuration |
Returns
Type | Description |
---|---|
PredictionService.PredictionServiceClient |
Overrides
Predict(PredictRequest, CallOptions)
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
.
Declaration
public virtual PredictResponse Predict(PredictRequest request, CallOptions options)
Parameters
Type | Name | Description |
---|---|---|
PredictRequest | request | The request to send to the server. |
CallOptions | options | The options for the call. |
Returns
Type | Description |
---|---|
PredictResponse | The response received from the server. |
Predict(PredictRequest, Metadata, Nullable<DateTime>, 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
.
Declaration
public virtual PredictResponse Predict(PredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
PredictRequest | request | The request to send to the server. |
Metadata | headers | The initial metadata to send with the call. This parameter is optional. |
System.Nullable<System.DateTime> | deadline | An optional deadline for the call. The call will be cancelled if deadline is hit. |
System.Threading.CancellationToken | cancellationToken | An optional token for canceling the call. |
Returns
Type | Description |
---|---|
PredictResponse | The response received from the server. |
PredictAsync(PredictRequest, CallOptions)
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
.
Declaration
public virtual AsyncUnaryCall<PredictResponse> PredictAsync(PredictRequest request, CallOptions options)
Parameters
Type | Name | Description |
---|---|---|
PredictRequest | request | The request to send to the server. |
CallOptions | options | The options for the call. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<PredictResponse> | The call object. |
PredictAsync(PredictRequest, Metadata, Nullable<DateTime>, 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
.
Declaration
public virtual AsyncUnaryCall<PredictResponse> PredictAsync(PredictRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
PredictRequest | request | The request to send to the server. |
Metadata | headers | The initial metadata to send with the call. This parameter is optional. |
System.Nullable<System.DateTime> | deadline | An optional deadline for the call. The call will be cancelled if deadline is hit. |
System.Threading.CancellationToken | cancellationToken | An optional token for canceling the call. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<PredictResponse> | The call object. |