class ProjectsLocationsPublishersModels extends Resource (View source)

The "models" collection of methods.

Typical usage is:

 $aiplatformService = new Google\Service\Aiplatform(...);
 $models = $aiplatformService->projects_locations_publishers_models;

Methods

computeTokens(string $endpoint, GoogleCloudAiplatformV1ComputeTokensRequest $postBody, array $optParams = [])

Return a list of tokens based on the input text. (models.computeTokens)

countTokens(string $endpoint, GoogleCloudAiplatformV1CountTokensRequest $postBody, array $optParams = [])

Perform a token counting. (models.countTokens)

generateContent(string $model, GoogleCloudAiplatformV1GenerateContentRequest $postBody, array $optParams = [])

Generate content with multimodal inputs. (models.generateContent)

predict(string $endpoint, GoogleCloudAiplatformV1PredictRequest $postBody, array $optParams = [])

Perform an online prediction. (models.predict)

rawPredict(string $endpoint, GoogleCloudAiplatformV1RawPredictRequest $postBody, array $optParams = [])

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.

serverStreamingPredict(string $endpoint, GoogleCloudAiplatformV1StreamingPredictRequest $postBody, array $optParams = [])

Perform a server-side streaming online prediction request for Vertex LLM streaming. (models.serverStreamingPredict)

streamGenerateContent(string $model, GoogleCloudAiplatformV1GenerateContentRequest $postBody, array $optParams = [])

Generate content with multimodal inputs with streaming support.

streamRawPredict(string $endpoint, GoogleCloudAiplatformV1StreamRawPredictRequest $postBody, array $optParams = [])

Perform a streaming online prediction with an arbitrary HTTP payload.

Details

GoogleCloudAiplatformV1ComputeTokensResponse computeTokens(string $endpoint, GoogleCloudAiplatformV1ComputeTokensRequest $postBody, array $optParams = [])

Return a list of tokens based on the input text. (models.computeTokens)

Parameters

string $endpoint

Required. The name of the Endpoint requested to get lists of tokens and token ids.

GoogleCloudAiplatformV1ComputeTokensRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudAiplatformV1ComputeTokensResponse

Exceptions

Exception

GoogleCloudAiplatformV1CountTokensResponse countTokens(string $endpoint, GoogleCloudAiplatformV1CountTokensRequest $postBody, array $optParams = [])

Perform a token counting. (models.countTokens)

Parameters

string $endpoint

Required. The name of the Endpoint requested to perform token counting. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

GoogleCloudAiplatformV1CountTokensRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudAiplatformV1CountTokensResponse

Exceptions

Exception

GoogleCloudAiplatformV1GenerateContentResponse generateContent(string $model, GoogleCloudAiplatformV1GenerateContentRequest $postBody, array $optParams = [])

Generate content with multimodal inputs. (models.generateContent)

Parameters

string $model

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/models

GoogleCloudAiplatformV1GenerateContentRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudAiplatformV1GenerateContentResponse

Exceptions

Exception

GoogleCloudAiplatformV1PredictResponse predict(string $endpoint, GoogleCloudAiplatformV1PredictRequest $postBody, array $optParams = [])

Perform an online prediction. (models.predict)

Parameters

string $endpoint

Required. The name of the Endpoint requested to serve the prediction. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

GoogleCloudAiplatformV1PredictRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudAiplatformV1PredictResponse

Exceptions

Exception

GoogleApiHttpBody rawPredict(string $endpoint, GoogleCloudAiplatformV1RawPredictRequest $postBody, array $optParams = [])

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.

(models.rawPredict)

Parameters

string $endpoint

Required. The name of the Endpoint requested to serve the prediction. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

GoogleCloudAiplatformV1RawPredictRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleApiHttpBody

Exceptions

Exception

GoogleCloudAiplatformV1StreamingPredictResponse serverStreamingPredict(string $endpoint, GoogleCloudAiplatformV1StreamingPredictRequest $postBody, array $optParams = [])

Perform a server-side streaming online prediction request for Vertex LLM streaming. (models.serverStreamingPredict)

Parameters

string $endpoint

Required. The name of the Endpoint requested to serve the prediction. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

GoogleCloudAiplatformV1StreamingPredictRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudAiplatformV1StreamingPredictResponse

Exceptions

Exception

GoogleCloudAiplatformV1GenerateContentResponse streamGenerateContent(string $model, GoogleCloudAiplatformV1GenerateContentRequest $postBody, array $optParams = [])

Generate content with multimodal inputs with streaming support.

(models.streamGenerateContent)

Parameters

string $model

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/models

GoogleCloudAiplatformV1GenerateContentRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudAiplatformV1GenerateContentResponse

Exceptions

Exception

GoogleApiHttpBody streamRawPredict(string $endpoint, GoogleCloudAiplatformV1StreamRawPredictRequest $postBody, array $optParams = [])

Perform a streaming online prediction with an arbitrary HTTP payload.

(models.streamRawPredict)

Parameters

string $endpoint

Required. The name of the Endpoint requested to serve the prediction. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

GoogleCloudAiplatformV1StreamRawPredictRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleApiHttpBody

Exceptions

Exception