2

Is there any way to connected google cloud platform service vertex ai endpoint through .Net code ? I am new to gcp vertex. any help is really apricated.

tt0206
  • 747
  • 3
  • 9
  • 24

2 Answers2

2

You could refer to Google.Cloud.AIPlatform.V1 documentation for reference for dot net. You can start by:

  1. Installing the package from Google AI Platform nuget
  2. If you don't have an endpoint yet you can check out Google.Cloud.AIPlatform.V1.EndpointServiceClient. You can use this class to manage endpoints like create endpoint, delete endpoint, deploy endpoint, etc.
  3. If you have an endpoint and you want to run predictions using it, you can check out Google.Cloud.AIPlatform.V1.PredictionServiceClient. You can use this class to perform prediction using your endpoint.
Ricco D
  • 6,873
  • 1
  • 8
  • 18
  • I got to item 3 but get exception "Grpc.Core.RpcException: 'Status(StatusCode="Unimplemented", Detail="Bad gRPC response. HTTP status code: 404")'". Any pointers? – Edward Olamisan Aug 02 '23 at 18:39
0

Importantly! for Vertex AI you must specify a region endpoint when calling your custom trained model. See Java sample link.

const string regionEndpoint = "us-central1-aiplatform.googleapis.com:443";
try
{
    // Create client
    var serviceClientBuilder = new PredictionServiceClientBuilder
    {
        Endpoint = regionEndpoint
    };
    var predictionServiceClient = await serviceClientBuilder.BuildAsync();
    ...

}

Java sample with custom endpoint

Edward Olamisan
  • 800
  • 1
  • 18
  • 28