Cloud PubSub V1 Client - Class AIInference (2.17.0)

Reference documentation and code samples for the Cloud PubSub V1 Client class AIInference.

Configuration for making inference requests against Vertex AI models.

Generated from protobuf message google.pubsub.v1.AIInference

Namespace

Google \ Cloud \ PubSub \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ endpoint string

Required. An endpoint to a Vertex AI model of the form projects/{project}/locations/{location}/endpoints/{endpoint} or projects/{project}/locations/{location}/publishers/{publisher}/models/{model}. Vertex AI API requests will be sent to this endpoint.

↳ unstructured_inference AIInference\UnstructuredInference

Optional. Requests and responses can be any arbitrary JSON object.

↳ service_account_email string

Optional. The service account to use to make prediction requests against endpoints. The resource creator or updater that specifies this field must have iam.serviceAccounts.actAs permission on the service account. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.

getEndpoint

Required. An endpoint to a Vertex AI model of the form projects/{project}/locations/{location}/endpoints/{endpoint} or projects/{project}/locations/{location}/publishers/{publisher}/models/{model}.

Vertex AI API requests will be sent to this endpoint.

Returns
Type Description
string

setEndpoint

Required. An endpoint to a Vertex AI model of the form projects/{project}/locations/{location}/endpoints/{endpoint} or projects/{project}/locations/{location}/publishers/{publisher}/models/{model}.

Vertex AI API requests will be sent to this endpoint.

Parameter
Name Description
var string
Returns
Type Description
$this

getUnstructuredInference

Optional. Requests and responses can be any arbitrary JSON object.

Returns
Type Description
AIInference\UnstructuredInference|null

hasUnstructuredInference

setUnstructuredInference

Optional. Requests and responses can be any arbitrary JSON object.

Parameter
Name Description
var AIInference\UnstructuredInference
Returns
Type Description
$this

getServiceAccountEmail

Optional. The service account to use to make prediction requests against endpoints. The resource creator or updater that specifies this field must have iam.serviceAccounts.actAs permission on the service account. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.

Returns
Type Description
string

setServiceAccountEmail

Optional. The service account to use to make prediction requests against endpoints. The resource creator or updater that specifies this field must have iam.serviceAccounts.actAs permission on the service account. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.

Parameter
Name Description
var string
Returns
Type Description
$this

getInferenceMode

Returns
Type Description
string