Module Contents



Hook for Google Cloud Vertex AI Prediction API.

class'google_cloud_default', delegate_to=None, impersonation_chain=None)[source]


Hook for Google Cloud Vertex AI Prediction API.


Return PredictionServiceClient object.


region (str | None) – The ID of the Google Cloud region that the service belongs to. Default is None.

Returns instance.

Return type

predict(endpoint_id, instances, location, project_id=PROVIDE_PROJECT_ID, parameters=None, retry=DEFAULT, timeout=None, metadata=())[source]

Perform an online prediction and returns the prediction result in the response.

  • endpoint_id (str) – Name of the endpoint_id requested to serve the prediction.

  • instances (list[str]) – Required. The instances that are the input to the prediction call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model.

  • parameters (dict[str, str] | None) – Additional domain-specific parameters, any string must be up to 25000 characters long.

  • project_id (str) – ID of the Google Cloud project where model is located if None then default project_id is used.

  • location (str) – The location of the project.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will not be retried.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

Was this entry helpful?