google / cloud-recommendations-ai
Google Cloud Recommendation Engine 客户端 for PHP
v0.7.5
2024-06-01 03:14 UTC
Requires
- php: ^8.0
- google/gax: ^1.34.0
Requires (Dev)
- phpunit/phpunit: ^9.0
Suggests
- ext-grpc: Enables use of gRPC, a universal high-performance RPC framework created by Google.
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
This package is auto-updated.
Last update: 2024-08-31 04:04:03 UTC
README
Google Cloud Recommendations AI 的惯用 PHP 客户端。
注意: 该仓库是 Google Cloud PHP 的一部分。有关支持请求、错误报告或开发贡献,请将该项目指向该项目。
安装
首先,安装 PHP 偏好的依赖管理器 Composer。
现在安装此组件
$ composer require google/cloud-recommendations-ai
此组件支持 HTTP/1.1 上的 REST 和 gRPC。为了充分利用 gRPC 提供的好处(例如流方法),请参阅我们的 gRPC 安装指南。
身份验证
有关如何对客户端进行身份验证的更多信息,请参阅我们的 身份验证指南。一旦身份验证,您就可以开始发出请求。
示例
use Google\Cloud\RecommendationEngine\V1beta1\PredictionServiceClient; use Google\Cloud\RecommendationEngine\V1beta1\UserEvent; $client = new PredictionServiceClient(); $formattedName = $predictionServiceClient->placementName( '[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]' ); $userEvent = new UserEvent(); $predictions = $predictionServiceClient->predict($formattedName, $userEvent);
版本
此组件被视为测试版。因此,可以预期它将基本稳定,我们正在努力发布候选版本。我们将以更高的优先级处理问题和请求。
下一步
- 了解 官方文档。