# Cloud PubSub V1 Client - Class AIInference (2.19.3)

2.19.3 (latest) 2.19.2 2.18.0 2.17.0 2.16.2 2.15.1 2.14.0 2.13.2 2.12.0 2.11.3 2.10.1 2.9.1 2.8.2 2.7.0 2.6.0 2.5.2 2.4.0 2.3.0 2.2.1 2.1.2 1.50.0 1.49.0 1.48.0 1.47.0 1.46.5 1.45.2 1.44.0 1.43.2 1.42.1 1.41.3 1.40.1 1.39.3 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` | `https://docs.cloud.google.com/php/docs/reference/cloud-pubsub/latest/V1.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](https://cloud.google.com/iam/docs/service-agents), 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** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-pubsub/latest/V1.AIInference.UnstructuredInference|null` |   |

### hasUnstructuredInference

### setUnstructuredInference

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-pubsub/latest/V1.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](https://cloud.google.com/iam/docs/service-agents),
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](https://cloud.google.com/iam/docs/service-agents),
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` |   |