Skip to content

[Platform] Support Google Vertext AI as a platform #272

@aszenz

Description

@aszenz

Allow using gemini models from google cloud, gemini models are accessible via Google Vertex AI which is a similar kind of service to AWS bedrock

https://cloud.google.com/vertex-ai

We could use the google cloud php ai sdk to implement it as it supports credential chain discovery, similar to async bedrock runtime client, see:

https://github.com/googleapis/google-cloud-php-ai-platform

Example rawPredict request:

$predictionServiceClient = new Google\Cloud\AIPlatform\V1\Client\PredictionServiceClient();
$modelUrl = \sprintf(
    'projects/%s/locations/%s/%s',
    $this->googleCloudProject,
    self::GOOGLE_CLOUD_LOCATION,
    $modelId,
);
$response = $predictionServiceClient->rawPredict(
    request: RawPredictRequest::build(
        endpoint: $modelUrl,
        httpBody: new HttpBody(
            [
                'data' => \json_encode($payload)
            ]
        )
    )
);

See preview relevant issue: #146

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew featurePlatformIssues & PRs about the AI Platform componentRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions