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.
Asked
Active
Viewed 317 times
2 Answers
2
You could refer to Google.Cloud.AIPlatform.V1 documentation for reference for dot net. You can start by:
- Installing the package from Google AI Platform nuget
- 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.
- Check this EndpointServiceClient code sample for usage.
- 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.
- Specifically Predict(EndpointName, IEnumerable, Value, CallSettings) method where it accepts an endpoint as parameter.
- Check this PredictionServiceClient code sample for usage.

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();
...
}

Edward Olamisan
- 800
- 1
- 18
- 28