initial commit

This commit is contained in:
Jurgis Sakalauskas
2025-01-08 12:45:00 +02:00
commit 6df493fab3
86 changed files with 11890 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
namespace App\Services\Google;
class EndpointBuilderService
{
public function buildPredictionEndpoint(string $model): string
{
return $this->buildEndpoint($model, 'predict');
}
public function buildGenerationEndpoint(string $model): string
{
return $this->buildEndpoint($model, 'generateContent');
}
private function buildEndpoint(string $model, string $action): string
{
$projectId = env('GOOGLE_CLOUD_PROJECT');
$location = env('GOOGLE_LOCATION');
$modelPath = 'projects/' . $projectId .
'/locations/' . $location .
'/publishers/google/models/' . $model .
':' . $action;
return 'https://' . $location . '-aiplatform.googleapis.com/v1/' . $modelPath;
}
}