通过.Net连接vertex ai端点

发布于 2025-01-16 07:47:25 字数 67 浏览 2 评论 0原文

有没有办法通过.Net代码连接谷歌云平台服务vertex ai端点?我是 gcp 顶点的新手。任何帮助都是非常有价值的。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你在我安 2025-01-23 07:47:25

您可以参考 Google.Cloud.AIPlatform.V1 文档 供点网参考。您可以首先:

  1. Google AI Platform nuget 安装软件包
  2. 如果您还没有端点,您可以查看 Google.Cloud。 AIPlatform.V1.EndpointServiceClient。您可以使用此类来管理端点,例如创建端点、删除端点、部署端点等。
  3. 如果您有端点并且想要使用它运行预测,您可以查看 Google.Cloud.AIPlatform.V1.PredictionServiceClient。您可以使用此类通过端点执行预测。

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.
旧瑾黎汐 2025-01-23 07:47:25

重要的是!对于 Vertex AI,您必须在调用自定义训练模型时指定区域端点。请参阅 Java 示例链接。

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

}

具有自定义端点的 Java 示例

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文