predict method

  1. @override
Future<PredictResponse> predict(
  1. PredictRequest request
)
override

Performs a prediction request.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

@override
Future<PredictResponse> predict(PredictRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_predict case final predict?) {
    return predict(request);
  }
  throw UnsupportedError('predict');
}