rawPredict method

  1. @override
Future<HttpBody> rawPredict(
  1. RawPredictRequest request
)
override

Perform an online prediction with an arbitrary HTTP payload.

The response includes the following HTTP headers:

  • X-Vertex-AI-Endpoint-Id: ID of the Endpoint that served this prediction.

  • X-Vertex-AI-Deployed-Model-Id: ID of the Endpoint's DeployedModel that served this prediction.

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<HttpBody> rawPredict(RawPredictRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_rawPredict case final rawPredict?) {
    return rawPredict(request);
  }
  throw UnsupportedError('rawPredict');
}